From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: Date: Mon, 5 Nov 2012 14:53:20 +0100 Message-ID: From: Rudolf Sykora To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Subject: Re: [9fans] plan9port rio and keyboard shortcuts Topicbox-Message-UUID: d3a033fa-ead7-11e9-9d60-3106f5b1d025 On 10 July 2012 18:31, John Floren wrote: > On Tue, Jul 10, 2012 at 2:26 AM, Rudolf Sykora wrote: >> Hello, >> >> In p9p's rio there is a possibility to cycle over windows with left_alt-tab. >> Has anyone thought about / managed to add some more shortcuts, e.g. >> such that would run a program like dmenu? >> (Do you start all your programs from a terminal?) >> >> Thanks >> Ruda >> > > I put some additional keyboard functionality into w9wm at one point, > it's not that hard. Look at /usr/local/plan9/src/cmd/rio/key.c:44, > figure out what key presses you want to handle, then do a fork+exec or > whatever floats your boat. Ok. For anyone interested, I changed my p9p rio key.c: *** key.c_orig 2012-11-03 18:59:41.040071847 +0100 --- key.c 2012-11-04 10:41:27.853606153 +0100 *************** *** 30,39 **** --- 30,43 ---- { int i; int tabcode = XKeysymToKeycode(dpy, XK_Tab); + int tcode = XKeysymToKeycode(dpy, XK_t); + int rcode = XKeysymToKeycode(dpy, XK_r); for(i=0; ikeycode == tabcode && (e->state&Mod1Mask) == (1<<3)) alttab(e->state&ShiftMask); + if(e->keycode == tcode && (e->state&Mod1Mask) == (1<<3)) { + if(fork() == 0) + execl("/home/ruda/bin/xt", "xt", (char *) 0); + } + if(e->keycode == rcode && (e->state&Mod1Mask) == (1<<3)) { + if(fork() == 0) + execl("/usr/local/bin/dmenu_run", "dmenu_run", (char *) 0); + } XAllowEvents(dpy, SyncKeyboard, e->time); } which now opens xterm (xt is my xterm with unicode locale on) on pressing alt-t and runs dmenu_run (related to dwm) on alt-r. I missed these two shortcuts heavily. (warning: I just added the lines by means of observation; I do not really know what stands behind those XGrabKey and alike functions. Nonetheless it now does what I want.) Also I want to ask if someone noticed that p9p rio for some reason precludes e.g. shuffling of firefox' tabs (both within one window and between windows). Running twm instead of rio helps in this respect. Ruda