updated on Tue Jan 10 12:02:00 UTC 2012
[aur-mirror.git] / openarch_conky / conkyrun
blob9fe60d3af523f5d5929121a91a0f04ad500472d3
1 #!/bin/bash
2 #########################################
3 ## Control script for conkyclockwidget ##
4 ## by jpope ##
5 ## v 1.0.2010.10.19 ##
6 ## Modified my OvsInc ##
7 #########################################
8 cnfg1="/usr/share/conky/clockwidget/conkyclockwdgtrc"
9 cnfg1btn="/usr/share/conky/clockwidget/btnclockwdgt.py"
10 confdir="${HOME}/.conky/clockwidget"
11 conf="${confdir}/clockswitch"
12 main="/usr/share/conky/conky_main/conkyrc_main"
14 conky-start()
16 if [[ $(pgrep -f "${main}") ]]; then
17 echo "Conky main window is already running. Use $0 restart"
18 else
19 conky -q -c "${main}"
22 if [[ $(pgrep -f "${cnfg1}") ]]; then
23 echo "Conky clock widget is already running. Use $0 restart"
24 else
25 [[ -r ${cnfg1} ]] && \
26 (sleep 1s
27 mkdir -p "${confdir}" 2>/dev/null
28 echo "0" > "${conf}"
29 conky -q -c "${cnfg1}") &
30 [[ -r ${cnfg1btn} ]] && /usr/bin/python2 "${cnfg1btn}" &
34 conky-stop()
36 pkill -f clockwdgt && echo "Clockwidget stopped" || echo "Clockwidget is not running"
37 pkill -f conky_main && echo "Conkymain stopped" || echo "Conkymain is not running"
40 case $1 in
41 stop )
42 conky-stop;;
43 start )
44 conky-start;;
45 restart )
46 conky-stop
47 sleep .5
48 conky-start
50 * )
51 echo 'usage ( start | stop | restart )'
53 esac
54 exit