From 59df736fc816b823cc8ab93c82bcbcb7cffdecd5 Mon Sep 17 00:00:00 2001 From: rileyrg Date: Thu, 27 May 2021 03:52:33 +0200 Subject: [PATCH] added tooltip to custom/monitors in waybar config --- README.md | 15 ++++++++++----- directories/bin/sway/waybar-monitors | 6 +++++- dot-config/waybar/config | 5 +++-- linux-config.org | 11 ++++++++--- 4 files changed, 26 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index a2f428b..7e0f3cb 100644 --- a/README.md +++ b/README.md @@ -1306,10 +1306,11 @@ bindsym $mod+Control+t exec sway-notify "Opening NEW terminal instance" && alacr "on-click": "sway-www https://www.dropbox.com/h", }, "custom/monitors": { - "format": "{}", + "format": "{}", + "return-type" : "json", "interval": 10, "exec": "waybar-monitors", - "tooltip": "false", + "tooltip": "true", "on-click": "sway-screen-menu", }, "custom/bluetooth": { @@ -1533,7 +1534,11 @@ bindsym $mod+Control+t exec sway-notify "Opening NEW terminal instance" && alacr #!/usr/bin/bash #Maintained in linux-config.org l=$(swaymsg -t get_outputs | jq -r '[ .[] | select(.dpms and .active) ] | length') - for i in `seq $l`; do echo -n "🖥️";done + o=$(swaymsg -t get_outputs | jq -r '. | map(.name) | join(",")') + t="" + for i in `seq $l`; do t="${t}🖥️";done + text="{\"text\":\""$t"\",\"tooltip\":\""$o"\"}" + echo $text ``` 4. ~/bin/sway/waybar-weather @@ -1867,7 +1872,7 @@ notify-send -t 3000 "${@}" ``` - + ### ~/bin/sway/sway-screen @@ -1888,7 +1893,7 @@ swaymsg "output ${m} ${c}" ### ~/bin/sway/sway-screen-menu -Gui to select a display and enable/disable it. Calls down to [~/bin/sway/sway-screen](#orgf2aff65). +Gui to select a display and enable/disable it. Calls down to [~/bin/sway/sway-screen](#org3c812f1). :ID: 82455cae-1c48-48b2-a8b3-cb5d44eeaee9 diff --git a/directories/bin/sway/waybar-monitors b/directories/bin/sway/waybar-monitors index 603367a..8742ad9 100755 --- a/directories/bin/sway/waybar-monitors +++ b/directories/bin/sway/waybar-monitors @@ -1,4 +1,8 @@ #!/usr/bin/bash #Maintained in linux-config.org l=$(swaymsg -t get_outputs | jq -r '[ .[] | select(.dpms and .active) ] | length') -for i in `seq $l`; do echo -n "🖥️";done +o=$(swaymsg -t get_outputs | jq -r '. | map(.name) | join(",")') +t="" +for i in `seq $l`; do t="${t}🖥️";done +text="{\"text\":\""$t"\",\"tooltip\":\""$o"\"}" +echo $text diff --git a/dot-config/waybar/config b/dot-config/waybar/config index 15dd069..7501aeb 100644 --- a/dot-config/waybar/config +++ b/dot-config/waybar/config @@ -171,10 +171,11 @@ "on-click": "sway-www https://www.dropbox.com/h", }, "custom/monitors": { - "format": "{}", + "format": "{}", + "return-type" : "json", "interval": 10, "exec": "waybar-monitors", - "tooltip": "false", + "tooltip": "true", "on-click": "sway-screen-menu", }, "custom/bluetooth": { diff --git a/linux-config.org b/linux-config.org index 64df94d..5f771f2 100644 --- a/linux-config.org +++ b/linux-config.org @@ -1787,10 +1787,11 @@ https://github.com/Alexays/Waybar/wiki/Configuration "on-click": "sway-www https://www.dropbox.com/h", }, "custom/monitors": { - "format": "{}", + "format": "{}", + "return-type" : "json", "interval": 10, "exec": "waybar-monitors", - "tooltip": "false", + "tooltip": "true", "on-click": "sway-screen-menu", }, "custom/bluetooth": { @@ -2009,7 +2010,11 @@ Thank you https://github.com/deanproxy/dotfiles/blob/master/linux/i3/scripts/blu #!/usr/bin/bash #Maintained in linux-config.org l=$(swaymsg -t get_outputs | jq -r '[ .[] | select(.dpms and .active) ] | length') - for i in `seq $l`; do echo -n "🖥️";done + o=$(swaymsg -t get_outputs | jq -r '. | map(.name) | join(",")') + t="" + for i in `seq $l`; do t="${t}🖥️";done + text="{\"text\":\""$t"\",\"tooltip\":\""$o"\"}" + echo $text #+end_src ******* ~/bin/sway/waybar-weather #+begin_src bash :tangle ~/bin/sway/waybar-weather