From: Philipp H. <ph...@ph...> - 2012-01-13 18:15:54
|
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. 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. 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 :)). 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 |
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 |
From: Philipp H. <ph...@ph...> - 2012-01-13 19:53:23
|
On Fri, Jan 13, 2012 at 08:17:55PM +0100, Arnout Engelen wrote: > > 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. When I first switched to Ion3 from wmii I was used to moving windows in all directions all the time and it took me a while to realize how superior the static approach is. I don't know how easy it is to convey that experience via text. :) But it's worth a try. > Nonetheless we should consider your scripts for the scripting collection. Do > you want to share it under both the LGPL and the Notion license? Any reason why I shouldn't just put in the public domain? I'm not familiar with these license/copyright issues (and something as trivial as this "script" doesn't seem like a good place to start to worry about them). Philipp |
From: Arnout E. <no...@bz...> - 2012-01-13 20:37:08
|
On Fri, Jan 13, 2012 at 08:53:11PM +0100, Philipp Hartwig wrote: > On Fri, Jan 13, 2012 at 08:17:55PM +0100, Arnout Engelen wrote: > > 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. > > When I first switched to Ion3 from wmii I was used to moving windows in all > directions all the time and it took me a while to realize how superior the > static approach is. I don't know how easy it is to convey that experience via > text. :) But it's worth a try. Yeah. I like how i3 has a screencast showing its capabilities, which is really nice (though that has its downsides too: harder to create, harder to maintain, and I'm confident nobody will want to listen to my awful accent :). > > Nonetheless we should consider your scripts for the scripting collection. Do > > you want to share it under both the LGPL and the Notion license? > > Any reason why I shouldn't just put in the public domain? I'm not familiar > with these license/copyright issues (and something as trivial as this "script" > doesn't seem like a good place to start to worry about them). Yeah that should be fine. I just wanted to make sure we can safely distribute the script with notion, and putting it in the public domain ensures that. Arnout |
From: Philipp H. <ph...@ph...> - 2012-01-13 21:38:21
|
On Fri, Jan 13, 2012 at 09:36:59PM +0100, Arnout Engelen wrote: > Yeah. I like how i3 has a screencast showing its capabilities, which is really > nice (though that has its downsides too: harder to create, harder to maintain, > and I'm confident nobody will want to listen to my awful accent :). The overall i3 documentation is excellent. Just looking at the user's guide makes one feel right at home before even running it for the first time. We should think about expanding our Tour as well, the gap between the Tour and "Configuring and extending Notion with Lua" is way too big. By the way could you change the "https" in the "wiki" link on the Notion site to "http"? The current link always asks me to log into SourceForge and I think this is the reason. > Yeah that should be fine. I just wanted to make sure we can safely distribute > the script with notion, and putting it in the public domain ensures that. Okay, then I hereby put the function gotoclient_by_shortname from my Email with the ID 20120113181038.GQ1532@debian into the public domain. I hope that suffices. Cheers, Philipp |
From: Arnout E. <no...@bz...> - 2012-04-01 17:01:29
|
On Fri, Jan 13, 2012 at 10:38:14PM +0100, Philipp Hartwig wrote: > On Fri, Jan 13, 2012 at 09:36:59PM +0100, Arnout Engelen wrote: > > Yeah. I like how i3 has a screencast showing its capabilities, which is really > > nice (though that has its downsides too: harder to create, harder to maintain, > > and I'm confident nobody will want to listen to my awful accent :). > > The overall i3 documentation is excellent. Just looking at the user's guide > makes one feel right at home before even running it for the first time. We > should think about expanding our Tour as well, the gap between the Tour and > "Configuring and extending Notion with Lua" is way too big. Hi all, Philipp has rewritten/improved most of the Tour, it is much more gentle now. I think we should give him write access to our wiki. Any objections? Kind regards, Arnout |
From: David G. <dg...@co...> - 2012-01-13 23:57:36
Attachments:
signature.asc
|
On 13/01/12 21:38, Philipp Hartwig wrote: > On Fri, Jan 13, 2012 at 09:36:59PM +0100, Arnout Engelen wrote: [...] >> Yeah that should be fine. I just wanted to make sure we can safely distribute >> the script with notion, and putting it in the public domain ensures that. > > Okay, then I hereby put the function gotoclient_by_shortname from my Email > with the ID 20120113181038.GQ1532@debian into the public domain. I hope that > suffices. <annoying license pedant> Except some countries don't have a public domain. Not that anyone will ever actually *care* for a snippet so small as this, but for more info see here: http://creativecommons.org/about/cc0 </annoying license pedant> -- ┌─── dg@cowlark.com ───── http://www.cowlark.com ───── │ │ "Never attribute to malice what can be adequately explained by │ stupidity." --- Nick Diamos (Hanlon's Razor) |
From: Philipp H. <ph...@ph...> - 2012-01-19 14:22:18
|
On Fri, Jan 13, 2012 at 11:57:20PM +0000, David Given wrote: > <annoying license pedant> > Except some countries don't have a public domain. Not that anyone will > ever actually *care* for a snippet so small as this, but for more info > see here: http://creativecommons.org/about/cc0 > </annoying license pedant> You are right, apparently German law (which is the one relevant for me) doesn't know such a thing as the public domain. Oh well ... By the way the gotoclient_by_shortname should probably check whether s is actually set like this: --- 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) if s then s:goto() return true else return false end end --- SNAP --- Regards, Philipp |