Add WM export, make workspaces block bspwm compatible
This commit is contained in:
@@ -24,6 +24,6 @@ redshift &
|
||||
|
||||
thunar --daemon &
|
||||
|
||||
sxhkd "$XDG_CONFIG_HOME/sxhkd/i3" &
|
||||
sxhkd "$XDG_CONFIG_HOME/sxhkd/$WM" &
|
||||
|
||||
exec i3
|
||||
exec $WM
|
||||
|
||||
@@ -43,6 +43,9 @@ export TERMINAL="urxvt"
|
||||
# Vim
|
||||
export VIMINIT="source $XDG_CONFIG_HOME/vim/vimrc"
|
||||
|
||||
# WM
|
||||
export WM="i3"
|
||||
|
||||
# Xorg
|
||||
export XINITRC="$XDG_CONFIG_HOME/xorg/xinitrc"
|
||||
export XAUTHORITY="$XDG_DATA_HOME/xorg/Xauthority"
|
||||
|
||||
@@ -52,7 +52,7 @@ start() {
|
||||
trap 'trap - TERM; kill 0' INT TERM QUIT EXIT
|
||||
|
||||
# Create named pipe
|
||||
[ -e "$PIPE" ] && rm "$PIPE"
|
||||
[ -p $PIPE ] && rm "$PIPE"
|
||||
mkfifo "$PIPE"
|
||||
|
||||
# Directory of this script
|
||||
|
||||
@@ -1,18 +1,25 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Suppress output
|
||||
NULL="> /dev/null 2>&1"
|
||||
NULL=""
|
||||
|
||||
# Scroll up, scroll down
|
||||
U="A4:i3-msg workspace prev_on_output $NULL:"
|
||||
D="A5:i3-msg workspace next_on_output $NULL:"
|
||||
if [ "$WM" = "bspwm" ];then
|
||||
SWITCH="bspc desktop -f"
|
||||
|
||||
# i3
|
||||
# WMNAME="$(xprop -root '\t$0' _NET_WM_NAME | cut -f 2 | tr -d '"')"
|
||||
U="A4:$SWITCH prev.local:"
|
||||
D="A5:$SWITCH next.local:"
|
||||
elif [ "$WM" = "i3" ];then
|
||||
SWITCH="i3-msg workspace"
|
||||
NULL="> /dev/null 2>&1"
|
||||
|
||||
U="A4:$SWITCH prev_on_output $NULL:"
|
||||
D="A5:$SWITCH next_on_output $NULL:"
|
||||
fi
|
||||
|
||||
CURRENT=$(xprop -root _NET_CURRENT_DESKTOP | awk '{print $3 + 1}')
|
||||
WORKSPACES="$(xprop -root '\n$0\n$1\n$2\n$3\n$4\n$5\n$6\n$7\n$8\n$9' _NET_DESKTOP_NAMES \
|
||||
| awk -v c="$CURRENT" -v n="$NULL" \
|
||||
| awk -v c="$CURRENT" -v s="$SWITCH" -v n="$NULL" \
|
||||
-v c7="$COLOR7" -v c15="$COLOR15" -v b="$BGCOLOR" -v bi="$BGCOLOR_INACTIVE" '
|
||||
/".*"/ {
|
||||
name = substr($0, 2, length($0) - 2);
|
||||
@@ -21,8 +28,8 @@ WORKSPACES="$(xprop -root '\n$0\n$1\n$2\n$3\n$4\n$5\n$6\n$7\n$8\n$9' _NET_DESKTO
|
||||
printf "%{B%s} %s %{B%s}",
|
||||
b, name, bi
|
||||
else
|
||||
printf "%{F%s}%{A:i3-msg workspace %s %s:} %s %{A}%{F%s}",
|
||||
c7, name, n, name, c15
|
||||
printf "%{F%s}%{A:%s \"%s\" %s:} %s %{A}%{F%s}",
|
||||
c7, s, name, n, name, c15
|
||||
}
|
||||
')"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user