zenity wm chooser

a

When I startup my computer I get a zenity box popup to let me choose what wm to start.
I didn't come up with this idea but forgot where I go it.
I put this in my .xinitrc
PROGRAM=$(zenity --width=0\
           --height=0\
           --list\
           --title "SelectWm"\
            --text "Select Window manager"\
            --column ""\
"openbox"\
"snapwm"\
            "dwm"\
            "awesome"\
            "herbstluft"\
            "i3"\
            "Bspwm"\
            "Opossum"\
            "ratpoison"\
            "cwm"\
"notion"\
            "windowmaker"\
            "spectrwm"\
            "jwm"\
            "monster"\
            "fluxbox"\
            "subtle"\
            "franken"\
            "fvwm"\
                )


case $PROGRAM in
    (snapwm)
         while true; do sleep 1; line=$(date +%a:%b:%d:%I:%M); xsetroot -name "$line"; done &
         exec /home/dka/bin/startup-apps &
         exec /home/dka/bin/snapwm;;
    (herbstluft)
         exec /home/dka/bin/dwm-startup-apps &
         exec herbstluftwm --locked;;
    (ratpoison)
exec /home/dka/bin/rat-apps &
exec ratpoison;;
    (cwm)
exec /home/dka/bin/startup-apps &
exec /home/dka/bin/cwm;;
    (notion)
exec /home/dka/bin/dwm-startup-apps &
exec notion;;
    (windowmaker)
exec /home/dka/bin/dwm-startup-apps &
exec wmaker;;
  (dwm)
         while true
            do
            xsetroot -name  "$(date +"%a %b %d %I:%M")"
            sleep 1s
            done &
         exec /home/dka/bin/dwm-startup-apps &
         exec /home/dka/bin/dwm-6.0/dwm;;
    (awesome)
exec /home/dka/bin/startup-apps &
exec awesome;;
    (monster)
         exec /home/dka/bin/dwm-startup-apps &
         exec monster2bar;;
    (i3)
         #exec /home/dka/bin/dwm-startup-apps &
         exec i3;;
    (spectrwm)
exec /home/dka/bin/dwm-startup-apps &
exec spectrwm;;
    (openbox)
         exec openbox-session;;
    (jwm)
exec /home/dka/bin/dwm-startup-apps &
exec /usr/bin/jwm;;
    (fluxbox)
         exec /home/dka/bin/dwm-startup-apps &
         exec fluxbox;;
(Opossum)
exec tint2 &
exec /home/dka/bin/startup-apps &
exec opossum;;
(Bspwm)
# /home/dka/.config/bspwm/startthefuckingpanel &
exec /home/dka/bin/start-bspwm;;
    (fvwm)
         exec /home/dka/bin/startup-apps &
         exec fvwm;;
esac

PackRat

#1
This is interesting. Does it run as a process like lightdm/lxdm? Some memory saving there if not.

And the Opossum Window manager? Going to need a screenshot of that one.

Nope, catwm/dwm fork - vaguely remember it now from last time I tried Arch
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

a

No I think once you choose what wm you want it runs it and exits, cant find anything running when I look at htop.
When you startup, you get  little menu, you can use arrow keys are start typing the first letter or two and then enter key

PackRat

That's good. Then a user can structure the window manager command if they want the automounting etc ... provided by lightdm.

I'll have to look at this in more detail later.

And I see you also use this popular app:

/home/dka/.config/bspwm/startthefuckingpanel

a must have for tiling wm's  :D
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

ozitraveller


PackRat

#5
Works for the most part.

Only bug(s) on my system (HP laptop) is that their is no mouse available, and the  zenity window does not grab focus on occasion so no window manager can be selected. I can CTRL-ALT-F2 to tty2 and kill the script from htop. Trying to log into X after that usually works.
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

a

#6
I have had it not grab focus, very rarely, fortunately my mouse still works so I just click on it then choose.
I finally remembered where I got it!
arch-forum-thread
was written by " u_no_hu"
so you could go to the thread and email him?
I wonder if it was put in a separate script that was called from .xinitrc  if then it would keep focus better.
It does work for me if I do it that way but as it rarely looses focus using it the previous way I have no way of telling if it will make
a difference. Maybe there is something you can put in a bash script that makes it keep active?
or use of wmctrl or
xdotool windowfocus <  >
OR, you could try using xmessage instead of zenity, this script could easily be changed to start window managers
link to script
Yes I have tested it and it works; just put your wm choices in there instead
case $? in
    101)    # Normal
    exec i3       # Start my WindowManager
    break ;;            # End our world as we know it

    110)    # bspwm
    exec /home/dka/bin/start-bspwm
    break ;;            # End our world as we know it

    111)    # whatever
    exec /home/dka/bin/start-whatever
    break ;;

    1)    # Exit
    exit 0  ;;



esac

done

PackRat

I found his post in the Arch forums; claims all it needs in zenity. Typing the first letter of the window manager instead of trying to use an arrow or tab key does bring the window to focus though, so that should be the (my) first option when the mouse is unavailable.
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

a

oh, I mentioned you could type some letters in  - in my second post, should have been in my first post lol

PackRat

I saw that. My first instinct was to use the Tab or Arrow keys - failure on my system. I need to go with the first letter(s) of the window manager.
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo