0

so a bit of context, i have my pc setup to start at TTY then when i want to go into a desktop environment i start the login manager.

# Upon install setting the TTY as default start state
sudo systemctl set-default multi-user.target
# to start desktop enviornment each startup has to enter
sudo systemctl start sddm

the problem is whenever i get into these state changes i have to login many times and change settings many times. so when i start my pc, it asks for username & pass. then i have an alias for the code above, this asks to confirm password for sudo, then the login manager starts and i have to choose login user, as well as the session (plasma (xorg), plasma(wayland), awesome, gnome) then enter my password again. In total, 1 alias command, 3 passwords entered, 2 GUI options toggled all just to get into a desktop environment. it seems like most of that is unnecessary.

what im trying to do: instead of having to login to sddm, is it possible to have a bash command that starts a login manager, chooses a session and logs into the user account that is already logged into the TTY. so i could then just put it into an alias and enter that. (this would mean i would need different alias's for every session type but thats not a problem, actually ideal. also means i would need to be logged into tty to change user but that also would be fine)

This would change the workflow to this: startpc -> Login -> desktop-alias and done

any info would be appreciated. is this not an option with SDDM, do i need to change some settings, at this point i cant even find anything related to this topic. Thank you in advance!

1 Answers1

0

You can enable autologin in sddm, and disable password for sudo. But this might cause security concerns and you will not be able to choose a session.

A display manager is not the best way to achieve this. From the arch wiki:

A display manager, or login manager, is typically a graphical user interface that is displayed at the end of the boot process in place of the default shell.

In other words, sddm is meant to replace your login shell.

A much better solution, which achieves exactly what you describe except without going through sddm, is to use xinit. Copy the default config with cp /etc/X11/xinit/xinitrc ~/.xinitrc, then add something like this to the end of the file:

# Here kde is kept as default
session=${1:-kde}

case $session in awesome ) exec awesome;; kde ) exec startplasma-x11;; # Add more session as desired

# No known session, try to run it as command
*                 ) exec $1;;

esac

Then run startx kde or some other session.

Source: https://wiki.archlinux.org/title/Xinit#Switching_between_desktop_environments/window_managers

Alternatively, enable sddm with systemctl enable sddm to launch sddm on startup.

EJam
  • 101
  • 2