-
-
Notifications
You must be signed in to change notification settings - Fork 733
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
Custom module: click behavior #2166
Comments
I've noticed this too with creating a "custom/power" module. If you click it once, it hijacks any further clicks across the entire bar. |
One thing I've noticed is that it only happens on the
My guess it's something to do with what is returned by the on-click event, because it doesn't happen to my Also |
I'm having a similar with
When I click on the module, I get P.S.
|
I made two changes and the problem seems to be solved for my configuration:
My tool ( |
If you guys are using Hyprland, the click issue is related to #1850 & hyprwm/Hyprland#1348 |
Until that fix gets merged into main releases, the workaround for me for now is if you right-click anywhere on the bar it is still picked up by the blocking module but it then seems to reset whatever is causing all future clicks to be captured by the same module. The tooltip fix recommended above didn't work for me. |
Have u tried this: hyprwm/Hyprland#1348 (comment) ? |
I've tried it, it sometimes works but it's really inconsistent. I can put a sleep value up to around 0.25 before the lag becomes annoyingly noticeable and it still sometimes doesn't work and I need to right-click on the bar to 'reset' from that captured state. So for now I'm preferring 'consistently broken' and right-clicking instead of 'consistently laggy and sometimes broken'. |
this bug also affects swaync ErikReider/SwayNotificationCenter#292 |
Can confirm also happens to me on Sway 1.9. "custom/display": {
"exec": "swayscript monbar",
"interval": 1,
"return-type": "json",
"on-click": "swayscript montoggle",
"on-click-right": "swayscript vrrtoggle"
} and the output for swayscript sends swaymsg commands to toggle power/freesync for predefined monitors. Update: for me the only working fix was to add sleep delay before the click command: |
Also on 1.9 and "custom/test": {
"exec": "swaymsg -t get_outputs | jq 'map(select(.name==\"eDP-1\"))' | jq 'map({active})' | jq '.[0]' | jq '. + {\"class\": .active|tostring }' | jq 'if .active == true then .text=\"ON\" else .text=\"OFF\" end' | awk '{printf $0}'",
"on-click": "sleep 0.1 && swaymsg -t get_outputs | jq 'map(select(.name==\"eDP-1\"))' | jq 'map({active})' | jq '.[0]' | jq 'if .active == true then .value=\"disable\" else .value=\"enable\" end' | jq '.value' | xargs -I {} swaymsg output -s $SWAYSOCK eDP-1 {}",
"interval": 1,
"return-type": "json"
} |
Hi,
I have a minimal custom module that should act as a simple button to click on and then execute some command (ignoring the result):
This works fine, in the sense that the module shows up and my command is executed on click. However, there is some wired behavior as my command (
stuff
in the example snippet) is now also executed when clicking other areas (like the workspace selector) on the bar, too.How can I fix this so that my command is only executed when the module is actually clicked on?
Thanks :)
The text was updated successfully, but these errors were encountered: