Trigger launcher
Bernhard Walle
Bernhard.Walle at gmx.de
Sat Jul 5 00:27:03 CEST 2003
Hello,
On Fri, 04 Jul 2003 at 19:55 (+0200), Benedikt Meurer wrote:
> On Fri, 04, Jul 2003, Bernhard Walle wrote:
>
> > So I suggest following:
> >
> > Three commands: 1st command: Off->On (e.g. isdnctrl dial ippp0)
> > 2nd command: On->Off (e.g. isdnctrl hangup ippp0)
> > 3rd command: State returns 0 if 'On' and another
> > code otherwise
>
> I'd suggest the 1st and 2nd command to also return 0 on success, so
> the icon can be set right after the 1st/2nd command is executed.
I looked at the source code and something like this is implemented
already, but not documented :-(
For checking the state the trigger calls the comand without arguments
and checks for 1 or 0 on stdout. For starting, it runs the command with
"1" argument, for stopping with "0".
The only missing feature is checking the state regulary, the version in
CVS checks the state only on startup which makes little sense for me.
So I hacked a "works for me version", patch attached. I think this
feature should be implemented by the author before 4.0-release because
without checking regulary it makes no sense.
A sample script for ISDN users would be
,----[ xfcedial ]-
| #!/bin/sh
|
|
| OUTPUT=`/usr/sbin/isdnctrl status ippp0`
|
| if [ "$OUTPUT" = "ippp0 is not connected" ] ; then
| echo 0
| else
| echo 1
| fi
|
| if [ "$1" = "1" ] ; then
| /usr/sbin/isdnctrl dial ippp0
| elif [ "$1" = "0" ] ; then
| /usr/sbin/isdnctrl hangup ippp0
| fi
`----
Regards,
Bernhard
--
More information about the Xfce4-dev
mailing list