You are not logged in.
OK, we have a problem with the popular TTY boot option: if that is selected from the first boot then running `startx` from the console login results in this:
This happens because the display manager is used to copy over all of the XDG_CONFIG_DIR files for the first login to configure the desktop. — is it possible to call `bl-user-setup` from the autostart file instead?
EDIT: note the most excellent Muppet-inspired hostname, thanks to Mrs. HoaS for that
EDIT2: how will the autostart file work if it isn't in $HOME? D'oh!
Let me think on this...
Last edited by Head_on_a_Stick (2018-03-03 15:40:13)
Offline
I have a potential solution for the TTY login problem.
If the bl-user-setup script is tacked to the top of `startx` and placed earlier in $PATH, like this:
# cat /usr/bin/{bl-user-setup,startx} > /usr/local/bin/startx && chmod +x /usr/local/bin/startx
then the final line in bl-user-setup (`exit 0`) is removed to allow the `startx` script to run afterwards this is the result of issuing the (modified) `startx` command from a fresh TTY login:
So perhaps a dpkg-divert for /usr/bin/startx to our own version?
The stock startx script does even suggest this sort of improvement:
alpine:~$ sed 12q $(which startx)
#!/bin/sh
#
# This is just a sample implementation of a slightly less primitive
# interface than xinit. It looks for user .xinitrc and .xserverrc
# files, then system xinitrc and xserverrc files, else lets xinit choose
# its default. The system xinitrc should probably do things like check
# for .Xresources files and merge them in, start up a window manager,
# and pop a clock and several xterms.
#
# Site administrators are STRONGLY urged to write nicer versions.
#
alpine:~$
EDIT: no, that breaks the modified `startx` script after the first run because of this line:
[[ -f "$HOME/.config/bunsen/bl-setup" ]] && exit 0
https://github.com/BunsenLabs/bunsen-co … -setup#L37
More thought is required...
EDIT2: use the break & continue builtins to selectively copy the $XDG_CONFIG_DIR stuff, perhaps?
I'm a little out of my depth here tbh.
Last edited by Head_on_a_Stick (2018-03-03 17:44:00)
Offline
I've split this issue out from the alpha ISO thread.
Offline
This version of /usr/local/bin/startx seems to work as desired:
https://github.com/Head-on-a-Stick/conf … 7ba/startx
(With humble apologies to johnraff & nobody for mauling their beautiful script in such an awful way, I know no better.)
That will copy the files from /usr/share/bunsen/skel but only if "${HOME}/.config/bunsen/bl-setup" does not exist; the conventional `startx` script has been tacked onto the end of that test.
EDIT: that version of `startx` also has the benefit of not being runnable by root (or under sudo) and the readonly lines satisfy my curly bracket fetish 8)
Last edited by Head_on_a_Stick (2018-03-03 20:13:50)
Offline
No, a custom startx is a stupid idea.
I think a simple message to the user is enough:
EDIT: changed [[ to [
EDIT2: missed the curly brackets :8
EDIT3: grrr...
Last edited by Head_on_a_Stick (2018-03-07 07:38:25)
Offline
^
Final version:
Is that enough?
If somebody likes to boot to a console screen then they probably know what they're doing, right?
This won't work because ~/.profile won't have the check in it until after `bl-user-setup` is run, I am such a ****wit sometimes
Last edited by Head_on_a_Stick (2018-03-07 07:42:18)
Offline
Does anybody have a better idea than my custom startx version?
I really can't think of any other way around this.
Offline
Drop a file in /etc/X11/Xsession.d/? At that point $HOME is set. (No - see below)
It might be nice to offer the user some choice in whether to run bl-user-setup though. Someone might be going in with a tty precisely to work round some bug with it.
Or, just append that above message (maybe turn down the urgency a little bit?) to the log-in message that appears on ttys?
/etc/profile looks in /etc/profile.d/ if it exists:
if [ -d /etc/profile.d ]; then
for i in /etc/profile.d/*.sh; do
if [ -r $i ]; then
. $i
fi
done
unset i
fi
...so create that directory and put a snippet in there?
Yup - that works. Put yout code in /etc/profile.d/bunsen.sh
...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
^ Many thanks!
Offline
^although the fact that Debian don't ship /etc/profile.d/ by default suggests there might be a Better Way™ somewhere.
...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
Yes, perhaps a simple MOTD would be enough, that would show on TTY1 after a console login (as you suggested above).
Offline
Does MOTD run shell commands?
...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
No but I was just thinking of a generic message to be printed without a test:
No desktop? Run this command:
bl-user-setup
But perhaps that's a little lame
I've just tested this and it works as expected:
alpine:~$ cat /etc/profile.d/bunsen.sh
#!/bin/sh
if [ ! -f "${HOME}/.config/bunsen/bl-setup" ] && [ "$TERM" = "linux" ]; then
echo '
Oh dear, there are no configuration files for our desktop.
Please run `bl-user-setup` to generate them, thanks!
'
fi
alpine:~$
Offline
...and a file in a *.d directory lets us avoid having to dpkg-displace an existing file.
Bearing in mind the users who have deleted ~/.config/bunsen/bl-setup for their own mysterious reasons, and those who've installed bunsen-configs but nevertheless don't want their $HOME populated , perhaps tweak the message a bit?
There seem to be no configuration files for the BunsenLabs desktop.
Please run `bl-user-setup` if you'd like to generate them.
...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
^ Yes, good idea, that looks perfect to me.
Offline
I liked the
Oh dear,
Offline
^I did too actually, but thinking of users for whom not having the files is quite intentional...
...for example, someone might have a properly configured desktop user, but also have a different user who only uses the CLI.
Not so weird really.
...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
Is there a case for replacing 50_bunsen.conf with this adding version of /etc/profile.d/bunsen.sh:
#!/bin/sh
if [ ! -f "${HOME}/.config/bunsen/bl-setup" ]; then
/usr/lib/bunsen/configs/bl-user-setup
fi
This would remove our dependence on LightDM for the first-run configuration.
EDIT: or maybe even just:
#!/bin/sh
/usr/lib/bunsen/configs/bl-user-setup
Given that the script already includes the test.
EDIT2: no, it could only be used as well as 50_bunsen.conf, which doesn't make much sense.
Bad idea then
Last edited by Head_on_a_Stick (2018-03-10 23:12:03)
Offline
Anyway I'll add the above /etc/profile.d/bunsen (no need for the .sh, as it's sourced, not executed directly) to bunsen-configs as that's the package which supplies bl-user-setup and all the skel config files.
...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