aboutsummaryrefslogtreecommitdiff
path: root/xconky
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-01-19 19:07:21 -0200
committerSilvio Rhatto <rhatto@riseup.net>2013-01-19 19:07:21 -0200
commit3fa2db553c803b9d962835a5f6545a63b688ee1c (patch)
treebc1f51a1ae61a8991da59b186ad5a3a750550f9e /xconky
parentfbfc525880296fbfdac33a546fb568be7441f711 (diff)
downloadscripts-3fa2db553c803b9d962835a5f6545a63b688ee1c.tar.gz
scripts-3fa2db553c803b9d962835a5f6545a63b688ee1c.tar.bz2
More actions to xconky application
Diffstat (limited to 'xconky')
-rwxr-xr-xxconky46
1 files changed, 35 insertions, 11 deletions
diff --git a/xconky b/xconky
index d38fa55..269a1b0 100755
--- a/xconky
+++ b/xconky
@@ -1,19 +1,43 @@
#!/bin/bash
#
-# Start multiple conky instances
+# Conky wrapper
#
-# Default one
-conky &
+# Start multiple conky instances
+function xconky_start {
+ # Default one
+ conky &
+
+ # Give time for networking
+ sleep 60
+
+ # Load weather data first
+ weather &> /dev/null
+
+ # Clear cache
+ brweather --clean-cache
-# Give time for networking
-sleep 60
+ # Weather
+ conky -c ~/.conky/weather/conkyrc &
+}
-# Load weather data first
-weather &> /dev/null
+# Battery level if on laptop
+function xconky_battery {
+ if laptop-detect; then
+ echo '${color grey}${color grey}Power: ${battery BAT1} ${battery_bar 6}$'
+ fi
+}
-# Clear cache
-brweather --clean-cache
+# Show home usage
+function xconky_fs_home {
+ echo "~/ \$color\${fs_free $HOME}/\${fs_size $HOME} \${fs_bar 6 $HOME}"
+}
-# Weather
-conky -c ~/.conky/weather/conkyrc &
+# Parse
+if [ -z "$1" ] || [ "$1" == "start" ]; then
+ xconky_start
+elif [ "$1" == "battery" ]; then
+ xconky_battery
+elif [ "$1" = "fs_home" ]; then
+ xconky_fs_home
+fi