LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Blogs > Whaling the FOSS
User Name
Password

Notices

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.

Code:
#!/bin/sh

# 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


.:XXXXXX Normal XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:.
  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


.:XXXXXX Games XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:.
  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  ;;



esac

done

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 1135 Comments 0
« Prev     Main     Next »
Total Comments 0

Comments

 

  



All times are GMT -5. The time now is 08:11 PM.

Main Menu
Advertisement

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