Way to tell the daemon to wake-up from a script.

27 views
Skip to first unread message

key...@frundle.com

unread,
Feb 10, 2011, 3:44:13 PM2/10/11
to keynav...@googlegroups.com
Dear keynavvers,

This is a great input method for mouse avoiders. Is there any command
like 'keynav --listen' that could tell the already running keynav
instance to start zooming so that scripts can call keynav?

I can use xdotool to make a script virtually press ctrl-; but this is
kludgy and messes up sometimes.

Sincerely yours,
John B.

Jordan Sissel

unread,
Feb 10, 2011, 4:41:13 PM2/10/11
to keynav...@googlegroups.com
On Thu, Feb 10, 2011 at 12:44 PM, <key...@frundle.com> wrote:
Dear keynavvers,

 This is a great input method for mouse avoiders.  Is there any command
like 'keynav --listen' that could tell the already running keynav
instance to start zooming so that scripts can call keynav?

That isn't possible with today's code, but should be easy to add.

How about a .keynavrc setting that tells keynav to listen on a pipe/socket/whatever and you send commands to it, like "start" and other goodies?

-Jordan
 

 I can use xdotool to make a script virtually press ctrl-; but this is
kludgy and messes up sometimes.

 Sincerely yours,
  John B.

--
You received this message because you are subscribed to the Google Groups "keynav-users" group.
To post to this group, send email to keynav...@googlegroups.com.
To unsubscribe from this group, send email to keynav-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/keynav-users?hl=en.


pentadactyl

unread,
Feb 11, 2011, 1:38:38 PM2/11/11
to keynav-users
That sounds great. But it does require a user to know about pipes/
sockets/whatevers. Since you should be expected to only have one
instance of keynav running, I hope there's a way to make 'keynav --
listen' talk to the only running instance (or err when keynav isn't
running) without a user needing to understand this.

Lots of media players do this, e.g.

mocp --pause
vlc --pause
totem --play-pause

and you're more likely to have multiple instances of those than
keynav.

Again thanks for this incredible program!

Sincerely yours,
John B.

Jordan Sissel

unread,
Feb 11, 2011, 1:41:37 PM2/11/11
to keynav...@googlegroups.com
On Fri, Feb 11, 2011 at 10:38 AM, pentadactyl <penta...@frundle.com> wrote:
That sounds great.  But it does require a user to know about pipes/
sockets/whatevers.  Since you should be expected to only have one
instance of keynav running, I hope there's a way to make 'keynav --
listen' talk to the only running instance (or err when keynav isn't
running) without a user needing to understand this.


Indeed. Do you have an example of how you would use 'keynav --listen' ?

Something like: echo start | keynav --listen ?
Or keynav --listen start ?
Or something else?
 
Lots of media players do this, e.g.

mocp --pause
vlc --pause
totem --play-pause

and you're more likely to have multiple instances of those than
keynav.

Again thanks for this incredible program!

Thanks for the feedback :)

-Jordan

Yuri D'Elia

unread,
Feb 12, 2011, 5:03:19 AM2/12/11
to keynav...@googlegroups.com
On Thu, 10 Feb 2011 13:41:13 -0800, Jordan Sissel wrote:
>> This is a great input method for mouse avoiders. Is there any command
>> like 'keynav --listen' that could tell the already running keynav
>> instance to start zooming so that scripts can call keynav?
>>
>
> That isn't possible with today's code, but should be easy to add.
>
> How about a .keynavrc setting that tells keynav to listen on a
> pipe/socket/whatever and you send commands to it, like "start" and other
> goodies?

I think the best way would be to introduce a new setting in the rc file,
like:

control-socket ~/.keynav.d/sock

which would create an unix domain socket (which would allow multiple
users and sessions on the same machine, contrarily to a traditional
socket) on the specified path when keynav --server is used.

A fifo would also be fine.

keynav --client [command] (or stdin if no command is supplied) would
simply relay the command to the server.

Alternatively, you could listen by default if control-socket is
specified in the .rc, and skip anything but control-socket if --client
is supplied (yeah, it would be nice to call keynav --client without
DISPLAY being set!).

My inspiration comes from the ssh-agent/emacs daemon interface.

pentadactyl

unread,
Feb 14, 2011, 7:15:25 AM2/14/11
to keynav-users
> Indeed. Do you have an example of how you would use 'keynav --listen' ?
>
> Something like: echo start | keynav --listen ?
> Or keynav --listen start ?
> Or something else?

I just meant 'keynav --turn-on-the-crosshairs-now'. My particular
case is an example. I use the window manager 'ratpoison' and I'd like
to make a particular ratpoison command turn the crosshairs on.

In ratpoison, you type Ctrl-T-key and get something to run. I'd like
Ctrl-T-m to call a script containing only

#!/bin/ksh
keynav --turn-on-the-crosshairs-now

I don't want to replace hjkl, etc. with 'keynav --' calls, though I
guess that'd be a good goal for the future. I just want keynav to
start the mouse focusing process when I type 'keynav --turn-on-the-
crosshairs-now'. Keynav already seems plenty flexible in the way you
can change the keymappings once it's started focusing.

But once keynav can be told to focus from a script, all kinds of
inputs could start the keynav focusing. e.g. pressing a USB footpedal
or some other exotic device. A user could even write scripts that
open an application and immediately turn on the crosshairs for mouse
input when they know the application will demand mouse use on startup.

Again, thanks for this already immensely useful program.
Reply all
Reply to author
Forward
0 new messages