-
Notifications
You must be signed in to change notification settings - Fork 1
/
conky.sh
executable file
·52 lines (42 loc) · 1.18 KB
/
conky.sh
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
cd "$(dirname "$0")"
if [ ! -f ./conky-sidebar.conf ]; then
echo "please mv conky-sidebar.conf.sample to conky-sidebar.conf and configure it"
exit 1
else
source ./conky-sidebar.conf
fi
if [ ! -d "cache" ];then
mkdir cache
touch cache/forecast.json
touch cache/weather.json
touch cache/gallery.log
fi
# kill feh, since otherwise conky-gallery-display is broken
if pgrep -x feh > /dev/null; then
killall feh
sleep 1
fi
# kill mouse handler
proc=$(ps aux | grep hdl_mouse_events | grep -v grep | tr -s " " | cut -d" " -f2); [[ "$proc" =~ ^.+$ ]] && echo $proc | xargs kill
# kill conky
if pgrep -x conky > /dev/null; then
echo "is running..." >> /var/log/conky.log
killall conky
echo "killed" >> /var/log/conky.log
fi
sleep 2
conky -c "${conkydir}/conky.conf" >> /var/log/conky.log 2>&1 &
winid=''
while [ "$winid" == "" ]; do
sleep 0.1
winid=$(wmctrl -l | grep hidden_conky | cut -d" " -f1)
done
conky -c "${conkydir}/conky_gallery.conf" >> /var/log/conky.log 2>&1 &
winid=''
while [ "$winid" == "" ]; do
sleep 0.1
winid=$(wmctrl -l | grep hidden_conky_gallery | cut -d" " -f1)
done
"${conkydir}"/hdl_mouse_events.sh $winid >> /var/log/conky.log 2>&1 &
exit