From a4815aa56b9386543b41860eab691cf3fad10d72 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 14 Jun 2024 21:12:38 +0100 Subject: [PATCH] added dunst vol script & moved sb scripts to dwm --- home/common/optional/desktop/dwm/default.nix | 8 ++++++- .../{status-bar => dwm/scripts}/sb-cpu-pct.sh | 0 .../{status-bar => dwm/scripts}/sb-mem-pct.sh | 0 .../scripts}/sb-network-status.sh | 0 .../{status-bar => dwm/scripts}/sb-updates.sh | 0 .../{status-bar => dwm/scripts}/sb-volume.sh | 0 .../optional/desktop/status-bar/default.nix | 10 -------- home/common/optional/desktop/x11/default.nix | 18 +++++++++++++++ .../scripts/dunstify-volume-notification.sh | 23 +++++++++++++++++++ home/semita.nix | 17 -------------- 10 files changed, 48 insertions(+), 28 deletions(-) rename home/common/optional/desktop/{status-bar => dwm/scripts}/sb-cpu-pct.sh (100%) rename home/common/optional/desktop/{status-bar => dwm/scripts}/sb-mem-pct.sh (100%) rename home/common/optional/desktop/{status-bar => dwm/scripts}/sb-network-status.sh (100%) rename home/common/optional/desktop/{status-bar => dwm/scripts}/sb-updates.sh (100%) rename home/common/optional/desktop/{status-bar => dwm/scripts}/sb-volume.sh (100%) delete mode 100644 home/common/optional/desktop/status-bar/default.nix create mode 100644 home/common/optional/desktop/x11/scripts/dunstify-volume-notification.sh diff --git a/home/common/optional/desktop/dwm/default.nix b/home/common/optional/desktop/dwm/default.nix index e0f045b..8f130e6 100644 --- a/home/common/optional/desktop/dwm/default.nix +++ b/home/common/optional/desktop/dwm/default.nix @@ -3,12 +3,18 @@ imports = [ ../common - ../status-bar ../x11 ]; home.packages = [ pkgs.dwmblocks + + # Status bar + (pkgs.writeShellScriptBin "sb-cpu-pct" (builtins.readFile ./scripts/sb-cpu-pct.sh)) + (pkgs.writeShellScriptBin "sb-mem-pct" (builtins.readFile ./scripts/sb-mem-pct.sh)) + (pkgs.writeShellScriptBin "sb-volume" (builtins.readFile ./scripts/sb-volume.sh)) + (pkgs.writeShellScriptBin "sb-network-status" (builtins.readFile ./scripts/sb-network-status.sh)) + (pkgs.writeShellScriptBin "sb-updates" (builtins.readFile ./scripts/sb-updates.sh)) ]; # TODO configure x11 to look in .config/x11 diff --git a/home/common/optional/desktop/status-bar/sb-cpu-pct.sh b/home/common/optional/desktop/dwm/scripts/sb-cpu-pct.sh similarity index 100% rename from home/common/optional/desktop/status-bar/sb-cpu-pct.sh rename to home/common/optional/desktop/dwm/scripts/sb-cpu-pct.sh diff --git a/home/common/optional/desktop/status-bar/sb-mem-pct.sh b/home/common/optional/desktop/dwm/scripts/sb-mem-pct.sh similarity index 100% rename from home/common/optional/desktop/status-bar/sb-mem-pct.sh rename to home/common/optional/desktop/dwm/scripts/sb-mem-pct.sh diff --git a/home/common/optional/desktop/status-bar/sb-network-status.sh b/home/common/optional/desktop/dwm/scripts/sb-network-status.sh similarity index 100% rename from home/common/optional/desktop/status-bar/sb-network-status.sh rename to home/common/optional/desktop/dwm/scripts/sb-network-status.sh diff --git a/home/common/optional/desktop/status-bar/sb-updates.sh b/home/common/optional/desktop/dwm/scripts/sb-updates.sh similarity index 100% rename from home/common/optional/desktop/status-bar/sb-updates.sh rename to home/common/optional/desktop/dwm/scripts/sb-updates.sh diff --git a/home/common/optional/desktop/status-bar/sb-volume.sh b/home/common/optional/desktop/dwm/scripts/sb-volume.sh similarity index 100% rename from home/common/optional/desktop/status-bar/sb-volume.sh rename to home/common/optional/desktop/dwm/scripts/sb-volume.sh diff --git a/home/common/optional/desktop/status-bar/default.nix b/home/common/optional/desktop/status-bar/default.nix deleted file mode 100644 index 7e749cc..0000000 --- a/home/common/optional/desktop/status-bar/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ pkgs, ... }: -{ - home.packages = [ - (pkgs.writeShellScriptBin "sb-cpu-pct" (builtins.readFile ./sb-cpu-pct.sh)) - (pkgs.writeShellScriptBin "sb-mem-pct" (builtins.readFile ./sb-mem-pct.sh)) - (pkgs.writeShellScriptBin "sb-volume" (builtins.readFile ./sb-volume.sh)) - (pkgs.writeShellScriptBin "sb-network-status" (builtins.readFile ./sb-network-status.sh)) - (pkgs.writeShellScriptBin "sb-updates" (builtins.readFile ./sb-updates.sh)) - ]; -} diff --git a/home/common/optional/desktop/x11/default.nix b/home/common/optional/desktop/x11/default.nix index 30c936a..8273529 100644 --- a/home/common/optional/desktop/x11/default.nix +++ b/home/common/optional/desktop/x11/default.nix @@ -11,6 +11,8 @@ pkgs.dmenu pkgs.picom pkgs.xclip + + (pkgs.writeShellScriptBin "dunstify-volume-notification" (builtins.readFile ./scripts/dunstify-volume-notification.sh)) ]; home.file.".Xresources" = { @@ -41,4 +43,20 @@ fade-delta = 50; ''; }; + + home.file.".config/sxhkd/sxhkdrc" = { + recursive = true; + text = '' + vsync = true; + backend = "xrender"; + shadow = true; + shadow-radius = 10; + shadow-offset-x = -5; + shadow-offset-y = -5; + fading = true; + fade-in-step = 0.2; + fade-out-step = 0.2; + fade-delta = 50; + ''; + }; } diff --git a/home/common/optional/desktop/x11/scripts/dunstify-volume-notification.sh b/home/common/optional/desktop/x11/scripts/dunstify-volume-notification.sh new file mode 100644 index 0000000..3753329 --- /dev/null +++ b/home/common/optional/desktop/x11/scripts/dunstify-volume-notification.sh @@ -0,0 +1,23 @@ +mute_test=$(pamixer --get-mute) +mic_mute_test=$(pamixer --default-source --get-mute) + +mute="" +if [ "$mute_test" == true ]; + then + mute="(Speakers Muted)" +fi + +if [ "$mic_mute_test" == true ]; + then + mute="(Mic Muted)" +fi + +if [ "$mute_test" == true ] && [ "$mic_mute_test" == true ]; + then + mute="(Speakers Muted & Mic Muted)" +fi + +volume=$(pamixer --get-volume) + +msgTag="volume-notify" +dunstify -a "changeVolume" -u low -i audio-volume-high -h string:x-dunst-stack-tag:$msgTag "Volume" "${volume} ${mute}" -t 2000 diff --git a/home/semita.nix b/home/semita.nix index 100441e..29aa52c 100644 --- a/home/semita.nix +++ b/home/semita.nix @@ -17,21 +17,4 @@ colorScheme = inputs.nix-colors.colorSchemes.kanagawa; - monitors = [ - { - name = "DP-1"; - width = 2560; - height = 1440; - refreshRate = 144; - x = 0; - primary = true; - } - { - name = "DP-2"; - width = 2560; - height = 1440; - refreshRate = 75; - x = 2560; - } - ]; }