Waybar : Switch custom modules polling to signals.

This commit is contained in:
Dmitry Voronin 2024-09-11 18:27:04 +03:00
parent 4139870956
commit 0a3c52cf2a
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k
4 changed files with 18 additions and 12 deletions

View file

@ -77,11 +77,6 @@ in {
on-click-right = "powerlimit toggle";
interval = refreshInterval;
};
"custom/powerlimit" = {
exec = "powerlimit waybar";
interval = refreshInterval;
on-click-right = "powerlimit toggle";
};
pulseaudio = {
scroll-step = 5;
format = "{volume}%{icon}{format_source}";
@ -132,18 +127,23 @@ in {
on-click-right = "powersave toggle";
tooltip = false;
};
"custom/powersave" = {
exec = "powersave waybar";
interval = refreshInterval;
on-click = "foot -e bash -c btop";
on-click-right = "powersave toggle";
};
"custom/display" = {
exec = "swayscript monbar";
interval = refreshInterval;
on-click = "sleep 0.1 && swayscript montoggle"; # FIXME: remove sleep when resolved: https://github.com/Alexays/Waybar/issues/216
on-click-right = "sleep 0.1 && swayscript gamingtoggle";
return-type = "json";
signal = 4;
};
"custom/powersave" = {
exec = "powersave waybar";
on-click = "foot -e bash -c btop";
on-click-right = "powersave toggle";
signal = 5;
};
"custom/powerlimit" = {
exec = "powerlimit waybar";
on-click-right = "powerlimit toggle";
signal = 6;
};
};
}

View file

@ -15,6 +15,7 @@
echo ${toString cfg.onMax} > ${controlFileMax}
fi
pkill -RTMIN+6 waybar
true
}

View file

@ -9,6 +9,7 @@
echo ${cfg.cpu.boost.enableCmd} > ${cfg.cpu.boost.controlFile}
fi
pkill -RTMIN+5 waybar
true
}

View file

@ -11,6 +11,8 @@
else
swaymsg "output \"''${output}\" power on"
fi
pkill -RTMIN+4 waybar
}
_sway_iterate_sockets toggle
}
@ -26,6 +28,8 @@
else
swaymsg "output \"''${output}\" adaptive_sync off"
fi
pkill -RTMIN+4 waybar
}
_sway_iterate_sockets toggle
}