Skip to content
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

Buttons-grid command gets called everytime notification-center is opened #431

Open
kamssiopeia opened this issue May 24, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@kamssiopeia
Copy link

kamssiopeia commented May 24, 2024

Please read through the README and the Man pages before submitting
Please also make sure that there isn't any prior issue describing this bug

Describe the bug
Using buttons-grid widget with one of buttons having update-command and type = toggle, calls command when opening notification-center for the first time after reloading config or starting computer

To Reproduce
Steps to reproduce the behavior:

  1. Go to json config of swaync
  2. Add buttons-grid widget
  3. Configure button with type = toggle, update-command example from README.md can be used or any other ie.
{
  "label": "󰖩",
  "command": "nm-connection-editor",
  "type": "toggle",
  "update-command": "sh -c '[[ $(nmcli radio wifi) == \"enabled\" ]] && echo true || echo false'"
}
  1. Open notification-center
  2. Notification-center calls command from buttons-grid

Expected behavior
Nothing is called except for update-command

Please provide logs if you're experiencing notification errors / bugs
Attach Gists for swaync logs by running G_MESSAGES_DEBUG=all swaync and (if applicable) application logs.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: arch 6.9.1
  • Version: 0.10.1

Additional context
For some reason when I configured other toggle button with update-command = pamixer --get-mute, command under command key gets fired every time I open, not only for the first time

Example configurations for buttons using pamixer

{
  "label": "󰕾",
  "command": "pamixer -t",
  "type": "toggle",
  "update-command": "pamixer --get-mute"
},
{
  "label": "",
  "command": "pamixer --default-source -t",
  "type": "toggle",
  "update-command": "pamixer --default-source --get-mute"
},
@kamssiopeia kamssiopeia added the bug Something isn't working label May 24, 2024
@kamssiopeia kamssiopeia changed the title [Bug] Buttons-grid command gets called everytime notification-center is opened May 24, 2024
@ForgotMyPasswd
Copy link

I'm also getting this issue, however command only runs when I open notification-center for the first time

@rtgiskard
Copy link

I believe this is what it is designed. The update-command is used to get current actual toggle status, the result is used to set the state of toggle button on open notify center.

@kamssiopeia
Copy link
Author

I believe this is what it is designed. The update-command is used to get current actual toggle status, the result is used to set the state of toggle button on open notify center.

update-command should fire every time you open notification center, but command shouldn't

@rtgiskard
Copy link

I believe this is what it is designed. The update-command is used to get current actual toggle status, the result is used to set the state of toggle button on open notify center.

update-command should fire every time you open notification center, but command shouldn't

Well, I'm using the latest git version, the issue seems to be fixed with this commit: be1533a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants