With this script you can easily start or stop your vicious widgets in awesome window manager. Especially useful to save some power when running the awesome window manager on battery with certain computationally intensive widgets.

Usage

I use it with laptop-mode, but you can also put it in /etc/rc.d/ to run it like a daemon.

The script

#!/bin/sh
#
# -rwx- /etc/laptop-mode/batt-stop/vicious.sh
#
# Script for laptop-mode start-stop-programs module

vicious_start() {
   /bin/bash -c "/bin/echo 'vicious.activate()' | /usr/bin/awesome-client"
   /bin/echo "Activated Vicious widgets for Awesome window manager."
}

vicious_stop() {
   /bin/bash -c "/bin/echo 'vicious.suspend()' | /usr/bin/awesome-client"
   # Some widgets are important while running on battery, BAT widget in particular
   /bin/bash -c "/bin/echo 'vicious.activate(mybattmon)' | /usr/bin/awesome-client"
   /bin/echo "Suspended Vicious widgets for Awesome window manager."
}

case "$1" in
   'start')
      vicious_start
      ;;
   'stop')
      vicious_stop
      ;;
   *)
      echo "usage $0 start|stop"
esac

Comments