From: Arnout E. <no...@bz...> - 2012-01-13 19:18:05
|
On Fri, Jan 13, 2012 at 07:10:38PM +0100, Philipp Hartwig wrote: > For a long time I had been desperately missing commands that would allow me > quickly jump directly to my mail client, to my browser and so on. I had worked > around it by giving single-letter window titles to most programs and using the > gotoclient command, but I've never really liked this option. Makes sense. > I've even considered switching to i3 several times because they explicitly > mention[1] such a functionality in their user's guide, but I just can't live > with dynamic tiling anymore. My thoughts exactly: i3 seems really cool for a lot of reasons, but the fact that Notion is 'static' really seems to set us apart - and I can't seem to live without that ;). We should feature this more prominently on the website etcetera I guess. > A week ago I finally sat down to find out if there wasn't a way to somehow > achieve such a functionality in Notion and to my big surprise it was very > easy. As this has truly revolutionized the way I switch between windows I > thought I'd share this revelation. Maybe someone else finds it useful. Also > I'd love to hear comments or suggestions for improvement (although it is > working perfectly for me :)). Cool, thanks a lot for sharing. Indeed, besides being useful on its own, it also nicely shows off how powerful having a scripting engine inside the windowmanager is. In a perfect world, however, in my opinion this would be implemented as a windowmanager-independent tool (or integrated in one like gnome-do or synapse). Should be fairly easy to do actually. Nonetheless we should consider your scripts for the scripting collection. Do you want to share it under both the LGPL and the Notion license? Arnout > I use the following little function (I've put it in cfg_kludges.lua): > --- SNIP --- > gotoclient_by_shortname = function(sn) > local s > ioncore.clientwin_i(function(cwin) > local winprop = ioncore.getwinprop(cwin) > if winprop and winprop.shortname == sn then > s=cwin > return false > else > return true > end > end) > s:goto() > return true > end > --- SNAP --- > > In the definition of the window properties I've added shortnames, for example: > --- SNIP --- > defwinprop{ > class = "URxvt", > instance = "mutt", > target = "muttframe", > shortname = "m" > } > --- SNAP --- > > And in my cfg_notioncore.lua I've added the following section: > --- SNIP --- > submap(META.."U", { > kpress("a", "gotoclient_by_shortname('a')"), > kpress("b", "gotoclient_by_shortname('b')"), > kpress("c", "gotoclient_by_shortname('c')"), > kpress("d", "gotoclient_by_shortname('d')"), > kpress("e", "gotoclient_by_shortname('e')"), > kpress("f", "gotoclient_by_shortname('f')"), > kpress("g", "gotoclient_by_shortname('g')"), > kpress("h", "gotoclient_by_shortname('h')"), > kpress("i", "gotoclient_by_shortname('i')"), > kpress("j", "gotoclient_by_shortname('j')"), > kpress("k", "gotoclient_by_shortname('k')"), > kpress("l", "gotoclient_by_shortname('l')"), > kpress("m", "gotoclient_by_shortname('m')"), > kpress("n", "gotoclient_by_shortname('n')"), > kpress("o", "gotoclient_by_shortname('o')"), > kpress("p", "gotoclient_by_shortname('p')"), > kpress("q", "gotoclient_by_shortname('q')"), > kpress("r", "gotoclient_by_shortname('r')"), > kpress("s", "gotoclient_by_shortname('s')"), > kpress("t", "gotoclient_by_shortname('t')"), > kpress("u", "gotoclient_by_shortname('u')"), > kpress("v", "gotoclient_by_shortname('v')"), > kpress("w", "gotoclient_by_shortname('w')"), > kpress("x", "gotoclient_by_shortname('x')"), > kpress("y", "gotoclient_by_shortname('y')"), > kpress("z", "gotoclient_by_shortname('z')"), > }), > --- SNAP --- > > I can now conveniently switch to my mail client by pressing Alt+u and then m. > Of course there is no need to use a submap so that even faster bindings like > Alt+m can be used if desired. > > Regards, > Philipp > > [1] http://i3wm.org/docs/userguide.html#_jumping_to_specific_windows > > ------------------------------------------------------------------------------ > RSA(R) Conference 2012 > Mar 27 - Feb 2 > Save $400 by Jan. 27 > Register now! > http://p.sf.net/sfu/rsa-sfdev2dev2 > _______________________________________________ > Notion-general mailing list > Not...@li... > https://lists.sourceforge.net/lists/listinfo/notion-general |