You are not logged in.
I recently installed Arch Linux with the LXQt desktop environment using the archinstall script.
Depending on the task, I sometimes use a pure Openbox session instead of the full desktop environment.
For pure Openbox sessions, I have conky and nitrogen in my ~/.config/openbox/autostart file:
# Conky (to display clock and date)
conky -c ~/.config/conkyrc &
# Wallpaper
sleep 2
while true; do
nitrogen --random --set-auto
sleep 3600
doneI've noticed that LXQt also runs these commands when I log into an LXQt session (because LXQt's window manager is Openbox). However, these settings are superfluous in LXQt sessions because it has a clock in the menubar and its own wallpaper manager.
How can I set the autostart commands above to run only in pure Openbox sessions, and not in LXQt sessions?
I found a similar discussion concerning the Openbox rc.xml file on the LXQt Github here: https://github.com/lxqt/lxqt/issues/1002
There, it was suggested that LXQt should favor ~/.config/openbox/lxqt-rc.xml over ~/.config/openbox/rc.xml if both files exist. If a similar policy exists for the autostart file, that would solve my issue, but I can't see any mention of it.
Thank you in advance.
Last edited by zw (2022-06-04 13:11:15)
Offline
Just rename the file and run openbox with the --startup flag with the new file as an argument.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Just rename the file and run openbox with the --startup flag with the new file as an argument.
Thank you. How do I get this to happen when I select an Openbox session from the sddm login screen? It seems like I need to modify /usr/share/xsessions/openbox.desktop, which currently reads
[Desktop Entry]
Name=Openbox
Comment=Log in using the Openbox window manager (without a session manager)
Exec=/usr/bin/openbox-session
TryExec=/usr/bin/openbox-session
Icon=openbox
Type=ApplicationBut notice that the command invoked here is openbox-session rather than plain openbox. I tried modifying the Exec line to read
Exec='/usr/bin/openbox --session /home/zw/.config/openbox/pure-openbox-autostart.sh'but attempting to login produces an error (it drops momentarily to a CLI then puts me back at the sddm prompt).
Offline
Compare
printenv | grep -iE '(XDG|desktop)'- lxqt probably sets an evironment variable you could test for.
Offline
Compare
printenv | grep -iE '(XDG|desktop)'- lxqt probably sets an evironment variable you could test for.
Thanks, this ended up being the easiest solution:
if [[ $DESKTOP_SESSION -eq 'openbox' ]]; then
# Conky (clock and date)
conky -c ~/.config/conkyrc &
# Wallpaper
while true; do
nitrogen --random --set-auto
sleep 3600
done
fi(In the LXQt session, DESKTOP_SESSION is set to 'lxqt'.)
Offline
Please remember to mark your thread [SOLVED] (edit the title of your first post).
Offline
My suggestion was to change how you run openbox. Leave LXQT to do whatever it does (which includes reading the "default" autostart file, which would be emtpy). As I said, rename your current autostart file to something else. The run openbox - when you want just openbox, with the --startup flag to select the newly named autostart file - I assume this call to openbox would be in your xinitrc.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
I assume this call to openbox would be in your xinitrc.
How do I get this to happen when I select an Openbox session from the sddm login screen?
…
But notice that the command invoked here is openbox-session rather than plain openbox. I tried modifying the Exec line
openbox-session runs
exec /usr/bin/openbox --startup "/usr/lib/openbox/openbox-autostart OPENBOX" "$@"/usr/lib/openbox/openbox-autostart then draws ${XDG_CONFIG_HOME:-"$HOME/.config"}/openbox/autostart
I'm not sure how lxqt ends up running the autostart scripts unless it starts openbox-session instead of just openbox and in that case you'd have to derive the xsession to run some "openbox-session2" and split the behavior there.
Making the autostart scripts context aware is probably easier.
Offline