summaryrefslogtreecommitdiffstats
path: root/bspwm/.local/bin/toggle_tray
blob: c0819950cbbea52696f31e04c0a25d8207cf9288 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash

# from https://github.com/kallith/Dotfiles

if [ $(pgrep -cf stalonetray) -gt 0 ]; then
	wid=$(xdotool search --class stalonetray)
	if [ "$(xdotool search --onlyvisible --class stalonetray)" != "" ]; then
		xdotool windowunmap $wid
	else
		xdotool windowmap $wid
		xdotool windowraise $wid
	fi
else
	xdotool search --class stalonetray
	stalonetray
fi