-
Notifications
You must be signed in to change notification settings - Fork 2
/
watchps_tray
33 lines (26 loc) · 1.23 KB
/
watchps_tray
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
# Este script é para ser hookado no arquivo i3config, usando os seletores for_window do i3wm.
# EN: script to be hooked in i3config file, with for_window i3w selectors.
# polybar-i3-dynamic-trayoffset A bunch of scripts able to create a "dynamic traybar" experience for Polybar in i3wm, making it behave kinda like a module.
# Copyright (C) 2020- Daltro Augusto
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
PS=$1
polybar_trayoffset add "$2"
while true
do
if [ "$(pidof "${PS}" | wc -l)" -eq 0 ]; then
polybar_trayoffset remove "$2"
break
fi
sleep 1
done