Article 55XZ4 is it possible to restart Xorg into another DE/WM in batch mode from a script?

is it possible to restart Xorg into another DE/WM in batch mode from a script?

by
FlinchX
from LinuxQuestions.org on (#55XZ4)
I am writing a script that is running as root and is supposed to customize a vanilla Slackware install by installing additional packages, deploying personal config files etc

My script involves building and installing a custom window manager that does not ship with Slackware.

Now, while my script isn't necessarily meant to be run while Xorg is running, this is how I'm running it for testing purposes. I use the live edition of Slackware64-14.2, which I boot in a virtual machine, and it boots straight into the graphical login. I believe it's called Display Manager, once I enter the password it boots into KDE. But this is different compared to my usual workflow on a real Slackware host, which involves me booting into command line, typing startx by hand, so the GUI boots according to what's in ~/.xinitrc

For consistency, I'd like to be able to:

1. boot the livecd in a WM
2. enter the password in the GUI login, which gets me logged into KDE
3. open a terminal
4. run my script
5. my script does stuff
6. my script builds and install the third party window manager
7. my script detects if Xorg is running (I think I need to check the DISPLAY env variable for that)
8. if Xorg is running, restart it and force it to honor ~/.xinitrc, even if it previously booted straight into GUI login
9. my script keeps doing stuff until it completes

So far I'm stuck at 8. , is it even possible to do it in batch mode?

I'd like this approach is possible, to avoid splitting the script into parts and running them separately - as in:

- run the first script until it is needed to restart Xorg
- restart Xorg manually, select new wm (this might require me to do additional configuration for the GUI display manager for something frugal like dwm? and then it would again diverge with my usual workflow where I just drop an ~/.xinitrc file and have Xorg honor it after typing startx)
- run the second script which does the restlatest?d=yIl2AUoC8zA latest?i=bQCNxitv40g:_sfEXXeZLrQ:F7zBnMy latest?i=bQCNxitv40g:_sfEXXeZLrQ:V_sGLiP latest?d=qj6IDK7rITs latest?i=bQCNxitv40g:_sfEXXeZLrQ:gIN9vFwbQCNxitv40g
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments