From d72efda281a173c3bd9791de4925dbbcc79c346a Mon Sep 17 00:00:00 2001 From: kat witch Date: Sat, 25 Dec 2021 12:22:31 +0000 Subject: [PATCH] users/kat/sway: waybar headset modules --- config/users/kat/sway/waybar/default.nix | 14 ++++++++++++++ config/users/kat/sway/waybar/waybar.sass | 8 ++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/config/users/kat/sway/waybar/default.nix b/config/users/kat/sway/waybar/default.nix index 0674ef94..858a70c2 100644 --- a/config/users/kat/sway/waybar/default.nix +++ b/config/users/kat/sway/waybar/default.nix @@ -27,6 +27,8 @@ modules-right = [ "pulseaudio#icon" "pulseaudio" + "custom/headset-icon" + "custom/headset" "custom/mail-icon" "custom/mail" "custom/cpu-icon" @@ -64,6 +66,18 @@ return-type = "json"; exec = "${pkgs.waybar-gpg}/bin/kat-gpg-status"; }; + "custom/headset-icon" = { + format = ""; + interval = 60; + exec-if = "${pkgs.headsetcontrol}/bin/headsetcontrol -c"; + exec = "echo 'mew'"; + }; + "custom/headset" = { + format = "{}"; + interval = 60; + exec-if = "${pkgs.headsetcontrol}/bin/headsetcontrol -c"; + exec = "${pkgs.headsetcontrol}/bin/headsetcontrol -b | ${pkgs.gnugrep}/bin/grep Battery | ${pkgs.coreutils}/bin/cut -d ' ' -f2"; + }; "custom/konawall" = { format = "{}"; interval = "once"; diff --git a/config/users/kat/sway/waybar/waybar.sass b/config/users/kat/sway/waybar/waybar.sass index fb1f2140..4f7c9366 100644 --- a/config/users/kat/sway/waybar/waybar.sass +++ b/config/users/kat/sway/waybar/waybar.sass @@ -43,7 +43,7 @@ tooltip @extend %extend_1 background: $base0E -#cpu, #memory, #temperature, #pulseaudio, #backlight, #battery, #custom-mail, #clock.arc, #clock.hex, #clock.miku +#cpu, #memory, #temperature, #pulseaudio, #backlight, #battery, #custom-mail, #custom-headset, #clock.arc, #clock.hex, #clock.miku background: $base01 padding: 0 6px margin-right: 4px @@ -51,10 +51,14 @@ tooltip #network, #custom-gpg-status, #custom-konawall, #idle_inhibitor margin: 0 4px -#temperature.icon, #pulseaudio.icon, #battery.icon, #backlight.icon, #custom-cpu-icon, #custom-memory-icon, #custom-mail-icon, #custom-arc-h, #custom-hex-h, #custom-miku-h, #clock.original, #tray +#temperature.icon, #pulseaudio.icon, #battery.icon, #backlight.icon, #custom-cpu-icon, #custom-memory-icon, #custom-mail-icon, #custom-headset-icon, #custom-arc-h, #custom-hex-h, #custom-miku-h, #clock.original, #tray margin-left: 4px margin-right: 0px +#custom-headset-icon + @extend %extend_1 + background: $base06 + #custom-memory-icon @extend %extend_1 background: $base09