You are not logged in.
Hi
Wrt:
https://wiki.archlinux.org/title/Xinit# … w_managers
I edited the file to:
-rw-r--r-- 1 myuser 1000 810 Jun 24 10:43 .xinitrc
cat .xinitrc
#!/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
session=${1:-xfce}
case $session in
lxqt ) exec lxqt;;
fluxbox ) exec fluxbox;;
openbox ) exec openbox-session;;
xfce|xfce4 ) exec startxfce4;;
# No known session, try to run it as command
* ) exec $1;;
esac
Failed Commands:
startxlxqt
startfluxbox
xinit lxqt
xinit fluxbox
xinit openbox
Working commands:
startx
startxfce4
startx /usr/bin/openbox
startx /usr/bin/fluxbox
startx /usr/bin/lxqt-session
Any way to resolve this, as the wiki says that xinit should work?
Thankyou
OS: Arch &/ Debian
System: LENOVO ThinkPad E14
Desktop: Xfce
Offline
neither xinit nor startx will look at your .xinitrc if you give a command line argument as the client to run to the program, so give the "client" the .xinitrc script (I'd assume you'll also need to mark your .xinitrc as executable for this to sensibly work)
So
xinit ~/.xinitrc lxqt
startx ~/.xinitrc lxqt
should work.
PS startxfce4 is a xfce4 specific tool that has no relation to startx or xinit but will on it's own also start a X server if one is not already running.
Online
On my system startx lxqt works fine when run as user without having to make ~/.xinitrc executable .
Here's my ~/.xinitrc (should be cleaned up a bit)
#!/bin/sh
userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap
# merge in defaults and keymaps
if [ -f $sysresources ]; then
xrdb -merge $sysresources
fi
if [ -f $sysmodmap ]; then
xmodmap $sysmodmap
fi
if [ -f "$userresources" ]; then
xrdb -merge "$userresources"
fi
if [ -f "$usermodmap" ]; then
xmodmap "$usermodmap"
fi
# start some nice programs
if [ -d /etc/X11/xinit/xinitrc.d ] ; then
for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
[ -x "$f" ] && . "$f"
done
unset f
fi
numlockx on
# Here lxqt is kept as default
session=${1:-lxqt}
case $session in
lxqt )
~/.fehbg &
exec startlxqt
;;
se3 )
xrandr --output DisplayPort-1 --mode 1920x1080
twm &
xterm -geometry 80x50+494+51 &
exec xterm -geometry 80x66+0+0 -name login
# exec ~/se3
;;
# No known session, try to run it as command
* ) exec $1;;
esac
# twm &
# xclock -geometry 50x50-1+1 &
# xterm -geometry 80x50+494+51 &
# xterm -geometry 80x20+494-0 &
# exec xterm -geometry 80x66+0+0 -name login
#exec startlxqt
Last edited by Lone_Wolf (2022-06-28 11:23:18)
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
(A works at time B) && (time C > time B ) ≠ (A works at time C)
Offline
neither xinit nor startx will look at your .xinitrc
That's only true of startx. If arguments are passed to xinit, it will still read ~/.xinitrc. Xinitrc does not need to be executable and does not need a shebang, it is sourced, not executed itself.
But on the actual issue - giving a list of commands that "fail" is not conducive to finding a solution. How does `xinit fluxbox` fail?
Last edited by Trilby (2022-06-28 12:06:08)
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
If arguments are passed to xinit, it will still read ~/.xinitrc.
Ftr and the most part: https://man.archlinux.org/man/extra/xor … xinit.1.en
If no specific client program is given on the command line, xinit will look for a file in the user's home directory called .xinitrc to run as a shell script to start up client programs.
…
An alternate client and/or server may be specified on the command line. The desired client program and its arguments should be given as the first command line arguments to xinit.
…
Both the client program name and the server program name must begin with a slash (/) or a period (.). Otherwise, they are treated as an arguments to be appended to their respective startup lines. This makes it possible to add arguments (for example, foreground and background colors) without having to retype the whole command line.
Offline
But part of that man page is wrong. Xinitrc is not "run as a shell script" - it is sourced.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
I guess that's colloquial to make it easier to understand (and form a regular users POV it's an insignificant detail)
The point I wanted to make is that the form of the parameter matters what could be relevant in case aliases are involved (and as general fyi since it's some peculiar behavior of xinit)
Offline