aboutsummaryrefslogtreecommitdiff
path: root/xconky
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-09-18 16:38:30 -0300
committerSilvio Rhatto <user@example.org>2014-09-18 16:38:30 -0300
commit9181c40eae371a758a68db47a79b124cf4141986 (patch)
treed1ade9808bf715a7b47e8a976a15e761b1ec1939 /xconky
downloadutils-x11-9181c40eae371a758a68db47a79b124cf4141986.tar.gz
utils-x11-9181c40eae371a758a68db47a79b124cf4141986.tar.bz2
Initial import
Diffstat (limited to 'xconky')
-rwxr-xr-xxconky57
1 files changed, 57 insertions, 0 deletions
diff --git a/xconky b/xconky
new file mode 100755
index 0000000..f03feb7
--- /dev/null
+++ b/xconky
@@ -0,0 +1,57 @@
+#!/bin/bash
+#
+# Conky wrapper
+#
+
+# Start multiple conky instances
+function xconky_start {
+ # Default one
+ conky &
+
+ # Weather
+ if [ -e "$HOME/.brweather.conf" ]; then
+ # Give time for networking
+ sleep 60
+
+ # Load weather data first
+ weather &> /dev/null
+
+ # Clear cache
+ brweather --clean-cache
+
+ # Weather
+ conky -c ~/.conky/weather/conkyrc &
+ fi
+}
+
+# Battery level if on laptop
+function xconky_battery {
+ if laptop-detect; then
+ echo '${color grey}${color grey}Power: ${battery} ${battery_bar 6}'
+ fi
+}
+
+# Show home usage
+function xconky_fs_home {
+ echo "~/ \$color\${fs_free $HOME}/\${fs_size $HOME} \${fs_bar 6 $HOME}"
+}
+
+# Refresh all instances
+function xconky_refresh {
+ # Clear cache
+ brweather --clean-cache
+
+ # Send HUP
+ killall -USR1 conky
+}
+
+# Parse
+if [ -z "$1" ] || [ "$1" == "start" ]; then
+ xconky_start
+elif [ "$1" == "battery" ]; then
+ xconky_battery
+elif [ "$1" = "fs_home" ]; then
+ xconky_fs_home
+elif [ "$1" = "refresh" ]; then
+ xconky_refresh
+fi