feat(waybar): add a record module to track screen recording

This commit is contained in:
Yorick Barbanneau 2025-09-01 01:20:43 +02:00
parent ed79106342
commit 79d55b304c
Signed by: ephase
GPG key ID: 246042E52B41FFCF
2 changed files with 50 additions and 2 deletions

View file

@ -1,4 +1,4 @@
{lib, config, ...}:
{lib, config, pkgs, ...}:
with lib;
let
cfg = config.modules.desktop.sway;
@ -16,7 +16,9 @@ in
layer = "top";
spacing = 6;
disable-toolptips = true;
modules-center = [];
modules-center = [
"custom/screenrecord"
];
modules-left = [
"sway/workspaces"
"sway/mode"
@ -53,6 +55,7 @@ in
"custom/sep"
"clock"
"custom/sep"
"privacy"
"tray"
];
"clock" = {
@ -73,6 +76,14 @@ in
"format" = "|";
"tooltip" = false;
};
"custom/screenrecord" = {
"format" = " [rec.] ";
"interval" = 1;
"exec" = "echo '{\"class\": \"recording\"}'";
"exec-if" = "${pkgs.procps}/bin/pgrep wl-screenrec";
"on-click" = "exec ${pkgs.coreutils}/bin/kill -s SIGINT $(${pkgs.procps}/bin/pgrep wl-screenrec)";
"tooltype" = false;
};
"idle_inhibitor" = {
"format" = "{icon}";
"format-icons" = {
@ -96,6 +107,29 @@ in
"format-wifi" = "{essid} ({signalStrength}%) ";
"tooltip" = false;
};
"privacy"= {
"icon-spacing" = 4;
"icon-size" = 10;
"transition-duration" = 250;
"modules"= [
{
"type" = "screenshare";
"tooltip" = true;
"tooltip-icon-size" = 16;
}
{
"type" = "audio-out";
"tooltip" = true;
"tooltip-icon-size" = 24;
}
{
"type" = "audio-in";
"tooltip" = true;
"tooltip-icon-size" = 24;
}
];
"ignore-monitor" = true;
};
"pulseaudio#output" = {
"format" = "{volume}% {icon} ";
"format-bluetooth" = "{volume}% {icon}";