You are not logged in.
Pages: 1
is it possible to make startx prompt the user for an imput that would determine which exec to use?
i have xfce and i3 installed, and i want to select which to use when i run startx. for whatever reason, xinit with an argument just doesnt work, it says something about unable to connect to X servers, but startx does work ?♂️
Things ive tried:
making a script /usr/local/bin/starti3 which just had exec i3 in it, making it executable with chmod, then running xinit starti3. said xonnection to X server refused.
i tried treating .xinitrc as a sort of script, with
#!/bin/sh
# ~/.xinitrc
echo "1) i3"
echo "2) XFCE
read -p ": " choice
case "$choice" in
1)
exec i3
;;
2)
exec startxfce4
;;
*)
exec xterm
;;
esacbut that just launched into a blank screen and didnt prompt for anthing.
changing .xinitrc to just have exec i3 or exec startxfce4 worked with those by themselves.
any ideas on what i could do or why xinit <arg> doesnt work?
Last edited by wesdawg73 (2025-11-30 01:53:51)
Offline
1st: see the last link below (2nd blue note)
2nd count the quotation marks in your script…
3rd https://www.baeldung.com/linux/shell-sc … elect-menu
Online
Pages: 1