You are not logged in.
I was considering the general principle of race condition bugs: if all the (longer-running) programs are fork()ed then there is a greater likelihood of triggering a race-condition bug or conflict when compared to just letting the programs run one at a time.
The difference between an "all ampersand" autostart and a "pruned" autostart (as I prefer it) is roughly one second on my (admittedly quite fast) hardware -- I would rather wait and have everything start correctly.
That makes sense to me, except in the case of setup commands that take several seconds to complete. It might only be an extra second with your desktop and your hardware, but, for example, a user with multiple conkys enabled, and something a bit slower, will need an extra several seconds for bl-conky-session to run. I still think that should perhaps be subshelled-off. I can see a stronger case for making sure tint2 and compton have finished setting up before continuing with the script though.
johnraff wrote:agree that openbox/autostart is a rather crude and messy way of setting up a user session.
No.
I think that Openbox's autostart is the ideal way to start the desktop in BunsenLabs.
Well OK. I thought you were with nobody on that subject.
I do think that using random sleeps to get things working is a bit hacky.
The way openbox/autostart is invoked has changed with the current version of openbox.
Currently:
openbox-session calls:
exec /usr/bin/openbox --startup "/usr/lib/x86_64-linux-gnu/openbox-autostart OPENBOX" "$@"
and openbox-autostart contains:
AUTOSTART="${XDG_CONFIG_HOME:-"$HOME/.config"}/openbox/autostart"
# Run the user openbox autostart script
if test -f $AUTOSTART; then
sh $AUTOSTART
elif test -f $AUTOSTART.sh; then
sh $AUTOSTART.sh
fi
# Run the XDG autostart stuff. These are found in /etc/xdg/autostart and
# in $HOME/.config/autostart. This requires PyXDG to be installed.
# See openbox-xdg-autostart --help for more details.
/usr/lib/x86_64-linux-gnu/openbox-xdg-autostart "$@"
So the user's autostart is called (with sh not bash), and after it's finished the XDG desktop files are executed. A very long execution time for autostart will hold up the launching of network manager and friends.
Previously:
autostart.sh was sourced by openbox's startup script (run by sh not bash) and after its contents had been executed the script went on to launch openbox. This meant that if autostart.sh stopped at any point openbox wouldn't start.
That's probably the reason why ampersands have become the standard for commands in autostart (check the net, including Arch), though now they are not needed so much. Of course any process whose launch command does not return to the prompt will still need to be forked off.
So, OK, let's clean it up!
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
I'm asking why, for example, xfce4-power-manager doesn't get autostarted automatically every time.
But it does! It's running right now for me, with no entry in autostart. Run '/usr/lib/x86_64-linux-gnu/openbox-xdg-autostart --list' to see the entry for xfce4-power-manager.
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
johnraff wrote:@Head_on_a_Stick Could you try without that line, maybe increasing the sleep for bl-compositor, and see what happens?
With the bottom line of /usr/bin/bl-tint2-session commented out, I still have no artefacts on my Haswell hardware.
Looks like that may be fixed
I've just thought - are you using the backported tint2 (as I am)? That might have brought the fix. I'll try reverting to the Jessie version and see what happens. If you have the time, could you check too?
EDIT: reverted to the Jessie tint2, and still no systray artifacts even without restarting compton.
My autostart currently looks like this (comments omitted, please ignore xfdesktop, adeskbar and startup.sh which does more personal stuff):
synclient VertEdgeScroll=1 HorizEdgeScroll=1 TapButton1=1 2>/dev/null
xset r rate 250 25
xset b off
/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1 &
#nitrogen --restore &
xfdesktop &
adeskbar >/dev/null 2>&1 &
bl-compositor --start
bl-tint2-session
bl-conky-session --autostart &
pnmixer &
clipit &
(sleep 10; bl-welcome --firstrun) &
(sleep 5; ~/scripts/startup.sh --dropbox) &
More optimization should be doable, but it means a lot of logging out/in to check...
Last edited by johnraff (2016-07-07 07:09:59)
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
The way openbox/autostart is invoked
[...]
So, OK, let's clean it up!
I have a radical suggestion.
How about dropping the use of the autostart script entirely and using ~/.xsession instead?
The content of the file would be the same as the autostart but with "exec openbox" (*not* "openbox-session") as the last line.
This would make the script far more portable to other window managers and removes a confusing layer of abstraction.
If this file exists, it is run by selecting the "Default XSession" session entry in LightDM and it then functions in the exact same way as ~/.xinitrc in a system without a display manager.
There is no need to add the xdg autostart line to the file as LightDM starts these anyway
I will test this tonight on my system.
Offline
are you using the backported tint2
No, I am not.
Offline
I have a radical suggestion.
How about dropping the use of the autostart script entirely and using ~/.xsession instead?
Not keen on this at all. It would disrupt the Debian startx procedure. .xsessionrc might be feasable, but I don't see any advantages to be honest.
This would make the script far more portable to other window managers and removes a confusing layer of abstraction.
I see that as a disadvantage. That openbox/autostart only applies to openbox sessions allows more flexibility IMO. Other window manager sessions will quite likely need a different set of apps. I keep a startup.sh for things that I want run with any window manager.
There is no need to add the xdg autostart line to the file as LightDM starts these anyway
Are you sure about that? Then why doesn't openbox's script result in double-icons?
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
johnraff wrote:are you using the backported tint2
No, I am not.
Indeed. I went back to the standard tint2 and it still looks good.
Last edited by johnraff (2016-07-07 07:11:43)
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
There is no need to add the xdg autostart line to the file as LightDM starts these anyway
Are you sure about that?
I use ~/.xsession in Debian jessie with LightDM on my girlfriend's laptop and the XDG stuff all works as expected.
I could be wrong though, give me a minute...
EDIT: No time, back in 12 hours...
Last edited by Head_on_a_Stick (2016-07-07 07:23:18)
Offline
hhh wrote:I'm asking why, for example, xfce4-power-manager doesn't get autostarted automatically every time.
But it does!
Well! I never noticed. We should definitely consider consolidating autostart into one location then, and I would vote for the Openbox autostart file since it can be edited per-user-session by the user..
No, he can't sleep on the floor. What do you think I'm yelling for?!!!
Offline
@HoaS, I vote we keep BL's autostart in ~/.config/openbox/openstart, for the reasons johnraff stated. With this setup, if a newbie were to install a DE onto BL, it would fire up more or less normally, whereas ~.xsessionrc might cause confusion and havoc. Or at least minor messiness.
No, he can't sleep on the floor. What do you think I'm yelling for?!!!
Offline
For running multiple stand-alone WM sessions, one could use multiple .xsessionrc files and rename them or use desktop files as I described here...
http://crunchbang.org/forums/viewtopic. … 40#p418140
Anyway, I think it would be easier to troubleshoot that issue on a case-by-case basis.
No, he can't sleep on the floor. What do you think I'm yelling for?!!!
Offline
How about dropping the use of the autostart script entirely and using ~/.xsession instead?
I'd prefer not to do this. Not all wm's are created equal. I'd prefer to configure each wm to be a custom tailored session with settings that completely make sense for that wm, and avoid loading up extra "cruft" that launching a different wm may incur if it doesn't use certain features of things we're trying to automatically start.
Offline
There is no need to add the xdg autostart line to the file as LightDM starts these anyway
Are you sure about that? Then why doesn't openbox's script result in double-icons?
I was completely wrong about this, sorry for the noise :8
@{johnraff,hhh,cloverskull} -- fair enough, it was just a suggestion
Offline
@{johnraff,hhh,cloverskull} -- fair enough, it was just a suggestion
We should get this out in the open right now... I don't think there is any suggestion that is "wrong", look at how much cruft we're exposing just in this thread, which I thought would last a page at most. Feel free to disagree, because that's what I'm talking about!
Put it out there. If it gets shot down, give us the Linus NVidia finger and post a bunch of monkey emojies, you'll feel better.
8o 8o 8o
8o 8o 8o
8o 8o 8o
8o 8o 8o
8o 8o 8o
No, he can't sleep on the floor. What do you think I'm yelling for?!!!
Offline
^ That's good comedy.
No, he can't sleep on the floor. What do you think I'm yelling for?!!!
Offline
[HELIUM] This is a slight fork-off from openbox/autostart, and when/if I put together a proof-of-concept (or if responses to this post get out of hand) I'll start a new thread. I've been thinking for a while it might be good to have a /usr/share/xsessions/bunsenlabs.desktop with contents something like:
[Desktop Entry]
Name=BunsenLabs
Comment=Log in to a BunsenLabs Linux session
Exec=/usr/bin/startbunsenlabs
TryExec=/usr/bin/startbunsenlabs
Icon=BunsenLabs
Type=Application
An icon would appear in LightDm's menu. After looking again at startxfce4 and startlxde for inspiration, we could make a script startbunsenlabs that would possibly use a custom-configured lxsession (or something else?) to set up the user session before launching openbox. That should leave other DMs or startx unaffected.
(Alternatively, have a very simple startbunsenlabs that just does startx?)
Of course complete modularity is impossible/very_difficult because at the end of the day the user only has one ~/.config/somedir/somefile which all possible sessions have to deal with somehow.
Last edited by johnraff (2016-07-08 02:59:24)
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
johnraff wrote:hhh wrote:xfce4-power-manager doesn't get autostarted automatically
But it does!
We should definitely consider consolidating autostart into one location then, and I would vote for the Openbox autostart file since it can be edited per-user-session by the user..
It wouldn't be easy to eliminate /etc/xdg/autostart completely because many apps drop .desktop files there if they think they should be autostarted. Without that dir.d/* type system (very useful throughout Debian) users would have to add and remove those apps manually in openbox/autostart. Of course there are arguments for that too, but I think we should just learn to live with having the two locations.
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
Would this prevent multi-user setups with multiple different dotfile configs? Would this introduce issues with those of us that like to iterate between different de's? TBH I only ever knew about the ~/.config/ dotfiles, wasn't aware we were profiling ones in /etc/xdg/
Offline
Would this prevent multi-user setups with multiple different dotfile configs?
This has been part of the Debian system for a long time - it's not something we are doing specifically. All DEs are expected to execute the desktop files in /etc/xdg/autostart (depending on the OnlyShowIn and NotShowIn lines).
Individual user configuration of the xdg autostarted apps is possible by copying .desktop files from /etc/xdg/autostart to ~/.config/autostart and editing them there.
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
Back to topic: @hhh I've taken your original suggested autostart and modified it according to input from @HoaS and my own thoughts. My current autostart looks a lot like this and seems to be causing no problems, but that doesn't mean there are none.
Nearly all the sleeps are gone, along with most of the ampersands. (I'm now wondering if some of the compositing/systray weirdness we had in the past might have been caused by the very race conditions @HoaS referred to with forking.)
@hhh contributed a couple of extra keyboard & touchpad settings.
The exact order of commands is more important now, without forking, and might well need tweaking. My personal file starts compton before tint2 while @hhh has tint2 first (as here). I've moved nitrogen earlier than @hhh had it, for no particular reason...
Any opinions on which commands should run before/after others, along with whether any other delays are needed, will be gratefully entertained.
## SETTINGS START
## Turn on/off system beep.
xset b off
## Set keyboard settings - 250 ms delay and 25 cps (characters per second) repeat rate.
## Adjust the values according to your preferances.
xset r rate 250 25
## Add keyboard mapping.
#xmodmap -e "keysym Insert = Multi_key"
## NEW
## Disable CapsLK
setxkbmap -option ctrl:nocaps
## Configure touchpad. See 'man synaptics' for more info.
synclient VertEdgeScroll=1 HorizEdgeScroll=1 TapButton1=1 2>/dev/null
## NEW
## Disable touchpad while typing
syndaemon -i .5 -K -t -R -d &
## SETTINGS END
## GNOME PolicyKit authentication
/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1 &
## Set a wallpaper
nitrogen --restore
## Start the tint2 session (the default tint2 will run if no sessions have been set)
bl-tint2-session
## Compton
bl-compositor --start
## Start the Conky session (the default conkyrc will run if no sessions have been set)
bl-conky-session --autostart &
## Start the battery applet
fdpowermon &
## Volume control for systray
(sleep 12; volumeicon) &
## Replace with this?:
#pnmixer &
## Start Clipboard manager
clipit &
## bl-welcome - post-installation script, will not run in a live session and
## only runs once. Safe to remove.
(sleep 10; bl-welcome --firstrun) &
## DISABLED
## Volume keys daemon (probably not needed)
#xfce4-volumed &
## Start xscreensaver (light-locker now used by default, run via XDG autostart.)
#xscreensaver -no-splash &
## bl-fortune - have the system come up with a little adage (not yet enabled)
#(sleep 120; bl-fortune) &
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline