Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Mon 01 Sep 2014, 18:03
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
gxmessage/yaf-splash not displayed from script
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [28 Posts]   Goto page: 1, 2 Next
Author Message
jafadmin

Joined: 19 Mar 2009
Posts: 422

PostPosted: Thu 24 Apr 2014, 00:43    Post subject:  gxmessage/yaf-splash not displayed from script  

I have written a script that monitors the connection state of a VPN connection. It basically uses gxmessage to alert the user when the VPN tunnel drops.

I'm trying to call it from the "ip-up" script that automatically runs after vpn connects.

The problem is that the gxmessage doesn't display. The scripts are executing, and test code that prints out to a file from both scripts prints ok (echo "test text 3" >> /etc/ppp/test.out), but the gxmessages will not pop up on the user console.

What am I overlooking here?

Thanks in advance. I've been pulling my hair out for 6 hours on this so far ... Rolling Eyes

[Update]

WooHoo! Cool I figured it out! gxmessage needed the "-display :0" switch if you are not directly executing the script from the console.

Last edited by jafadmin on Sun 27 Apr 2014, 12:35; edited 2 times in total
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 8230

PostPosted: Thu 24 Apr 2014, 05:58    Post subject:  

hmmm odd...but the really useful gxmessage was removed and I am not sure if it ever returned so it may be a hacky gtkdialog script as I use it from scripts all the time and never have had to add that parameter...or gtk has gone weird Very Happy...or bash has gone weird? or we have gone weird....

Heres a copy of the 'real' gxmessage.

mike
gxmessage.tar.gz
Description 
gz

 Download 
Filename  gxmessage.tar.gz 
Filesize  30 KB 
Downloaded  25 Time(s) 
Back to top
View user's profile Send private message 
Karl Godt


Joined: 20 Jun 2010
Posts: 3964
Location: Kiel,Germany

PostPosted: Fri 25 Apr 2014, 04:44    Post subject:  

The DISPLAY=:0 switch is needed if the script is started before X is started , fx from /etc/init.d/ directory .

Otherwise if dropped into /root/Startup it will start after X has started , so would not need the DISPLAY variable being set .

X will export DISPLAY variable systemwide when started .

Code:
if test -z "$DISPLAY"; then
export DISPLAY=':0'
fi
Back to top
View user's profile Send private message Visit poster's website 
jafadmin

Joined: 19 Mar 2009
Posts: 422

PostPosted: Sun 27 Apr 2014, 12:32    Post subject:  

Great. Here we go again . . .

Ok, so I got this brilliant idea to use yaf-splash (gtkdialog-splash) instead of gxmessage because I can have the notice appear at the top-center of the screen and exit with a mouse-over.

Works great from the command line.
Works great in a script clicked from roxfiler.
works great in a script called from another script clicked by roxfiler.
Code:

yaf-splash -bg green -placement top -timeout 5 -display :0 -text " Your text goes here . . . "


It doesn't work when called from the ip-up script used by pppd. gxmessage does, though.

I don't get it. There has to be something with permissions or context or scope or something that I can't see.

all the vpn processes run as root. . . .

any ideas?
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 8230

PostPosted: Sun 27 Apr 2014, 13:34    Post subject:  

Same reason I assume...its lauched before X... in this case you will need gtkdialog 4 options to see if you can use your display fix and hope that the awful yaf-splash script passes them on .... you could use the real yaf-splash but it does not support unicode which is why it should never have appeared in the first place.. Very Happy

Perhaps if binaries were actually what they appear to be, puppy would be more fun to write for Very Happy

mike
Back to top
View user's profile Send private message 
jafadmin

Joined: 19 Mar 2009
Posts: 422

PostPosted: Sun 27 Apr 2014, 13:52    Post subject:  

Please explain what you mean by "it's launched before X". I'm confused by this.

This script is run after the puppy user desktop is booted and visible. It runs when they choose to start a VPN session with Gpptp.
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 8230

PostPosted: Sun 27 Apr 2014, 14:04    Post subject:  

Ah ok ...though you still had the problem which karl referred to

mike
Back to top
View user's profile Send private message 
jafadmin

Joined: 19 Mar 2009
Posts: 422

PostPosted: Sun 27 Apr 2014, 14:14    Post subject:  

mikeb wrote:
Ah ok ...though you still had the problem which karl referred to

mike


No, neither of these are situations where scripts are being run before X. This problem appears with puppy fully booted.

And in the gxmessage problem above, for whatever reason, you MUST put the display parameter in the command line or it won't display.

yaf-splash is the same utility that displays the "puppy saving" messages. Works great in that usage.

Confused
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 8230

PostPosted: Sun 27 Apr 2014, 14:16    Post subject:  

No clues...I guess puppy gets stranger.... yaf-splash was a standalone binary so you are dealing with a script and gtkdialog pretending to be it.

mike
Back to top
View user's profile Send private message 
puppyluvr


Joined: 06 Jan 2008
Posts: 3195
Location: Chickasha Oklahoma

PostPosted: Sun 27 Apr 2014, 14:30    Post subject:  

Very Happy Hello,
You could try launching your splash message via the rxvt -e switch.

_________________
Close the Windows, and open your eyes, to a whole new world
http://puppylinuxstuff.meownplanet.net/puppyluvr/
Puppy Linux Users Group on Facebook

Puppy since 2.15CE...
Back to top
View user's profile Send private message Visit poster's website 
jafadmin

Joined: 19 Mar 2009
Posts: 422

PostPosted: Sun 27 Apr 2014, 15:37    Post subject:  

mikeb wrote:
No clues...I guess puppy gets stranger.... yaf-splash was a standalone binary so you are dealing with a script and gtkdialog pretending to be it.

mike


Haha. Ok, so on a lark I downloaded the source for yaf-splash and compiled it.

It works in the script. It only seems to do the one font though, or I'm not getting the syntax right for specifyimg a different one ...
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 8230

PostPosted: Sun 27 Apr 2014, 15:42    Post subject:  

Oh you are dealing with horrible looking pixmap fonts rather than the nice true type ones of gxmessage ... perhaps puppy was not considered ugly enough when yaf-splash was introduced. Wink

hard to say how they are defined...depends on the aliases set...but the choice is small or large ugly.

mike
Back to top
View user's profile Send private message 
jafadmin

Joined: 19 Mar 2009
Posts: 422

PostPosted: Sun 27 Apr 2014, 18:57    Post subject:  

So I figured out that the compiled binary for yaf-splash is still in puppy in the
/usr/X11R7/bin directory. With a little goofing around with parameters I was able to get a halfway decent result with the following:
Code:

/usr/X11R7/bin/yaf-splash -bg green -font "Monospace" -placement "top" -margin 15 -outline 0 -display :0 -timeout 5 -text " VPN Monitor is Running . . . "


Maybe not as pretty as the gtkdialog version, but at least I can get it to run from the ip-up script with no problem.
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 8230

PostPosted: Sun 27 Apr 2014, 19:51    Post subject:  

Top marks for persistance.... I forgot there was a copy in there.

I remember now some scripts call it directly when the hacky gtkdialog script fails to perform

mike
Back to top
View user's profile Send private message 
jamesbond

Joined: 26 Feb 2007
Posts: 2134
Location: The Blue Marble

PostPosted: Mon 28 Apr 2014, 05:01    Post subject:  

yaf-splash was phased out not because it can only display pixmap fonts. In fact it can display scalable and TTF fonts easily. It was phased out because it doesn't support unicode.
_________________
Fatdog64, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 2 [28 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0751s ][ Queries: 12 (0.0039s) ][ GZIP on ]