aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsystray28
1 files changed, 12 insertions, 16 deletions
diff --git a/systray b/systray
index 0ca3a44..0fbc768 100755
--- a/systray
+++ b/systray
@@ -1,21 +1,17 @@
-#!/bin/bash
+#!/usr/bin/env bash
hidden=/tmp/syshide.lock
-file="$XDG_CONFIG_HOME/polybar/config.ini"
+file="$HOME/.config/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
+if [[ ! -e $hidden ]]; then
+ polybar-msg action "#systray.hook.1"
+ xdo hide -n stalonetray
+ touch "$hidden"
+ sed -i 's/systray\ninitial=.*/systray\ninitial=2/g' "$file"
else
- stalonetray &
+ polybar-msg action "#systray.hook.0"
+ xdo show -n stalonetray
+ xdo raise -n stalonetray
+ rm "$hidden"
+ sed -i 's/systray\ninitial=.*/systray\ninitial=1/g' "$file"
fi