bash script

Code junkies hangout here

Moderators: ChrisThornett, LXF moderators

bash script

Postby liaty » Tue Jul 25, 2006 7:49 pm

I'm trying to create a single link to enable/disable xgl.

So far I have two bash scripts.


#!/bin/bash
gnomesu start_xgl

which calls

#!/bin/bash
gnome-xgl-switch --enable-xgl;killall gdm;gdm

The problem I have I think is that the script itself is being shutdown with gnome session.
It worked once, xgl was enabled, gdm shutdown and then gdm logged into gnome session.

Most of the time though it crashes the x server and a reboot is needed.
Other times it gets to the console but does not restart gdm.

Can anyone see where I am going wrong?
Is there a better way to restart gdm?
liaty
 
Posts: 30
Joined: Tue Mar 14, 2006 5:10 pm

RE: bash script

Postby towy71 » Tue Jul 25, 2006 9:34 pm

you don't say which distro you're using and how you install xgl etc.?
still looking for that door into summer
User avatar
towy71
Moderator
 
Posts: 4276
Joined: Wed Apr 06, 2005 2:11 pm
Location: wild West Wales

RE: bash script

Postby nelz » Tue Jul 25, 2006 10:07 pm

If you are running the script from an X terminal, it will stop when the X session shuts down.

Try having the first script do
Code: Select all
gnomesu screen start_xgl
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8577
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby liaty » Tue Jul 25, 2006 10:23 pm

Thanks, got it with.
/etc/init.d/xdm restart in the second script

I can now call start/stop xgl from links on desktop.
Distro is OpenSuse 10.1
For other distros the command could be /etc/init.d/gdm restart
liaty
 
Posts: 30
Joined: Tue Mar 14, 2006 5:10 pm


Return to Programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron