photo
Jordan Sissel
geek

Sat, 14 Jun 2008

keynav shell command examples

Press 'f' when keynav is active and instantly jump to my firefox window.
# in .keynavrc
f sh "activate-firefox.sh", end
Now, in activate-firefox.sh:
#!/bin/sh
# activate-firefox.sh
xdotool windowactivate $(xdotool search -title -- '- Mozilla Firefox')
Extend that and press 'g' to jump to gmail, assuming that tab is open. (Requires my firefox tabsearch plugin)
# in .keynavrc
g sh "activate-gmail.sh"
Now, in activate-gmail.sh:
#!/bin/sh
# activate-gmail.sh

./activate-firefox.sh
xdotool key ctrl+apostrophe
xdotool type gmail
xdotool key Return

Comments: 0 (view comments)
Tags: , , ,
Permalink: /geekery/keynav-shell-examples
posted at: 06:23

new keynav version available (20080614.01)

Hop on over to the keynav project page and download the new version.

The changelist from the previous announced release is as follows:

20080614.01:
  - Several bug fixes and feature additions suggested by Yuri D'Elia.
  - Sync xdotool library to 20080606
  - Added default key binding Ctrl+[ as 'end' (requested by Luke Macken)
  - New command: 'sh' - Executes shell commands.
    Example keynavrc: ctrl+x sh "xterm -bg black -fg white"
  - New command: 'history-back' - Undo a window change operation
    Example keynavrc: a history-back
    + Such operations include: cut-*, grid, cell-select, move-*
    + The history size is currently hard-coded at 100 entries.
    + If you exceed 100 moves, the oldest entry will be removed.
    + Every time keynav is activated, the history is wiped.
  - Fix: Any command starting with "start" is now bound globally.
  - Fix: All rendering is delayed until after the end of the current command
    sequence. This fixes (in order of annoyance, worst first):
    1) Crash when a 'start' and 'end' exist in the same command sequence.
    2) Visible 2x2 grid first, before a 3x3 grid when the start command is
       'start, grid 3x3'
    3) Rendering blinking a full white window on the screen before clipping to
       the grid.
    4) Visible blink when "cut-left,cut-up" and such are run simultaneously.
  - Fix: If the 'start' command is invoked again while keynav is active, then
    the default arrangement is set (full screen and 2x2 grid). Previously, the
    'start' command was a no-op if keynav was active.

Comments: 0 (view comments)
Tags: ,
Permalink: /geekery/keynav-20080614
posted at: 06:18

Wed, 21 May 2008

new keynav version available (20080522)

Hop on over to the keynav project page and download the new version.

The changelist from the previous announced release is as follows:

20080522:
  - Sync xdotool library to 20080521.
  - Added 2 grid examples to keynavrc
  - Applied patches from Richard Kolkovich
    + Fix backwards math when calculating Nth cell when using 'cell-select N'
    + Fix dislexia when doing 'cell-select NxM'
    + Abort update() calls when app is inactive.
  - Now warns you if you try to execute an invalid command.
(Yes, 0522 is tomorrow. Turns out uploads to googlecode are write-once, so I'll need to come up with an additional versioning scheme that lets me push multiple releases in a single day in case I find something bad after I upload a release.)

Comments: 1 (view comments)
Tags: , , ,
Permalink: /geekery/keynav-20080522
posted at: 04:29

Thu, 15 May 2008

Impulse-driven computing

Muscle memory is great. Are there flexible, programmable tools which let you turn a set of potentially-complex actions into something muscle-memory trainable?

I suspect making a generic tool to do this would be difficult. keynav and xdotool aim to solve some of these problems, but what about some of the more complex ones? Is it worth trying to solve these edge cases with automation? Specifically, I mean solutions where programatically you'd be talking to two or more separate systems (or APIs).

One specific set of problems is because X11's default clipboard buffer is not the same thing as GTK's clipboard buffer. So, in firefox, using 'middle click' to paste gives me X11's clipboard while CTRL+V gives me GTK (firefox)'s clipboard contents. It's likely I'm calling this thing "X11's clipboard" when it's really the "X11 Selection". It seems simple to write a tool that would copy X11's current selection to GTK's clipboard.

You could have code that looked like this, but it wouldn't be efficient:

while true:
  if gtk_clipboard_changed:
    set_x11_clipboard(value)
  else if x11_clipboard_changed:
    set_gtk_clipboard(value)
You could make that not chew up cpu by adding a small sleep at the end of each iteration, but that still sucks. From what I can tell, GTK has a way to block for clipboard changes, but X11 may not.

If the X11 application uses cut buffers, then the root X window gets notifications about cut buffer changes. However, copying stuff in firefox doesn't show any cut buffers being used.

Alternately, we could hack our own "ctrl+v" functionaly by grabbing that keystroke, or by grabbing a different, unrelated keystroke, which would do:

  1. copy primary selection to clipboard
  2. send literal "ctrl+v"
  3. restore clipboard
Update: An existing tool will keep your selection and clipboard buffers in sync: autocutsel. Looks like it uses the sleepy-loop approach I mentioned, but it does work. Awesome!

Comments: 2 (view comments)
Tags: ,
Permalink: /geekery/impulse-driven-computing
posted at: 06:29

Fri, 09 May 2008

new keynav version available (20080509)

I got enough feature requests for grid support (in various layouts) that I decided it was time to add generic grid support. You can now use grid movement on grids of any configuration, 2x2, 3x3, 2x3, etc.

Hop on over to the keynav project page and download the new version.

The changelist from the previous announced release is as follows:

  Feature request: Grid support.
  * New command: 'grid NxM' N and M are row and columns, respectively.
    You can divide the screen into any number of rows and columns.
    The default is 2x2.
  * New command: 'cell-select N' or 'cell-select NxM'
    With this command you can select a specific cell to zoom to.
    Usage: cell-select N
      Selects the Nth cell, counting from top left to bottom right.
      The order of a 3x3 grid would be:
        1 2 3
        4 5 6
        7 8 9
    Usage: cell-select NxM
      Selects the specific cell at NxM. '2x2' will select row 2 column 2.

  Other important changes:
  - Whitespace before command names works now.
  - Added a pile of new examples in keynavrc.

Comments: 0 (view comments)
Tags: , ,
Permalink: /geekery/keynav-20080509
posted at: 04:52

Thu, 08 May 2008

Keynav mailing list created

I've been slightly overwhelmed with email about keynav in the past few days. To help with this, I've created a mailing list for the project.

Email: keynav-users@googlegroups.com Home: http://groups.google.com/group/keynav-users

I'll post announcements there in addition to this site. Questions should be directed to the mailing list. :)

Comments: 0 (view comments)
Tags: , ,
Permalink: /geekery/keynav-users-mailing-list
posted at: 18:36

new keynav version available (20080508)

Hop on over to the keynav project page and download the new version.

The changelist from the previous announced release is as follows:

  Bug fix:
    If you tried to override an existing key binding, it would add a 2nd
    binding for that key instead of actually overriding it.
  Reported by Tim Schumacher.

Comments: 0 (view comments)
Tags: ,
Permalink: /geekery/keynav-20080508
posted at: 12:50

Fri, 02 May 2008

new keynav version available (20080501)

Hop on over to the keynav project page and download the new version.

The changelist from the previous announced release is as follows:

20080501:
  Patches from Mark (20080501)
   * ~/.keynavrc extends defaults rather than replacing them
   * "clear" in ~/.keynavrc resets keybindings
   * comments can appear anywhere on a line

  Patches from Eric (20080501)
   * If the move or size value is greater than 1.0, then assume it is an absolute value.

  Patches from Lukas Mai (20080429)
   * Fixes a few minor bugs
   * Clean up to compile without most warnings when -pendantic and -Wall are enabled.

Comments: 0 (view comments)
Tags: ,
Permalink: /geekery/keynav-20080501
posted at: 13:44

Tue, 23 Oct 2007

new keynav version available (20071023)

Hop on over to the keynav project page and download the new version.

The changelist from the previous announced release is as follows:

20071023:
  - Add support for {Super,Hyper}_{R,L} modifiers (aka Mod4Mask)

Comments: 0 (view comments)
Tags: ,
Permalink: /geekery/keynav-20071023
posted at: 03:24

Mon, 03 Sep 2007

new keynav version available (20070903)

Hop on over to the keynav project page and download the new version.

The changelist from the previous announced release is as follows:

20070903:
  - Drag is now working. Problem was KeyEvent.state contains masks such as
    | Button1Mask which is set when mouse button 1 is held, so keybindings stopped
    | working. Ignoring Button[1-5]Mask in this value fixes the problem.
  - Drag takes two optional arguments: a button followed by a keysequence to fire.
    | 'drag 1 alt' will do an alt+leftclick drag.
    | 'drag 2' will do a middleclick drag.
  - sync to xdotool@20070903
  - Fix a bug in parse_mods and parse_keysym where it was destructively changing the string.
  - Fix a bug where I was using the loop iterator 'i' inside another for loop. Oops.
  - Add to defaults my nethack-vi-style diagonal keybindings

Comments: 0 (view comments)
Tags: ,
Permalink: /geekery/keynav-20070903
posted at: 18:56

Search this site

Navigation

Page 1 of 2  [next]

Metadata

Home About Resume My Code (SVN)

Articles

ARP Security Dynamic DNS with DHCP OpenLDAP+Kerberos+SASL PPP over SSH SSH Security: /bin/false Week of Unix Tools Work Efficiency

Projects

fex firefox tabsearch firefox urledit grok keynav liboverride newpsm (FreeBSD) nis2ldap pam_captcha poor man's backup Solaris audio utility xboxproxy xdotool xmlpresenter xpathtool misc scripts

Presentations

Yahoo! Hack Day '06 Unix Essentials Vi/Vim Essentials

Tag Cloud

Calendar

< June 2008
SuMoTuWeThFrSa
1 2 3 4 5 6 7
8 91011121314
15161718192021
22232425262728
2930     

Friends

BarCamp Kent Brewster Tantek Çelik John Resig Wesley Shields Tyler Shields

Technorati