Sway : Add tooltip for display.
This commit is contained in:
parent
97645805aa
commit
83a5c4122a
|
@ -1,4 +1,6 @@
|
|||
{ setting, style, ... }: {
|
||||
{ setting, style, ... }: let
|
||||
refreshInterval = 1;
|
||||
in {
|
||||
text = ''
|
||||
// -*- mode: jsonc -*-
|
||||
{
|
||||
|
@ -69,7 +71,7 @@
|
|||
},
|
||||
"custom/powerlimit": {
|
||||
"exec": "powerlimit waybar",
|
||||
"interval": 1,
|
||||
"interval": ${toString(refreshInterval)},
|
||||
"on-click-right": "powerlimit toggle"
|
||||
},
|
||||
"pulseaudio": {
|
||||
|
@ -114,12 +116,14 @@
|
|||
},
|
||||
"custom/powersave": {
|
||||
"exec": "powersave waybar",
|
||||
"interval": 1,
|
||||
"interval": ${toString(refreshInterval)},
|
||||
"on-click": "foot -e bash -c btop",
|
||||
"on-click-right": "powersave toggle"
|
||||
},
|
||||
"custom/display": {
|
||||
"exec": "echo ",
|
||||
"exec": "swayscript monbar",
|
||||
"interval": ${toString(refreshInterval)},
|
||||
"return-type": "json",
|
||||
"on-click": "swayscript montoggle",
|
||||
"on-click-right": "swayscript vrrtoggle"
|
||||
}
|
||||
|
|
|
@ -20,13 +20,17 @@
|
|||
|
||||
# Toggle monitors.
|
||||
function montoggle() {
|
||||
if [[ "$(_monstate)" = "off" ]]; then
|
||||
monon
|
||||
else
|
||||
if [[ "$(_monstate)" = "on" ]]; then
|
||||
monoff
|
||||
else
|
||||
monon
|
||||
fi
|
||||
}
|
||||
|
||||
function monbar() {
|
||||
printf "{\"text\": \"\", \"tooltip\": \"Mon: $(_monstate) / Vrr: $(_vrrstate)\"}\n"
|
||||
}
|
||||
|
||||
function _monstate() {
|
||||
if [[ "''${1}" = "" ]]; then
|
||||
cat /tmp/.monstate 2> /dev/null || echo on
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
function _vrrstate() {
|
||||
if [[ "''${1}" = "" ]]; then
|
||||
cat /tmp/.vrrstate 2> /dev/null || off
|
||||
cat /tmp/.vrrstate 2> /dev/null || echo off
|
||||
else
|
||||
echo "''${*}" > /tmp/.vrrstate
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue