Trigger launcher

Danny danny.milo at gmx.net
Sat Jul 5 00:36:14 CEST 2003


Hi!

Am Fre, 2003-07-04 um 19.12 schrieb Bernhard Walle:
> Hello,
> 
> currently there's a trigger launcher in CVS. It is ment for dialup
> connections but for this purpuse it's useless.
> 
> If I click to connect, there's no guarantee that the connection is
> really ok, but the icon state change. If I'm connected, I could be
> disconnected but the icon state doesn't change. So the icon state has
> nothing to do with the real state of the connection (in the "real
> world"). 
> 
> 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

hrm... it works already and it has already 3 different values as
argument.
The example for the non-bash fluent follows (still necessary - until I
finished my admin/generator utility for triggers):

#!/bin/sh
# file ~/.xfce4/tl-scripts/ppp-trigger
case "$1" in
"1")
	#ppp-up moo   #   for you redhat people out there
	#pppd call moo
	isdnctrl dial ippp0
	;;
"0")
	#ppp-down moo   #   for you redhat people out there
	isdnctrl hangup ippp0
	#killall pppd
	;;
*)
	# even though I have ISDN I have no idea how isdnctrl
	# works so add your "check running" code here...
	# (I'm always using the modem emulation ;))
	if [ ! -z "`pidof pppd >/dev/null`" ] # add ping / whatever...
	then
		echo "1"
	else
		echo "0"
	fi
esac
exit 0

(assumes bash and Linux)
chmod +x ~/.xfce4/tl-scripts/ppp-trigger

Then put that file as the "file to launch" in the trigger properties and
set the check interval.

Tell me if you need more :)

btw I dont want to implement the 3-command-in-one-property-dialog thing
because 1) it makes the dialog unnecessarily complex and weird and 2)
making 3 different executeable scripts for one task (maintaining the
dialup connection) ? O_o

Anyways, if you insist, I'm always open for patches ;)

> The icon state should only depend on the output of the 3rd command, i.e.
> just run it every two seconds (or so) and set the icon.

It does. ;P

> I looked at the code, the changes should be not very complicated, the
> only problem for me is how to run the check every two seconds ... But if
> someone if familar with the xfce code it would be trivial, I think. :-)

The interval in which the checks are done can be set in the plugin
preferences... 

> 
> Because the only feature I'm missing in xfce4 is to turn on/off my
> dialup connection it would be great if something in this direction would
> be realized. 
> 
> 
> Regards,
> Bernhard

cheers,
   Danny






More information about the Xfce4-dev mailing list