You are not logged in.
Dear all ![]()
I am running Wayland+Sway and just bought Hollow Knight from gog.com, which locks up constantly under Wayland. So I need a way to switch to X when I want to play it.
I don't have any login managers such as GDM/LDM or similar installed, so Sway gets started when I login on tty1 as it reads .profile
#!/bin/bash
# https://wiki.archlinux.org/title/Xinit#Autostart_X_at_login
if [ -z "${DISPLAY}" ] && [ "${XDG_VTNR}" -eq 1 ]; then
exec sway > ~/.sway.log 2>&1
fiIf I exit Sway, so I am back in tty1 and type "startx", then I was hoping i3wm would start, as I have that installed and configured. I just get the empty X instead.
Does anyone know how I can start i3wm from tty1?
Hugs,
Sandra ![]()
Last edited by LittleSandra (2024-01-20 23:10:39)
Offline
Have you configured your ~/.xinitrc file? Can you please post it here?
Here is mine:
#!/bin/sh
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)
if [ -d /etc/X11/xinit/xinitrc.d ]; then
for f in /etc/X11/xinit/xinitrc.d/*; do
[ -x "$f" ] && . "$f"
done
unset f
fi
[[ -f ~/.Xresources ]] && xrdb -merge -I$HOME ~/.Xresources
autocutsel -fork &
autocutsel -selection PRIMARY -fork &
case $WM in
i3)
exec i3 >~/i3log-$(date +'%F-%k-%M-%S') 2>&1
;;
plasma)
export DESKTOP_SESSION=plasma
exec startplasma-x11
;;
plasma-wayland)
export DESKTOP_SESSION=wayland
exec startplasma-wayland
;;
*)
export DESKTOP_SESSION=plasma
exec startplasma-x11
;;
esacIt could be a little stale as I never use it anymore; I just use Sway.
With that .xinitrc, one would start i3 with: WM=i3 startx
Last edited by ewaller (2024-01-20 22:00:44)
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
I use different TTYs for different desktops:
# ~/.profile
case "$(tty)" in
/dev/tty1) exec sway > ~/.local/share/sway/sway.log 2>&1 ;;
/dev/tty2) exec startx ;;
/dev/tty3) exec tty-clock -cs
esacNote that ~/.profile doesn't need a shebang line.
I'm surprised ~/.profile works for the OP though because bash won't read it if ~/.bash_profile exists and that file is supplied by the bash package.
Jin, Jîyan, Azadî
Offline
Have you configured your ~/.xinitrc file? Can you please post it here?
I don't have one it seams.
With that .xinitrc, one would start i3 with: WM=i3 startx
Interesting. In which file would I put WM=i3 startx ?
Offline
I use different TTYs for different desktops:
# ~/.profile case "$(tty)" in /dev/tty1) exec sway > ~/.local/share/sway/sway.log 2>&1 ;; /dev/tty2) exec startx ;; /dev/tty3) exec tty-clock -cs esacNote that ~/.profile doesn't need a shebang line.
I'm surprised ~/.profile works for the OP though because bash won't read it if ~/.bash_profile exists and that file is supplied by the bash package.
It is really interesting that you mention that, because it doesn't work, and I couldn't figure out why! Thanks for solving that problem with the shebang ![]()
That looks like a really nice solution. So when you switch to tty2 then i3wm starts?
Offline
I don't have one it seams.
That's the problem. How do you expect startx to run i3 if you're not telling it to?
#!/bin/sh
if [ -d /etc/X11/xinit/xinitrc.d ]; then
for f in /etc/X11/xinit/xinitrc.d/*; do
[ -x "$f" ] && . "$f"
done
unset f
fi
[[ -f ~/.Xresources ]] && xrdb -merge -I$HOME ~/.Xresources
exec i3Online
That solved the problem
Thanks a lot ![]()
Offline
Interesting. In which file would I put WM=i3 startx ?
That is the command one enters into the shell. It sets the environmental variable WM to i3, then runs startx. Same thing if I want to run plasma-wayland
If I don't set WM, then it defaults to plasma on x11
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline