From a169ab6ab9765a2b798201a2d7b987673a44e7a8 Mon Sep 17 00:00:00 2001 From: 4Lost Date: Fri, 24 May 2024 11:26:09 +0200 Subject: [PATCH] picard --- home/programs/default.nix | 1 + home/programs/eww/src/eww.yuck | 29 +++++++++++++++++++++++++++-- home/programs/picard/default.nix | 5 +++++ 3 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 home/programs/picard/default.nix diff --git a/home/programs/default.nix b/home/programs/default.nix index 13f093a..496ad97 100644 --- a/home/programs/default.nix +++ b/home/programs/default.nix @@ -15,6 +15,7 @@ ./neovim ./nextcloud ./obs + ./picard ./planify ./prusa-slicer ./pulseaudio diff --git a/home/programs/eww/src/eww.yuck b/home/programs/eww/src/eww.yuck index 87fc94a..dc2c94f 100644 --- a/home/programs/eww/src/eww.yuck +++ b/home/programs/eww/src/eww.yuck @@ -22,10 +22,20 @@ (box :space-evenly "false" :halign "end" + (audio) (nw) (date) )) +;; The Internet Information box. +(defwidget audio [] +(box :class "container" + :space-evenly "false" + :halign "end" + (label :class "iconBat" :text "${volicon} ") + (label :class "text" :text "${vol} % ") + (label :class "text" :text "${micicon} "))) + ;; The Internet Information box. (defwidget nw [] (box :class "container" @@ -46,12 +56,27 @@ ;; Variables -(defpoll nwup +(defpoll volicon + :interval "1s" + :initial "-" ; optional, defaults to poll at startup + `if [[ $(cut -d ' ' -f 2 <<< $(pulseaudio-ctl full-status)) == "yes" ]]; then echo "󰝟"; else echo ""; fi`) + +(defpoll vol + :interval "1s" + :initial "-" ; optional, defaults to poll at startup + `Volume=$(cut -d ' ' -f 1 <<<$(pulseaudio-ctl full-status)); echo "$(( Volume/2 ))"`) + +(defpoll micicon + :interval "1s" + :initial "-" ; optional, defaults to poll at startup + `if [[ $(cut -d ' ' -f 3 <<< $(pulseaudio-ctl full-status)) == "yes" ]]; then echo ""; else echo ""; fi`) + +(defpoll nwup ;; TODO :interval "1s" :initial "-" ; optional, defaults to poll at startup `echo "up"`) -(defpoll nwdown +(defpoll nwdown ; TODO :interval "1s" :initial "-" ; optional, defaults to poll at startup `echo "down"`) diff --git a/home/programs/picard/default.nix b/home/programs/picard/default.nix new file mode 100644 index 0000000..51f2e3b --- /dev/null +++ b/home/programs/picard/default.nix @@ -0,0 +1,5 @@ +{ pkgs, config, ... }: + +{ + home.packages = with pkgs; [ picard ]; +}