Troubleshooters.Com®, Linux Library and Steve's ctwm Secret Stash Present:
stevelitt.ctwmrc
Copyright © 2017 by Steve Litt
See the Troubleshooters.Com Bookstore.
Contents:
This document provides Steve Litt's keyboard-centric .ctwmrc in the form of stevelitt-<version#>.ctwmrc. Just download it to your home directory, rename it to .ctwmrc, and begin using ctwm in a keyboard friendly way. You might need to make a few changes to accommodate your exact distro and setup.
Click here to see Steve Litt's keyboard pro .ctwmrc. It's fully annotated for your understanding, and it's been tested on Steve Litt's Void Linux computer.
I've found life easier when I hardcode the screen geometry into MaxWindowSize, which is why this is right at the top, so anybody can change it to suit their setup. Just under that, the WorkSpaceManagerGeometry is set up to yield big squares in a single row of 8 workspaces. The idea is this makes it easier to use the Workspace Manager to move windows between workspaces: Something very challenging with the Window menu.
I make BorderWidth and ThreeDBorderWidth 9 pixels for enhanced glanceability, because my vision is bad. Most folks will want to decrease that number, but on the other hand, if you have exceptionally bad vision, you can increase it.
The font declarations are adapted from the system.ctwmrc that ships with the ctwm tarball. Only the sizes have been changed. I made the menu font extremely large for quick glanceability for those with low vision. Beyond that, I'd like to point out that while one is using a menu, there is nothing else that can be done, so there's no downside to big menu fonts as long as all fonts fit on the screen. The reason I enlarged the window title font has little to do with title readability: Instead it was done to lengthen the titlebar height, which in turn makes the titlebar buttons bigger and more easily clicked. To me, all the rest of the fonts are relatively unimportant.
The variable declarations make things readable from the start.
The magic starts to happen in the section labeled "STEVE LITT'S MODERNIZATION SETTINGS". Each of those settings is annotated with a comment. Those settings give ctwm the necessary focus behaviors, as well as defining titlebar buttons and menus enabling ctwm to behave more like a modern WMDE than an ancient one. It also defines hotkeys to move to the next or to the previous workspace, so no matter what else is or isn't in your ~/.ctwmrc, you'll have a way to traverse workspaces. This section has little to do with keyboard friendliness specifically, instead focusing on giving ctwm behavior expected by modern people.
The next section gives keyboard shortcuts to move to specific workspaces, saving a lot of time.
The next section defines all the workspaces. I left it pretty much as the ctwm tarball's system.ctwmrc left it, except I made the background of workspace 5 black for better movie viewing.
Next comes the colors section. Of special attention are the BorderColor and BorderTileBackground colors so the window border makes crystal clear which window has focus.
The high contrast menu colors are designed from the ground up to be glanceable for folks of any visual acuity or colorblindness. There's no excuse for low contrast menus in any software distribution. Individuals are free to tone it down if they like, but as software ships from the author, menus must be high contrast and glanceable.
I left the Icon Colors alone except for minor changes to MapWindowBackground and MapWindowForeground.
I left the Icon Manager stuff alone, and my only change to NoTitle was to remove the WorkSpaceManager from it. I want my Workspace Manager to be in a fully decorated window so that I can drag it around and use its window menu. When I'm not using the Window Manager, I click the iconize titlebutton (the one on the far left that's just a dot) to iconize it and slide the icon almost all the way off the screen at the bottom left.
To the Functions section I added regain-focus, focus-raise-menu, and focus-raise. These are pretty self-evident, and are used for various hotkeys and mouse actions.
I made small changes to the MOUSE BINDINGS section.
The KEYBOARD BINDINGS section is where I added most of my secret sauce. As it ships from the ctwm software project, ctwm has no hotkeys. I sure changed that, creating hotkeys for:
Last but not least, I added a "go to workspace" menu and a (not working well) send to workspace menu, and added several convenient items to the menus.
Most of my hotkeys use Ctrl+Shift. If you don't like that, you can just change the hotkeys. The reason I chose Ctrl+Shift is it doesn't conflict with many programs, and once you get used to it it's a very easy move there and back from touch-typist home position. You just snake your fingers left and down, then snake them back again. The "close window" hotkey is traditionally Alt+F4: I changed it to Alt+0 because the latter is much easier for a touch typist.Although "next workspace" and "previous workspace" are often expressed as Ctrl+Alt+Right and Ctrl+Alt+Left, these wrist-twisters break the flow of most touch typists, so I use Alt+Right and Alt+Left for this very often used functionality. Yes, this greatly increases the likelihood of conflict with applications, but I do it that way and then change the applications. Of course, you're free to change these to Ctrl+Alt or any other modifier key.
Several shellscripts are referenced in this config file:
This throws up a fullscreen black on black terminal, suitable for temporarily blacking out the whole screen. The shellscript looks like the following:
#!/bin/sh exec /usr/bin/xterm -fg rgb:00/00/22 -bg rgb:00/00/00 -fullscreen
This is a must for laptops: It toggles the Synaptics touchpad on and off. No more odd typing positions to avoid the touchpad, and no more sneak attack document movements. Code follows:
#!/bin/sh curstate=`synclient | grep -i TouchpadOff | sed -e"s/.*= //"` if test "$curstate" = "1"; then synclient TouchpadOff=0 else synclient TouchpadOff=1 fi
This runs dmenu from Suckless Tools in such a way as to make a large-print, high contrast, ultra-glanceable, alphabetically ordered vertical menu of all executables on the program path, with quick keyboard selection. Code follows:
#!/bin/sh dmenu_run -i -l 26 \ -fn 12x24 \ -nf yellow -nb black \ -sf black -sb white
By the way, I put this file in /usr/local/share, which is almost certainly the wrong place for it. You should put it in a better place and then adjust your ~/.ctwmrc to reflect that fact.
I have a program called UMENU. It's free software, available on Troubleshooters.Com. My workflow demands I have instant access to UMENU, hence the easy to hit Ctrl+9 hotkey. display_menu_in_terminal.sh instantly runs UMENU in a terminal. Source follows:
#!/bin/sh xterm -bg "#ffffff" -fg "#000033" \ -fa "DejaVu Sans Mono:style=Bold:size=12" \ -e "/d/bats/mms.sh"
The preceding refers to shellscript /d/bats/mms.sh, which simply runs UMENU in the current CLI environment. Code follows:
#!/bin/sh cd ~/umenu2/prog ./umenu.py s
It's pretty easy. Back up your current ~/.ctwmrc. Then download stevelitt-<version#>.ctwmrc into your home directory, and rename it .ctwmrc. Run ctwm, or if it's already running, restart it in your usual way. You'll then be running your ctwm the stevelitt.ctwmrc way.
Of course, not everything will work right away. You'll need to install dmenu and create the dmenu shellscript, and adjust your ~/.ctwmrc to pull it up. Same with touchtoggle and several other things. You might have problems with some things that should work, calling for a little troubleshooting. In particular, ctwm sometimes gets itself into states where it can neither receive keyboard nor mouse input. This usually happens when you run a hotkey to a shellscript or executable that asks for keyboard input. Often this can be rectified by having the hotkey run the shellscript or executable in the background using an ampersand (&) at the end of the line.
[ Training | Troubleshooters.Com | Email Steve Litt ]