New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TrayButton support for a different action per mouse button #171

Closed
joewing opened this Issue Apr 7, 2015 · 9 comments

Comments

Projects
None yet
3 participants
@joewing
Owner

joewing commented Apr 7, 2015

Right now tray buttons only support running a single action. It would be nice to be able to specify an action for each mouse button (see issue #11).

The most complicated part of this is deciding how to configure it. One approach would be:

 <TrayButton icon=“myicon.png”>
   <Button mask=“123”>exec:actionA</Button>
   <Button mask=“4”>exec:actionB</Button>
   <Button mask=“5”>exec:actionC</Button>
 </TrayButton>

This would have a tray button that ran the same command when buttons 1, 2, or 3 were clicked and different actions for the scroll wheel.

@joewing joewing added the enhancement label Apr 7, 2015

@joewing joewing added this to the Version 2.3.0 milestone Apr 7, 2015

@joewing

This comment has been minimized.

Show comment
Hide comment
@joewing

joewing Apr 9, 2015

Owner

This is implemented as of snapshot 1072.
For backwards compatibility and ease of configuration, you can still use the old method of configuration to get mask “123”.

Owner

joewing commented Apr 9, 2015

This is implemented as of snapshot 1072.
For backwards compatibility and ease of configuration, you can still use the old method of configuration to get mask “123”.

@joewing joewing closed this Apr 9, 2015

@Israel-D

This comment has been minimized.

Show comment
Hide comment
@Israel-D

Israel-D Apr 9, 2015

Contributor

Sorry to be a bother here.
Could you make the release notes a bit more verbose?
You have:
"Added the ability to have seperate actions per mouse button for tray buttons (issue #171)."
Is the approach to use what you describe in your initial comment? Or did you do something slightly different?
Is this a for TrayButton only, or does this fix the scroll wheel switching desktops issue that users have as well? Sorry If I missed something obvious here.

Contributor

Israel-D commented Apr 9, 2015

Sorry to be a bother here.
Could you make the release notes a bit more verbose?
You have:
"Added the ability to have seperate actions per mouse button for tray buttons (issue #171)."
Is the approach to use what you describe in your initial comment? Or did you do something slightly different?
Is this a for TrayButton only, or does this fix the scroll wheel switching desktops issue that users have as well? Sorry If I missed something obvious here.

@joewing

This comment has been minimized.

Show comment
Hide comment
@joewing

joewing Apr 9, 2015

Owner

I just updated the release notes.

This is only for tray buttons (where it fixes the scroll wheel issue because the default button mask is now “123” instead of any button), though I could do the same thing for the clock. The clock has been fixed just by ignoring all buttons other than 1, 2, or 3.

Owner

joewing commented Apr 9, 2015

I just updated the release notes.

This is only for tray buttons (where it fixes the scroll wheel issue because the default button mask is now “123” instead of any button), though I could do the same thing for the clock. The clock has been fixed just by ignoring all buttons other than 1, 2, or 3.

@Israel-D

This comment has been minimized.

Show comment
Hide comment
@Israel-D

Israel-D Apr 9, 2015

Contributor

Ok thank you!
I see what you did, this is amazing! I am getting some really interesting ideas of what is possible now.
Does this also work with root? or only exec?

Contributor

Israel-D commented Apr 9, 2015

Ok thank you!
I see what you did, this is amazing! I am getting some really interesting ideas of what is possible now.
Does this also work with root? or only exec?

@joewing

This comment has been minimized.

Show comment
Hide comment
@joewing

joewing Apr 9, 2015

Owner

This should work with root as well.
I just now updated the “Clock” component to support binding different commands to different buttons. I’m considering making “Clock” work the same way as TrayButton such that it can show menus too, but that would be another change that would break old configurations.

Owner

joewing commented Apr 9, 2015

This should work with root as well.
I just now updated the “Clock” component to support binding different commands to different buttons. I’m considering making “Clock” work the same way as TrayButton such that it can show menus too, but that would be another change that would break old configurations.

@Israel-D

This comment has been minimized.

Show comment
Hide comment
@Israel-D

Israel-D Apr 10, 2015

Contributor

A menu could be useful in the clock, but I do not think it is extremely important at this point.
I am rebuilding my PPA of jwm (I am using a minimal Ubuntu distro), so I will test the new clock to make sure that the scrolling issue is fixed

Contributor

Israel-D commented Apr 10, 2015

A menu could be useful in the clock, but I do not think it is extremely important at this point.
I am rebuilding my PPA of jwm (I am using a minimal Ubuntu distro), so I will test the new clock to make sure that the scrolling issue is fixed

@Israel-D

This comment has been minimized.

Show comment
Hide comment
@Israel-D

Israel-D Apr 13, 2015

Contributor

@joewing I had a thought recently. I have made a few different menus that I generate automatically from scripts in /etc/menu-methods. I use almost all the possible menus I can have (AFAIK).
I was wondering if there was a way to use more than 1-9. I know if I chain together numbers those menus are all linked together onroot="23" for example.
With Traybuttons supporting different actions for different buttons, is it possible to make an onroot="a" or some other option. I would like to directly link right clicking on my 'Applications menu' Traybutton to a menu with items to configure it (change menu items, configure icon, etc...)

Basically I would like to implement something akin to what larger DE do (LXDE,XFCE, etc...) where a right click on different parts of the Tray show a menu to configure that specific part.

If this would be too major an undertaking I fully understand not being able to.

Contributor

Israel-D commented Apr 13, 2015

@joewing I had a thought recently. I have made a few different menus that I generate automatically from scripts in /etc/menu-methods. I use almost all the possible menus I can have (AFAIK).
I was wondering if there was a way to use more than 1-9. I know if I chain together numbers those menus are all linked together onroot="23" for example.
With Traybuttons supporting different actions for different buttons, is it possible to make an onroot="a" or some other option. I would like to directly link right clicking on my 'Applications menu' Traybutton to a menu with items to configure it (change menu items, configure icon, etc...)

Basically I would like to implement something akin to what larger DE do (LXDE,XFCE, etc...) where a right click on different parts of the Tray show a menu to configure that specific part.

If this would be too major an undertaking I fully understand not being able to.

@technosaurus

This comment has been minimized.

Show comment
Hide comment
@technosaurus

technosaurus Apr 15, 2015

Contributor

You can try just changing the count from 10 to some arbitrary number.
https://github.com/joewing/jwm/blob/master/src/root.c#L24
I'm not sure if there is anything more to it.
(This value was changed since 1.x though, but I don't recall if it added/subtracted from the count)
Note however that your "important" menus should still be 1-3 for mouse button association.

Contributor

technosaurus commented Apr 15, 2015

You can try just changing the count from 10 to some arbitrary number.
https://github.com/joewing/jwm/blob/master/src/root.c#L24
I'm not sure if there is anything more to it.
(This value was changed since 1.x though, but I don't recall if it added/subtracted from the count)
Note however that your "important" menus should still be 1-3 for mouse button association.

@joewing

This comment has been minimized.

Show comment
Hide comment
@joewing

joewing Apr 15, 2015

Owner

Adding support is something I’ve thought about doing before. It should be fairly easy to do. I created an issue for it (issue #172).
Just changing that constant should work, but then you would need to specify strange characters (or up the constant to a large enough number). The next 7 ASCII characters are punctuation, but then the upper-case letters start.

Owner

joewing commented Apr 15, 2015

Adding support is something I’ve thought about doing before. It should be fairly easy to do. I created an issue for it (issue #172).
Just changing that constant should work, but then you would need to specify strange characters (or up the constant to a large enough number). The next 7 ASCII characters are punctuation, but then the upper-case letters start.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment