SwayNotificationCenter icon indicating copy to clipboard operation
SwayNotificationCenter copied to clipboard

Apparent Typo in config.json - actions > update-command [Bug]

Open Svra44 opened this issue 7 months ago • 0 comments

Describe the bug

Using "config.json" as sourced from "/etc/xdg/swaync/config.json" I observed that "type": "toggle" such as the example "nmcli radio wifi" toggle wasnt working as expected. Saw that "update_command" is in the "config.json", however ReadMe & Man indicate it should instead be "update-command". Switching to "update-command" looks to have fixed the toggle behaviour. https://github.com/ErikReider/SwayNotificationCenter/blob/main/src/config.json.in has the same underscore for "update_command".

-- Example from "config.json" at current { "label": "直", "type": "toggle", "active": true, "command": "sh -c '[[ $SWAYNC_TOGGLE_STATE == true ]] && nmcli radio wifi on || nmcli radio wifi off'", "update_command": "sh -c '[[ $(nmcli radio wifi) == "enabled" ]] && echo true || echo false'" }

To Reproduce

Steps to reproduce the behavior:

  1. Use the "config.json" as provided in repo or package
  2. Toggles will not work correctly and becomes desync'd with the actual status reported by nmcli, as "update_command" is not executed.

Expected behavior

"config.json" needs to be corrected to use "update-command" instead of "update_command" for toggle status to be accurate. Doing so causes "update-command" to get executed correctly.

Desktop (please complete the following information):

  • OS: Arch Linux - Rolling
  • Version: swaync 0.10.1-2

Svra44 avatar Jun 26 '24 16:06 Svra44