Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined! VirtualLinuxUser's Avatar
    Join Date
    Mar 2008
    Pietermaritzburg, KwaZulu Natal, South Africa

    Question Create a menu in ~/.xinitrc

    Hi. I've searched the Internet and can't find what I'm looking for (although close to it).

    At the moment, I'm running my system to start on runlevel 3 (multiple users, no gui).

    When I run X (startx), my system runs GNOME.

    I've got multiple window managers installed and I'd like a menu to choose between them when I run startx.

    if I run startx, a menu such as the following should come up :

    1) minimal (Run X with three xterms and twm)
    2) openbox || icewm || fvwm (not necessarily with menus, etc)
    3) GNOME (Full GNOME desktop with panels, menus, etc. ; what currently happens when I run startx)

    Choice : _

    I would then type '1' for a minimal environment, '2' for openbox, '3' for the full graphical GNOME desktop with panels, menus, etc.

    How do I edit the following code to get the user's choice? Also, is this the correct way to go about it without passing the path to the WM to startx? :

    echo -en " 1.\tMinimal (twm)\n 2.\topenbox \n 3.\tGNOME (full desktop)\n"
    echo "Choose a window manager"
    $choi = {userChoice}
    if [[ $choi == "1" ]]
    then # minimal - 3 xterms and twm
      # xterm -geometry & # xterm 1, with geometry args changable (manual edit)
      # xterm -geometry & # xterm 2, with geometry args changeable (manual edit)
      # xterm -geometry -login & # xterm 3, also with geometry args changeable (manual edit)
      exec /usr/bin/twm # can be changed to another WM, such as mwm
    elif [[ $choi == "2" ]] # openbox ; can be changed out for icewm or fvwm
    	exec openbox # openbox-session (?) ; not necessarily with menus, panels, etc. Will I need the full LXDE setup?
      exec gnome-session # start full GNOME desktop (panels, menus, background, etc. ; default)

  2. #2
    Just Joined!
    Join Date
    Feb 2011
    Patagonia argentina
    I don't know if this answers completely your question but here's my 2 cents.

    $ xinit /path/to/wm

    should work (works for me at least). Also, you can do

    $ xinit /usr/bin/xterm -- :0
    $ xinit /usr/bin/icewm -- :1

    to start each wm in a different tty (don't know if the terminology is correct).
    In this case, Ctrl-Alt-F7 will show xterm, and Ctrl-Alt-F8 will show icewm.
    Don't know if this should work in every distro (I use Arch).
    Hope this helps

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts