feat(waybar): update keyboard module, update input config file

Update the Waybar keyboard module to move the keyboard layout to the tooltip when hovering over the module (and out of the actual Waybar).

This will contribute to a cleaner look, and help trim down the lengthiness of the Waybar without sacrificing the utility of the module.

* Move keyboard layout to tooltip
* The module comments also referenced a script for sending signal, but there is no such script. The comments have been updated to reference example code added to ~/.config/sway/config.d/input

In addition to adding the example code, ~/.config/sway/config.d/input itself was updated to address some issues and add additional functionality.

* Remove the note about finding the touchpad ID and adding it to the config. This has not been necessary on Sway for a long time.
* Remove the `input type:keyboard xkb_layout "us"` line. This line is not actually doing anything since it will be overwritten by the `exec_always` block right below it every time Sway is reloaded.
* Enable numlock by default
* Add a commented block with example config for setting up keyboard layout toggle.
* Add explanatory comments.
This commit is contained in:
BluishHumility
2024-07-29 22:22:50 -04:00
parent 246e7ae60e
commit e343a92ab7
2 changed files with 21 additions and 12 deletions

View File

@@ -69,13 +69,12 @@
},
"custom/keyboard-layout": {
"exec": "swaymsg -t get_inputs | grep -m1 'xkb_active_layout_name' | cut -d '\"' -f4",
// Interval set only as a fallback, as the value is updated by signal
"exec": "i=$(swaymsg -t get_inputs); echo \"\"; echo \"$i\" | grep -m1 'xkb_active_layout_name' | cut -d '\"' -f4",
"format": "",
// Interval set only as a fallback; use signal to update the module more immediately
"interval": 30,
"format": " {}", // Icon: keyboard
// Signal sent by Sway key binding (~/.config/sway/key-bindings)
"signal": 1, // SIGHUP
"tooltip": false,
// See example config for sending signal to Waybar in ~/.config/sway/config.d/input
"signal": 1,
"on-click": "~/.config/waybar/scripts/keyhint.sh",
},