You are not logged in.

#1 2025-11-30 01:49:31

wesdawg73
Member
Registered: 2025-11-30
Posts: 1

startx select prompt

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
        ;;
esac

but 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

#2 2025-11-30 10:39:19

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,085

Re: startx select prompt

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

Offline

Board footer

Powered by FluxBB