programming two-state launcher

Brian J. Tarricone bjt23 at cornell.edu
Tue Jan 18 20:55:22 CET 2005


Dennis J. Tuchler wrote:

>I would appreciate help in setting up the two-state launcher.  For example, If 
>I put a "mount" command in the proper blank, how do I get the "umount" 
>command, or does clicking the "off" icon take care of that automatically 
>(although I can't see how).
>
IIRC, the two-state launcher only runs a single command.  for the "on" 
action, it runs the command passing "1" as the first commandline 
argument, and for the "off" action, it passes "0".  so you'd need to 
write a script, something like this:

#!/bin/bash
[ "$1" = "1" ] && mount /mnt/foobar || umount /mnt/foobar

    -brian



More information about the Xfce mailing list