crunchbang ratmenu and other menu ideas

If you look through some of my ratpoison-related posts you’ll find a ratmen tutorial. IIRC, one of the screenshots showed ratmen opened in oroborus, a window manager which (like ratpoison) has no menu of its own. Both ratmen and ratmenu (there’s so little difference between them that they may as well be interchangeable) are window manager agnostic; you can bind one menu or however many you see fit.

Most window managers will let you change or add keybindings. I showed several bindings in a screenshot yesterday (I have a lot more now) for various ratmenus that I can launch in jwm just as easily as in ratpoison. I have one with image-related apps, another for multimedia, another for office. That makes it easy to quickly launch things based on minimal keystrokes.

Reminder: each menu is an executable shell script. Put it in your path or call it in your binding from where you keep it. You can type ratmenu at a command prompt to see what variables you can configure. It outputs the first arg as a description in the menu and executes the second arg if selected.

You can install ratmenu/ratmen from your repository or compile it (just need X headers, IIRC).

In this first example, I’m using a mostly-complete menu taken from crunchbang’s openbox menu. I took out the scrot screenshot entries (those are already set on a keybinding) and added a couple words to distinguish things from each other (for example, some of the config entries were set up as separate nested menus lacking in description beyond “edit configuration”). References to man pages and the like in that region of the menu are for the preceding term. I set the fg/bg colors. NOTE that I use my preferred shell (mksh, the official shell of lucky13) rather than /bin/sh which is usually a link to some bloatware called bash (just change it to /bin/sh or /bin/bash or whatever you need; edit: in Ubuntu/#! it’s a link to dash).

#!/bin/mksh
# crunchbang ratmenu - Mon Jul 13 17:30:19 CDT 2009
# https://lucky13linux.wordpress.com

ratmenu -bg grey33 -fg grey66 -align center \
"Run Program" "gmrun" \
"Terminal" "terminator" \
"Web Browser" "firefox" \
"File Manager" "pcmanfm" \
"Text Editor" "gedit" \
"Media Player" "vlc" \
"Firefox" "firefox" \
"Claws Mail" "claws-mail" \
"Liferea Feed Reader" "liferea" \
"gPodder Podcast Catcher" "gpodder" \
"gFTP Client" "gftp" \
"Transmission BitTorrent Client" "transmission" \
"Skype" "skype" \
"XChat IRC Client" "xchat" \
"Gwibber Microblogging Client" "gwibber" \
"Pidgin IM" "pidgin" \
"Network Tools" "gnome-nettool" \
"GIMP" "gimp" \
"Inkscape" "inkscape" \
"GPicView Image Viewer" "gpicview" \
"Colour Picker" "gcolor2" \
"Agave Palette Designer" "agave" \
"Specimen Font Previewer" "gnome-specimen" \
"FontyPython" "fontypython" \
"Xsane Image Scanner" "xsane" \
"Colour Lovers" "firefox http://www.colourlovers.com/" \
"Color Hunter" "firefox http://colorhunter.com/" \
"Vector Magic" "firefox http://vectormagic.stanford.edu/" \
"FavIcon from Pics" "firefox http://www.htmlkit.com/services/favicon/" \
"AbiWord Word Processor" "abiword" \
"Gnumeric Spreadsheet" "gnumeric" \
"Calculator" "gnome-calculator" \
"Dictionary" "gnome-dictionary" \
"Evince PDF Viewer" "evince" \
"VLC Media Player" "vlc" \
"Rhythmbox Music Player" "rhythmbox" \
"Audacity Audio Editor" "audacity" \
"PiTiVi Video Editor" "pitivi" \
"Kino Video Editor" "kino" \
"Create Screencast" "gtk-recordMyDesktop" \
"Cheese Webcam App" "cheese" \
"Sound Juicer CD Extractor" "sound-juicer" \
"Sound Recorder" "gnome-sound-recorder" \
"Sound Converter" "soundconverter" \
"WinFF Video Converter" "winff" \
"Volume Control" "gnome-volume-control" \
"Vim - Text Editor" "terminator --command=vim" \
"Midnight Commander - File Manager" "terminator --command=mc" \
"rtorrent - Bit Torrent Client" "terminator --command=rtorrent" \
"newsbeuter - Feed Reader" "terminator --command='newsbeuter -r'" \
"elinks - Web Browser" "terminator --command=elinks" \
"MUTT - Email Client" "terminator --command=mutt" \
"irssi - IRC Client" "terminator --command=irssi" \
"naim - Chat Client" "terminator --command=naim" \
"htop - System Monitor" "terminator --command=htop" \
"Vim" "terminator --command='man vim'" \
"Midnight Commander" "terminator --command='man mc'" \
"rtorrent" "terminator --command='man rtorrent'" \
"MoC" "terminator --command='man mocp'" \
"newsbeuter" "terminator --command='man newsbeuter'" \
"elinks" "terminator --command='man elinks'" \
"MUTT" "terminator --command='man mutt'" \
"irssi" "terminator --command='man irssi'" \
"naim" "terminator --command='man naim'" \
"htop" "terminator --command='man htop'" \
"Evince PDF Viewer" "evince" \
"xCHM HTML Help Viewer" "xchm" \
"gedit" "gedit" \
"Leafpad" "leafpad" \
"Vim" "terminator --command=vim" \
"gVim" "gvim" \
"Pyroom" "pyroom" \
"Xfburn CD/DVD Writer" "xfburn" \
"Gnome Calculator" "gnome-calculator" \
"Gnome Dictionary" "gnome-dictionary" \
"OSMO Personal Organizer" "osmo" \
"PCMan File Manager" "pcmanfm" \
"PCMan File Manager (root)" "gksudo pcmanfm" \
"Terminator" "terminator" \
"Xterm" "xterm" \
"File Roller" "file-roller" \
"File Roller (root)" "gksudo file-roller" \
"Xpad - sticky notes" "xpad" \
"World Clock" "gworldclock" \
"Edit .conkyrc" "gedit ~/.conkyrc" \
"Restart Conky" "conkywonky" \
"man page" "terminator --command='man conky'" \
"Wiki Page" "firefox http://crunchbanglinux.org/wiki/conky" \
"Edit start-up script" "gedit ~/.config/dMenu/dMenu-bind.sh" \
"man page" "terminator --command='man dMenu'" \
"Edit gmrun config file" "gedit ~/.gmrunrc" \
"man page" "terminator --command='man gmrun'" \
"Edit terminator config file" "gedit ~/.config/terminator/config" \
"man page" "terminator --command='man terminator_config'" \
"Edit tint2 onfig file" "gedit ~/.config/tint2/tint2rc" \
"man page" "terminator --command='man tint2'" \
"Online Help" "firefox http://code.google.com/p/tint2/wiki/Welcome" \
"lx User Interface Settings" "lxappearance" \
"Screensaver and  Power Management" "gnome-screensaver-preferences" \
"Choose Wallpaper" "nitrogen ~/images/wallpapers/" \
"System Update" "system-update" \
"Disk Partitioner" "gksudo gparted" \
"Adjust with lxrandr" "lxrandr" \
"Adjust with grandr" "grandr" \
"man xrandr" "terminator --command='man xrandr'" \
"Edit Default Applications" "terminator --command='sudo update-alternatives --all'" \
"Login setup (GDM)" "gksudo gdmsetup" \
"Network Admin" "network-admin" \
"Package Manager" "gksudo synaptic" \
"Passwords and Encryption Keys" "seahorse" \
"Printer Settings" "system-config-printer" \
"Restricted Device Manager" "gksudo jockey-gtk" \
"Services/Daemons" "services-admin" \
"Shared Folders" "shares-admin" \
"System Monitor" "terminator --command=htop" \
"System Logs" "gnome-system-log" \
"Time/Date" "time-admin" \
"Users/Groups" "users-admin" \
"Lock Screen" "gnome-screensaver-command -l" \
"openbox Exit" "openbox-logout"

That’s a very big ratmenu, one I probably wouldn’t use myself. I only wanted to get more of the stuff out of it for both ratmenu and the jwmrc I’ll post shortly (maybe tomorrow — still need to edit the keybindings and set up a couple other things so jwm behaves similarly to #!’s openbox set up). It was easier to edit the whole thing than pick and choose the things I wanted (emacs and vim are way more powerful than gedit). I figured I may as well post it so anyone using a distro with a similar mix of applications can take advantage of it.

As I noted above, I like to break things down to have a bit more control over things. Here’s another example showing that a small menu can be launched from one keybinding to manage one particular application. This is my mocp menu which lets me control a lot of its functions without ever opening it up in a console (but I have two entries for that anyway).

#!/bin/mksh
# my mocp ratmenu

ratmenu -fg grey66 -bg grey33 -align center  \
"mocp in term" "aterm -T mocp -e mocp -T transparent-background" \
"next song" "mocp -f" \
"previous song" "mocp -r" \
"pause toggle" "mocp -G" \
"start playlist" "mocp -p" \
"start only daemon" "mocp -S" \
"stop" "mocp -x" \
"clear list/exit" "mocp -c" \
"alsamixer" "aterm -T mixer -e alsamixer"

Those aren’t in any particular order and this isn’t the only application for which this is possible. Look at the documentation for your favorite apps and see how much you can control from outside interfaces.

In the ratmen tutorial article, I had entries in my menus to open things open to various directories. Some of my ratmenus do that with things like image viewers opening to specific directories — such as one entry for screenshots, one for pics from camera, one for scans, etc. I’ll probably also set a couple ratmenus up like my “screen menus” found in my “More GNU screen Tweaks” article.

These are all things you don’t have to use ratmen(u) to accomplish. Just set things up to accomodate your own tastes and needs. After all, it’s your freaking computer. Go ahead, treat it like it is.

posted from weblogger.el
Linux 2.6.28-13-generic i686 (flaky ath5k wifi and all)
Mon Jul 13 18:11:42 CDT 2009
Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: