Menu

#13 Intelligent toggle?

lineakd
open
5
2005-09-05
2005-05-04
No

It would be really cool if lineakd could call a
programm to decide in which toggle state a toggleable
key is. It could be implemented with a script that is
run after the key is pressed to determine which
function to execute.

Since the full name of the key is vacant if we split it
up to make it toggleable, we can "overload" this config
option with a new meaning.

Assume we have a key "Play|Pause", now we use this config:

Play|Pause = mpc | grep -q playing && echo "Pause" ||
echo "Play"
Play = mpc play
Pause = mpc pause

lineakd now works this way:
1. User presses key
2. lineakd executes program in "Play|Pause" and reads
its output
3. If the output of the command was "Play", it executes
the action in "Play"
4. If the output of the command was "Pause", it
executes the action in "Pause"

I don't know how hard it is to implement something like
this, but I would really like and use it!

Discussion

  • Sheldon Lee Wen

    Sheldon Lee Wen - 2005-09-05
    • assigned_to: nobody --> sheldonl
     
  • Sheldon Lee Wen

    Sheldon Lee Wen - 2005-09-05

    Logged In: YES
    user_id=240921

    Better implemented as a plugin. I'll have a look if I have
    time.. but that is unlikely. I have a whole list of stuff to
    do for 0.9 unless of course, you want to do it yourself.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.