From 1c584837e851cb969518bb80a762ba1b59d4ba1f Mon Sep 17 00:00:00 2001 From: srdusr Date: Mon, 1 Jan 2024 23:57:14 +0200 Subject: Add systray --- systray | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 systray (limited to 'systray') 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 -- cgit v1.2.3