SourceFiles.org - Use the Source, Luke
Home | Register | News | Forums | Guide | MyLinks | Bookmark

Related Sites

Latest News
  General News
  Reviews
  Press Releases
  Software
  Hardware
  Security
  Tutorials
  Off Topic


Back to files

Switchem Window Manager Switcher v1.2

Switchem is a commandline-based tool to switch your X window manager or desktop environment. Switchem tries to be smart about figuring out what window managers are installed on your system by looking in certain places for the binariy for each window manager as defined by the global window manager database.

System Requirements:

  • Perl
  • Berkeley DB, and the corresponding DB_File module for Perl
  • File::Find module for Perl

Most linux systems already have these installed for you.

Installation

Edit INSTALL.sh and change PREFIX to reflect where you want switchem to be installed, then simply run INSTALL.sh.

To rehash your global window manager databse, use the following command, with the value of PREFIX in INSTALL.sh in the place of "/path/to"

makehash.pl /path/to/switchem/gwm.db < /path/to/switchem/gwm

Any time you wish to update the global list of window managers, you'll need to run the above line. Note that the global data only lists the name of the binary for each window manager, and does not keep any information about what window managers are installed on the system. The only reason the global database would need to be changed is if a new window manager is installed that is not listed in gwm. In that case, just add a new record to gwm:

New Window Manager: binary

and re-hash the database.

As well, each user will need at least a basic .xinitrc to begin with. Switchem will also look for a user's .xsession or .Xsession. However, Switchem is not compatible with Redhat's .Xclients. A sample .xinitrc would look like:

#!/bin/sh

# end .xinitrc

Note that no window manager is being exec'ed in the above .xinitrc. Switchem will add the neccessary lines for you. A sample .xinitrc file is included.

Usage

The first time switchem is run, it'll generate the local database of installed window managers for each user. Switchem looks in /usr/X11R6/bin and /usr/local/bin for window manager binaries it knows about. If you want to have Switchem look in other places, you'll need to edit the script.

Changelist

v1.2

  • Tightened up the input loop, and fixed a bug that allowed choosing options that don't exist.
  • Added two new window managers to the global list.
  • Changed command to exit without changing anything. Use 'q' or 'Q'.
  • Updated INSTALL.sh to change the location switchem looks for gwm.db if PREFIX is set to something other than /usr/local v1.1
  • Added code to expire the local wm cache if it's not been updated in a week.
  • Added command line argument to display the version number.
  • Minor code cleanups.

v1.0

  • Initial public release.
    TODO

The global window manager database is most likely not very complete. If you want to update it to include your favorite window manager, feel free. Send patches to switchem@daishar.com

Author

Todd Ostermeier <ostermer@daishar.com

License

Copyright 2000 Todd Ostermeier

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Other Sites

Discussion Groups
  Beginners
  Distributions
  Networking / Security
  Software
  PDAs

About | FAQ | Privacy | Awards | Contact
Comments to the webmaster are welcome.
Copyright 2006 Sourcefiles.org All rights reserved.