LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Puppy (http://www.linuxquestions.org/questions/puppy-71/)
-   -   Script to restart x server (http://www.linuxquestions.org/questions/puppy-71/script-to-restart-x-server-4175503172/)

Fixit7 04-27-2014 08:39 PM

Script to restart x server
 
I am trying to restart the x server using a script like the shutdown manager does.

I think this is partially working ?

#!/bin/sh
sudo kill `cat /tmp/.X0-lock`
startx
xwin [fvwm95|jwm]
_________________
Andy

Slacko Puppy 5.6.0
Windows XP SP3

Karl Godt 04-30-2014 02:16 PM

Code:

PID_OF_X=`pidof X`

for aPID in $PID_OF_X
do

kill -9 $aPID

done

sleep 1s

read CURRENTWM </etc/windowmanager
test "$CURRENTWM" || CURRENTWM=jwm
which "$CURRENTWM" || CURRENTWM=unknown

if test "$CURRENTWM" != 'unknown';
then xwin $CURRENTWM
else echo "Probably only window in the wall installed , but not on OS.."
fi



All times are GMT -5. The time now is 01:57 AM.