markusfisch / PieDock

A dock but in shape of a pie menu
http://markusfisch.de/PieDock
MIT License
19 stars 7 forks source link

Use of application icon disables command #8

Closed 0ion9 closed 10 years ago

0ion9 commented 10 years ago

That is, supposing you have an entry:

`icon mypaint "notify-send test"``

then that is exactly equivalent to

icon mypaint -- it runs-or-raises mypaint, rather than executing the explicitly given command.

Context: I am implementing a 'send to' menu which will include run-or-raise functionality for specific apps (copy, run-or-raise selected app, paste). It makes sense to use the app icons here, but it seems a little awkward to have to duplicate them under a different name just to get PieDock to cooperate.

markusfisch commented 10 years ago

Hm. That's very odd. I use this syntax on all of my machines and it works like it should.

In res/piedockrc.sample there's a menu to control windows that depends on the syntax to work:

menu window-control icon close "piedockutils -c $WID" icon iconify "piedockutils -i $WID" icon fullscreen "piedockutils -f $WID" icon lower "piedockutils -o $WID" icon stick "piedockutils -s $WID" icon shade "piedockutils -d $WID" end

Does this work for you? On what system you're running PieDock and what's your locale?

0ion9 commented 10 years ago

Perhaps I was unclear.

That syntax works, if and only if the icon is not an application icon Therefore, that menu you quote works fine for me -- I don't have applications that identify themselves as 'close', 'iconify' etc on my system :) The problem occurs when the icon matches an application.

Here's a minimal testcase:

menu test
        icon firefox "notify-send Never_seen"
        icon fullscreen "notify-send Executes_normally"
end

Assuming Firefox is running, selecting the firefox icon will go to the Firefox window, rather than showing a notification. Selecting the fullscreen icon will show a notification titled "Executes_normally".

To be even more specific:

System is Arch Linux x86_64 LANG=en_AU.UTF-8

markusfisch commented 10 years ago

Okay, now I think I know what's really the problem: the default button action (for the first mouse button) is "ShowNext" which tries to show the next window of an icon or executes it if no process is active.

When PieDock is used as application dock, that's probably exactly what you want: Run the program if it's not running but raise it if it's already active.

Of course, that's not what you want. Luckily, the button actions can easily be configured in the configuration file. In your case, you probably want to use "Launch" as first button action. Simply change the line

button 1 ShowNext

to

button 1 Launch

If you don't have the first line in your configuration file, just add the second one.

The "Launch" action always executes the command part.

Please note, that button actions cannot be specified per menu. So if you want to have different menus with different button actions, you need to run multiple processes of PieDock using the "-r" flag with a different configuration file.

0ion9 commented 10 years ago

Thanks for the info, that really helps.

Now that I know that -r can create an individual instance per configuration, I might try that too. (the help text, which I only just found -- I was trying to get help by passing "--help" rather than "-h" -- , doesn't describe this behaviour)

Closing since this seems to have been a simple misconfiguration.