aboutsummaryrefslogtreecommitdiff
path: root/systray
diff options
context:
space:
mode:
authorsrdusr <trevorgray@srdusr.com>2024-03-18 23:10:10 +0200
committersrdusr <trevorgray@srdusr.com>2024-03-18 23:10:10 +0200
commite1f13cc33d4540f148091258e323841aa698404a (patch)
tree1ccb3a7e7b4d6ae621ce763d8e7eb69f58d07f2d /systray
parent166e0e201429aab1d7500c3525182960a8c87721 (diff)
downloaddotfiles-e1f13cc33d4540f148091258e323841aa698404a.tar.gz
dotfiles-e1f13cc33d4540f148091258e323841aa698404a.zip
Fixed systray interaction with bspwm and polybar
Diffstat (limited to 'systray')
-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