Help answer threads with 0 replies.
Go Back > Blogs > Whaling the FOSS
User Name


The experiences of an Australian student who uses Linux.

Cover all topics from shell scripts to monopolies and reviews to political comments.
Rate this Entry

Xmessage choice window in .xinitrc

Posted 04-10-2010 at 12:13 AM by William (Dthdealer)

My Debian system is currently setup without a graphical login manager ( such as gdm or slim ) so the system boots to the console login screen. From here I enter and if I want to start Xorg manually with the 'startx' command.

My original window manager was Window Maker, a really lightweight wm based around some of the principals of the NextStep interface. Programs have 64x64 'tiles' to launch and manage them, and the whole window manager in my opinion is aesthetically pleasing.

After a while I grew tired however of its bad interface system it uses for its configuration tool, where copy and paste does not work and double-asterisks are rendered as a single asterisk. Apart from the mailing lists and unofficial builds and patches the project has not moved in many years.

So I then moved to Fluxbox, which does have some icons next to program entries in menus but didn't have the nice off-screen menu scrolling feature of WindowMaker. Currently I'm using Fluxbox, and until WindowMaker gets together again I'll probably stay as is.

Sometimes I start Xorg only to play a game, and so rather than starting Fluxbox with about 7 daemons attached ( xscreensaver, alltrayed alsamixer, shutter etc ) I wanted to be able to just go straight to my game. To be able to do this, I simply created a choice window in my .xinitrc file that gives me the option between my games and my normal FluxBox session.


# Anything to run only once and beforehand
xmodmap "/home/whales/.Xmodmap"
xbattbar -s acpi_xbattbar -t 3 &

while [ 1 ]; do # Loop this script

### Startup choice screen

xsetroot -solid black

xmessage -buttons Normal:101,Alsamixer:110,Uxterm:111,Wicd-GTK:112,Custom:102,Tremulous:120,Warsow:121,Exit:1 -center -bg orange \
   Note: With the exception of 'Normal' once any of these options
     has finished executing you will return to this menu screen

  Normal    - Fluxbox and ROX desktop - BREAKS FROM THIS SCRIPT
  Alsamixer - Launcher the Alsamixer volume adjustment application
  Uxterm    - Open up a unicode terminal to play with
  Wicd-GTK  - Opens up frontend for network configuration

  Custom    - Enter a custom command to execute

  Tremulous - Start Tremulous without anything in the background
  Warsow    - Start Warsow as above on its own

  Exit      - Close Xorg and go back to the command-line"

case $? in
    101)    # Normal
    ~/script/shell/dayfortune    # Print and store today's fortune
    ~/.fluxbox/startup        # Start my WindowManager
    break ;;            # End our world as we know it

    110)    # Alsamixer
    uxterm -rv -geometry 200x50+70+60 -e alsamixer ;;

    111)    # Terminal
    uxterm -rv -geometry 200x50+70+60 ;;

    112)    # WICD-gtk
    wicd-gtk -n ;;

    102)    # Custom
    grun ;;

    120)    # Tremulous
    tremulous ;;

    121)    # Warsow
    warsow     ;;

    1)    # Exit
    exit 0  ;;



exit 0
Nifty, eh?

You will have to modify it if you want to use it yourself as it makes reference to two of my own scripts ( dayfortune and acpi_xbattbar ) as well as being customised for my 1366x768 screen resolution.
Views 1605 Comments 0
« Prev     Main     Next »
Total Comments 0




All times are GMT -5. The time now is 09:38 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration