#!/bin/bash case "$1" in rhythmbox) ps -C rhythmbox && ( rhythmbox-client --quit ) || rhythmbox & ;; screen) [[ -e "/tmp/.dpms" ]] && ( xset dpms force on && rm -f /tmp/.dpms ) || ( xset dpms force off && touch /tmp/.dpms ) ;; totem) ps -C totem && ( totem --quit ) || totem --fullscreen & ;; tvtime) ps -C tvtime && ( tvtime-command QUIT ) || tvtime -m & ;; *) ps -C $1 && ( killall $1 ) || $1 & ;; esac