What I've been up to

Tonight in silly things with onre I would like to present you a handy little configuration bit that makes life a little bit better.

When using the X11 desktop, it's nice to have a modifier key that's rarely bound by applications available for the window manager. As I can live a perfectly happy life without the Caps Lock key, I chose to use that one.

So, let's see how the modifiers are setup in IRIX by default. The -pm option makes xmodmap print the current modifier map.

Code:
 esp@multimedia ~ $ xmodmap -pm
xmodmap:  up to 2 keys per modifier, (keycodes in parentheses):
 
shift       Shift_L (0x1a),  Shift_R (0x61)
lock        Caps_Lock (0x1c)
control     Control_L (0x19),  Control_R (0x60)
mod1        Alt_L (0x21),  Alt_R (0x41)
mod2        Num_Lock (0x7e)
mod3        
mod4      
mod5        Scroll_Lock (0x67)

If I needed the caps lock functionality, I could remap another key as the lock modifier, but I never use it. The following xmodmap expressions make that happen.

Code:
remove lock = Caps_Lock
keysym Caps_Lock = Super_L
add mod3 = Super_L

First, we remove Caps_Lock from the list of lock modifiers. Then we tell X to translate keysym Caps_Lock into Super_L, aka the left-hand Super key. Then we add this keysym to the list of mod3 modifiers. After saving this to ~/.Xmodmap, I tell xmodmap to execute the expressions in the file. Then, I check the outcome.

Code:
 esp@multimedia ~ $ xmodmap .Xmodmap
 esp@multimedia ~ $ xmodmap -pm
xmodmap:  up to 2 keys per modifier, (keycodes in parentheses):
 
shift       Shift_L (0x1a),  Shift_R (0x61)
lock      
control     Control_L (0x19),  Control_R (0x60)
mod1        Alt_L (0x21),  Alt_R (0x41)
mod2        Num_Lock (0x7e)
mod3        Super_L (0x1c)
mod4      
mod5        Scroll_Lock (0x67)

Success! The mod3 modifier can now be used in ~/.4Dwmrc - I've got four desktops named after the background graphics colour, and now I can bind changing the desktop to mod3 and number keys. I've copied /usr/lib/X11/system.4Dwmrc to my home directory before, and now I add the following to the Keys 4DwmKeyBindings section.

Code:
        mod3<Key>1              root|icon|window        f.switch_desk Blue
        mod3<Key>2              root|icon|window        f.switch_desk Magenta
        mod3<Key>3              root|icon|window        f.switch_desk Green
        mod3<Key>4              root|icon|window        f.switch_desk Orange

Damn, such productivity. But why stop here? Let's add the following to Buttons 4DwmButtonBindings:

Code:
        mod3<Btn1Down>  window|frame|icon       f.move
        mod3<Btn3Down>  window|frame|icon       f.resize

Now I can move windows with mod3 and left mouse button and resize them with mod3 and right mouse button. Wow. Such.
 

About us

  • Silicon Graphics User Group (SGUG) is a community for users, developers, and admirers of Silicon Graphics (SGI) products. We aim to be a friendly hobbyist community for discussing all aspects of SGIs, including use, software development, the IRIX Operating System, and troubleshooting, as well as facilitating hardware exchange.

User Menu