Add tooltip selection based on name and state

One can set different tooltips for different workspaces. Selection works
the same as it does for Icons.
Also refactored the `selectIcon` function to a more general
`selectString` function.
Man page is updated too.
This commit is contained in:
Marc Meier
2024-03-20 15:54:52 +01:00
parent 01dce4609c
commit fe1d49518b
3 changed files with 77 additions and 40 deletions
+30 -5
View File
@@ -70,10 +70,9 @@ Addressed by *hyprland/workspaces*
default: true ++
Option to disable tooltip on hover.
*tooltip-format*: ++
typeof: string ++
default: "{name}" ++
The tooltip format.
*tooltips*: ++
typeof: array ++
Based on the workspace ID and state, the corresponding tooltip gets selected. Selection works the same as *format-icons* do. Format replacements are supported. See *icons*.
# FORMAT REPLACEMENTS
@@ -163,7 +162,33 @@ Additional to workspace name matching, the following *format-icons* can be set.
"format": "{icon}",
"format-window-separator": ", ",
"tooltip": true,
"tooltip-format": "{name}: {windows}",
"tooltips": {
"default": "{name}: {windows}",
"empty": "" // Will result in no tooltip
}
"format-icons": {
"1": "",
"2": "",
"3": "",
"4": "",
"5": "",
"active": "",
"default": ""
},
// Window rewrites omitted for brevity
}
```
```
"hyprland/workspaces": {
"format": "{icon}",
"format-window-separator": ", ",
"tooltip": true,
"tooltips": {
"1": "This is the first workspace",
"2": "This is the second",
"2": "And this is the third"
}
"format-icons": {
"1": "",
"2": "",