aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsystray21
1 files changed, 21 insertions, 0 deletions
diff --git a/systray b/systray
new file mode 100755
index 0000000..0ca3a44
--- /dev/null
+++ b/systray
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+hidden=/tmp/syshide.lock
+file="$XDG_CONFIG_HOME/polybar/config.ini"
+
+if [[ $(pidof stalonetray) ]]; then
+ if [[ ! -e $hidden ]]; then
+ polybar-msg action "#systray.hook.1"
+ xdo hide -n stalonetray
+ touch "$hidden"
+ perl -0 -i -pe 's/systray\ninitial=.*/systray\ninitial=2/g' "$file"
+ else
+ polybar-msg action "#systray.hook.0"
+ xdo show -n stalonetray
+ xdo raise -n stalonetray
+ rm "$hidden"
+ perl -0 -i -pe 's/systray\ninitial=.*/systray\ninitial=1/g' "$file"
+ fi
+else
+ stalonetray &
+fi