Re: FVWM: PPP on-off button

From: Paul Seelig <pseelig_at_goofy.zdv.Uni-Mainz.de>
Date: 10 Oct 1997 21:33:06 +0200

oliver_at_math.uci.edu (Marcel Oliver) writes:

> A "PPP on-off button" in GoodStuff which displays
> an icon (telephone). When you click on it, it
> runs a script (ppp-on, for setting up a ppp connection
> to your internet provider) and displays another icon
> (telephone off the hook). If you click once more
> it runs another script (ppp-off, for closing the
> ppp connection) and displays the first icon again.
>
How about this in "~/.fvwm2rc":
-------------cut-here---------------------------
# Keyboard accelerators
Key F1 A C exec mount /cdrom
Key F2 A C exec umount /cdrom
Key F3 A C WindowList
Key F4 A C Delete
Key F5 A C Move
Key F6 A C Resize
Key F7 A C exec xterm +sb -fn fixed -g 118x35 -T "Midnight Commander" -e mc -x &
Key F8 A C exec xdos &
Key F9 A C Iconify
Key F10 A C Destroy
Key F11 A C exec pon <---
Key F12 A C exec poff <---
-------------cut-here---------------------------

"/usr/bin/pon":
-------------cut-here---------------------------
#!/bin/sh
if [ -r /etc/ppp.options_out -a -r /etc/ppp.chatscript ]; then
        /usr/sbin/pppd connect "/usr/sbin/chat -v -f /etc/ppp.chatscript" `cat /etc/ppp.options_out`
else
        echo "You do not have permissions to access /etc/ppp.chatscript or /etc/ppp.options_out"
fi
-------------cut-here---------------------------

"/usr/bin/poff":
-------------cut-here---------------------------
#!/bin/sh

# Lets see how many pppds are running....
N=`ls /var/run/ppp* 2>/dev/null| wc -l`

# If there no ppp running then poff does not make much sense
if [ $N = 0 ]; then
        echo "No pppd is running"
        exit 1
fi
# If one is running then it cal be killed with killall
if [ $N = 1 ]; then
        killall pppd
        exit 0
fi
# More than one! Aieehh.. Dont know which one to kill.
echo "More than one pppd running. None stopped"
exit 1
-------------cut-here---------------------------

Works even without a mouse!
                              Cheers, P. *8^)
--
   Paul Seelig                         pseelig_at_goofy.zdv.uni-mainz.de
   African Music Archive - Institute for Ethnology and Africa Studies
   Johannes Gutenberg-University   -  Forum 6  -  55099 Mainz/Germany
   My Homepage in the WWW at the URL http://www.uni-mainz.de/~pseelig 
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_hpc.uh.edu.
To report problems, send mail to fvwm-owner_at_hpc.uh.edu.
Received on Fri Oct 10 1997 - 14:28:23 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:38:01 BST