On 7/20/05, Matias Rollan <[EMAIL PROTECTED]> wrote: > Hola ! > > On Wed, Jul 20, 2005 at 06:44:16PM -0400, hacker (of golf) wrote: > > I'm trying to create a popup to show the connection speed. > > > > I'm trying this: > > > > root :~# kdialog --display localhost:0 --msgbox "Connection Speed > > `tail -n1 /var/log/ppp-connect-errors | awk '{ print $6 }'` bps" > > kdialog: cannot connect to X server localhost:0 > > > > but, as you can see, it won't connect to the xserver. > > > > How can I get this to work? > > > > If you running the X server as the same user you are trying to execute > "kdialog" you might want to try this:
actually, I'm not. > > root:~# kdialog --msgbox "This is a test." --display `env |grep -i display > |cut > -d'=' -f 2` > > or better instead of doing that [env|grep|cut] just use: > > # kdialog --msgbox "this is a test" --display $DISPLAY > > which actually is what we want to get , the value for DISPLAY > environment variable. :) > > [ instead of using "localhost:0" take a look at the DISPLAY environment > variable ] > > If you are not running the X server as the user who wants to execute the > > kdialog and you want let others [any] user from [any] host [ not recommended > ] : > $ xhost + > # export DISPLAY=:0.0 && kdialog... this works: root :~# export DISPLAY=:0 ; kdialog --msgbox "this is test" --display :0 Link points to "/tmp/ksocket-root" QPixmap: Cannot create a QPixmap when no GUI is being used QPixmap: Cannot create a QPixmap when no GUI is being used Link points to "/tmp/kde-root" QPixmap: Cannot create a QPixmap when no GUI is being used QPixmap: Cannot create a QPixmap when no GUI is being used kbuildsycoca running... Launched ok, pid = 6532 Mutex destroy failure: Device or resource busy ICE default IO error handler doing an exit(), pid = 6529, errno = 0 ICE default IO error handler doing an exit(), pid = 6524, errno = 0 > > Other option would be ssh forwarding to your own box. > $ ssh -Xf [EMAIL PROTECTED] 'kdialog --msgbox ......... ' > > I hope it helps, Yes, I added: kdialog --display :0 --msgbox "`tail -n1 /var/log/ppp-connect-errors | cut -b 8-` bps" to the end of /etc/ppp/ip-up and now I get a popup telling me the connection speed. > -- > Matías Rollán > <[EMAIL PROTECTED]> regards,