#2 Ability to use one plugin or another, depending on...


Ability to use one plugin or another, depending on the processes actives.

First of all, thank you very much for this program :)
The feature I ask for would be great. Last month, my most-used app to play music was amarok, so I configured keytouch to use the plugin for Amarok to fordward, play, stop... and so.

But I decided to change to audacious (Amarok is terribly slow with large playlists). So, to make it work with keytouch the only way is changing the "active plugin" to the audacious one.

But, sometimes I still use amarok and having to change the settings again each time is annoying.

So... would be possible to use all the plugins at the time? Like LIRC (in example) does. By checking the active applications and sending the commands depending on which of them are active.

One doubt would be what to do if more than one apps are active at the time... I think this wont be very usual, but sending the commands to all of them would be an easy option :)

Thank you and I'll be reading this to check if you like the idea ;)


  • Logged In: YES
    Originator: NO

    Well that's a nice idea. I think I will implement it.

    - Marvin Raaijmakers

  • Logged In: NO

    Cool! I'll be waiting for it impatiently :)

    One way to do this without modifying so much actual configuration, is to create another plugin called "all plugins" (or something similar). If that meta-plugin is selected for a key (that only has sense with play,stop,fordward, (...) keys) then it will check active apps and use all the other plugins deppending on the circunstances.

    Thank you :)

    P.S.: Have you considered localizating the program? That would let it be included in distros like Ubuntu (and if so, the amount of people using it would grow a lot). If you consider it, I could help you with Spanish translation ;)

  • Logged In: YES
    Originator: NO

    The plugin attached to this message should do the trick.
    File Added: music_player-1.0.tar.gz

  • Logged In: NO

    File roller tells me the file is corrupted :?
    Will this plugin be added to the next release? :)

  • Logged In: YES
    Originator: NO

    It isn't corrupted.

  • Logged In: NO

    Sorry, you were right, it was a problem with "file roller", uncompressing it in a terminal did the trick.

    I compiled and installed it. Here goes my testing results

    Testing with amarok:
    - NEXT action: it plays second next song instead of the next
    - PREVIOUS action: same as above, 2 times instead of 1.
    - PLAY/PAUSE action: 2 times again.. first it pauses and inmediately plays again.
    - STOP action: works well, but I don't know if it stops 2 times... because stopping 2 times results in a normal stop :)

    Testing with audacious:
    - NEXT action: it plays the 10th next song instead of the next
    - PREVIOUS action: same as above, 10 times instead of 1.
    - PLAY/PAUSE action: it fordwars 3 seconds the actual song
    - STOP action: works well.

    Testing with audacious & amarok at the time:
    Same results to both players, so it works well with more than 1 player.


  • Logged In: NO

    Another suggestion ;)
    I've been watching the code of this plugin. You use commands like "amarok --stop" to stop amarok, or "audacious --rew" to set the previous song in audacious.
    In this plugin (music_player) it works well since it firstly checks if that player is in /proc directory with current user (that is, if the program is being executed), but with all other plugins you don't check it.

    So if someone presses "next" key and there's no player loaded, with "amarok plugin" it will start amarok and set the next song. I think it's not the desired effect. If someone presses "next" key and there's nothing being executed, it shouldn't launch anything.

    I think, the code you implemented in music_player plugin to check if the player is running should be added to all the other plugins (just checking one player, not all).

    It's just my opinion ;)

  • Logged In: NO

    This would definitly be a great feature. I would like to use such a thing with the Apple Remote of my laptop. Button events from the remote control are handled like normal keystrokes.
    I don't have to use KeyTouch - the normal gnome shortcut settings work for me. I can control the volume or skip tracks in Rhythmbox using the remote control.
    But having the events from the remote control handled diffently, depending on wich application i focused would be very useful. There is a tool for the Mac that does this: http://www.filewell.com/iRedLite/
    You could maybe say: When i press key X and F-Spot is focused it switches to the next photo otherwise the default behaviour ("next track") is handled.