|
|
@ -1,18 +1,25 @@ |
|
|
|
#!/bin/sh |
|
|
|
#!/bin/sh |
|
|
|
|
|
|
|
|
|
|
|
# Suppress output |
|
|
|
# Suppress output |
|
|
|
NULL="> /dev/null 2>&1" |
|
|
|
NULL="" |
|
|
|
|
|
|
|
|
|
|
|
# Scroll up, scroll down |
|
|
|
# Scroll up, scroll down |
|
|
|
U="A4:i3-msg workspace prev_on_output $NULL:" |
|
|
|
if [ "$WM" = "bspwm" ];then |
|
|
|
D="A5:i3-msg workspace next_on_output $NULL:" |
|
|
|
SWITCH="bspc desktop -f" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
U="A4:$SWITCH prev.local:" |
|
|
|
|
|
|
|
D="A5:$SWITCH next.local:" |
|
|
|
|
|
|
|
elif [ "$WM" = "i3" ];then |
|
|
|
|
|
|
|
SWITCH="i3-msg workspace" |
|
|
|
|
|
|
|
NULL="> /dev/null 2>&1" |
|
|
|
|
|
|
|
|
|
|
|
# i3 |
|
|
|
U="A4:$SWITCH prev_on_output $NULL:" |
|
|
|
# WMNAME="$(xprop -root '\t$0' _NET_WM_NAME | cut -f 2 | tr -d '"')" |
|
|
|
D="A5:$SWITCH next_on_output $NULL:" |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
CURRENT=$(xprop -root _NET_CURRENT_DESKTOP | awk '{print $3 + 1}') |
|
|
|
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 \ |
|
|
|
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" ' |
|
|
|
-v c7="$COLOR7" -v c15="$COLOR15" -v b="$BGCOLOR" -v bi="$BGCOLOR_INACTIVE" ' |
|
|
|
/".*"/ { |
|
|
|
/".*"/ { |
|
|
|
name = substr($0, 2, length($0) - 2); |
|
|
|
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}", |
|
|
|
printf "%{B%s} %s %{B%s}", |
|
|
|
b, name, bi |
|
|
|
b, name, bi |
|
|
|
else |
|
|
|
else |
|
|
|
printf "%{F%s}%{A:i3-msg workspace %s %s:} %s %{A}%{F%s}", |
|
|
|
printf "%{F%s}%{A:%s \"%s\" %s:} %s %{A}%{F%s}", |
|
|
|
c7, name, n, name, c15 |
|
|
|
c7, s, name, n, name, c15 |
|
|
|
} |
|
|
|
} |
|
|
|
')" |
|
|
|
')" |
|
|
|
|
|
|
|
|
|
|
|