[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Launching KPPP from desktop with root loses dsktop icons and wallpapers...



On Fri, 4 Feb 2005, Phillip Pi wrote:

I placed KDE v3.3.1's KPPP icon on my desktop on my Debian v3.1 box
<...>

I could only guess as to what is going on since I have never used KPPP. Make sure the user is a member of the "dip" and "dialout" groups (use the "groups" command), then try it without the su to root.


To get an icon on the desktop without using KPPP I did the following:

As root...
# pppconfig
and setup for your ISP, then place the ppptoggle script in /usr/local/bin and do
# chmod a+x /usr/local/bin/ppptoggle.sh
to make sure it is executable.

--- /usr/local/bin/ppptoggle.sh ---
# ppptoggle
#
# toggles ppp network access
# synopsis: ppptoggle <provider>
# <provider> is the name of a provider configured with pppconfig

pppup=`/sbin/ifconfig | grep ppp0 | cut -d" " -f1`

if [ "$pppup" = "ppp0" ]; then
  poff \
  && sed -i 's/Icon=nfs_mount/Icon=nfs_unmount/' \
         $HOME/Desktop/${1}.desktop
else
  pon $1 \
  && sed -i 's/Icon=nfs_unmount/Icon=nfs_mount/' \
         $HOME/Desktop/${1}.desktop
fi
---

A user places the following *.desktop file on their Desktop and clicks to connect or disconnect. Note: replace all occurrences of ISP with the name you used with pppconfig (default: provider).

--- $HOME/Desktop/ISP.desktop ---
[Desktop Entry]
Encoding=UTF-8
Exec=/usr/local/bin/ppptoggle.sh ISP
GenericName=toggle the PPP network interface
Comment=connect/disconnect from ISP
Icon=nfs_unmount
Name=ISP
StartupNotify=false
Terminal=false
Type=Application
X-DCOP-ServiceType=none
---


Bugs:

The icon can get out of sync with the state of the ppp connection if you (or a script) does "poff" or "pon" instead of "ppptoggle", it will sync with the next click. ppptoggle assumes ppp0. Errors not handled.


Improvements:

- create ppp_on and ppp_off icons
- integrate with RBM->Create New->Device
- integrate with pppconfig
- support other desktops
- ...


- Bruce (hoping he didn't make any typos while cleaning it up :-)



Reply to: