I have used Sway for a while and was curious if I could add KDE Plasma as another option for Desktop Environment. The usual way is to add another DE and let the greeter find it during boot. I’ve had issues with greeters (like SDDM etc) earlier so I asked AI (Google Gemini) to edit my .bash_profile file. There were some hickups as usually with AI code but I got it working. Now my system boots to TTY (no greeter) where I put my user name and password. Then the .bash_profile file runs and I can choose Sway / Plasma by pressing 1 or 2. This is just for someone using a DIY OS without any default DE. I’m using Gentoo with OpenRC init but this should work with any distro:
cat .bash_profile
# 1. Source your bashrc for aliases/prompt
[[ -f ~/.bashrc ]] && . ~/.bashrc
if [[ -z $WAYLAND_DISPLAY && -z $DISPLAY ]]; then
if [[ $(tty) == *tty1 ]]; then
echo "--------------------------"
echo "| SELECT A SESSION |"
echo "--------------------------"
echo "1) Sway"
echo "2) Plasma"
echo "3) Shell"
read -p "Selection [1-3]: " choice
case "$choice" in
1)
export XDG_SESSION_TYPE=wayland
exec dbus-run-session sway
;;
2)
export XDG_SESSION_TYPE=wayland
export DESKTOP_SESSION=plasma
exec dbus-run-session startplasma-wayland
;;
3)
echo "Dropping to shell..."
;;
*)
echo "Invalid choice."
;;
esac
fi
fi
When using Gentoo you can modify the packages before installing. My custom USE flags for the kde-plasma/plasma-meta are:
cat /etc/portage/package.use/plasma-meta
kde-plasma/plasma-meta -display-manager -sddm -discover -plymouth -grub
I removed these packages from the kde-plasma/plasma-meta package:
display-manager
sddm
discover
plymouth
The -grub USE flag from package kde-plasma/plasma-meta package prevents plasma to modify my grub.cfg.
here’s the Plasma and Sway:

