From ac51d5d757aa48c94fa82432cd6ea74b4387fbd5 Mon Sep 17 00:00:00 2001 From: Jon Suderman Date: Tue, 23 Jul 2024 05:24:30 -0600 Subject: [PATCH] hyprland scripts --- modules/hyprland/home.nix | 11 ----------- modules/hyprland/programs/waybar/style.css | 2 +- modules/hyprland/{bin => scripts}/hypr-button.sh | 0 .../{bin => scripts}/hypr-cyclefloatingpos.sh | 0 .../hypr-movewindoworgrouporactive.sh | 0 modules/hyprland/{bin => scripts}/hypr-screenshot.sh | 0 modules/hyprland/{bin => scripts}/hypr-supertab.sh | 0 .../{bin => scripts}/hypr-togglefloatingorsplit.sh | 0 .../hypr-togglefullscreenorspecial.sh | 0 .../{bin => scripts}/hypr-togglegrouporkill.sh | 0 .../hypr-togglegrouporlockornavigate.sh | 0 modules/hyprland/{bin => scripts}/rofi-hyprwindow.sh | 0 modules/hyprland/{bin => scripts}/rofi-sinks.sh | 7 +++++-- modules/hyprland/{bin => scripts}/rofi-toggle.sh | 0 modules/hyprland/{bin => scripts}/waybar-groupies.sh | 0 modules/hyprland/settings/scripts.nix | 7 +++++-- 16 files changed, 11 insertions(+), 16 deletions(-) rename modules/hyprland/{bin => scripts}/hypr-button.sh (100%) rename modules/hyprland/{bin => scripts}/hypr-cyclefloatingpos.sh (100%) rename modules/hyprland/{bin => scripts}/hypr-movewindoworgrouporactive.sh (100%) rename modules/hyprland/{bin => scripts}/hypr-screenshot.sh (100%) rename modules/hyprland/{bin => scripts}/hypr-supertab.sh (100%) rename modules/hyprland/{bin => scripts}/hypr-togglefloatingorsplit.sh (100%) rename modules/hyprland/{bin => scripts}/hypr-togglefullscreenorspecial.sh (100%) rename modules/hyprland/{bin => scripts}/hypr-togglegrouporkill.sh (100%) rename modules/hyprland/{bin => scripts}/hypr-togglegrouporlockornavigate.sh (100%) rename modules/hyprland/{bin => scripts}/rofi-hyprwindow.sh (100%) rename modules/hyprland/{bin => scripts}/rofi-sinks.sh (97%) rename modules/hyprland/{bin => scripts}/rofi-toggle.sh (100%) rename modules/hyprland/{bin => scripts}/waybar-groupies.sh (100%) diff --git a/modules/hyprland/home.nix b/modules/hyprland/home.nix index 7e87c406..ff64a51b 100644 --- a/modules/hyprland/home.nix +++ b/modules/hyprland/home.nix @@ -25,17 +25,6 @@ in { hyprland = "Hyprland"; }; - # home.packages = let - # inherit (builtins) attrNames readDir; - # inherit (lib) filterAttrs hasSuffix mkShellScript removeSuffix; - # inputs = with pkgs; [ hyprland jq ]; - # scripts = attrNames (filterAttrs (n: v: v == "regular" && hasSuffix ".sh" n) (readDir ./bin)); - # in map ( name: ( mkShellScript { - # inherit inputs; - # name = removeSuffix ".sh" name; - # text = ./bin/${name}; - # } ) ) scripts; - home.packages = with pkgs; [ nerdfonts ]; # Add target that is enabled by exec-once at the top of the configuration diff --git a/modules/hyprland/programs/waybar/style.css b/modules/hyprland/programs/waybar/style.css index 9d1141f1..d4ba856c 100644 --- a/modules/hyprland/programs/waybar/style.css +++ b/modules/hyprland/programs/waybar/style.css @@ -103,7 +103,7 @@ color: #ffffff; font-size: 16px; transition: all 0.3s; - letter-spacing: 2px; + letter-spacing: 4px; font-size: 17px; font-family: monospace; } diff --git a/modules/hyprland/bin/hypr-button.sh b/modules/hyprland/scripts/hypr-button.sh similarity index 100% rename from modules/hyprland/bin/hypr-button.sh rename to modules/hyprland/scripts/hypr-button.sh diff --git a/modules/hyprland/bin/hypr-cyclefloatingpos.sh b/modules/hyprland/scripts/hypr-cyclefloatingpos.sh similarity index 100% rename from modules/hyprland/bin/hypr-cyclefloatingpos.sh rename to modules/hyprland/scripts/hypr-cyclefloatingpos.sh diff --git a/modules/hyprland/bin/hypr-movewindoworgrouporactive.sh b/modules/hyprland/scripts/hypr-movewindoworgrouporactive.sh similarity index 100% rename from modules/hyprland/bin/hypr-movewindoworgrouporactive.sh rename to modules/hyprland/scripts/hypr-movewindoworgrouporactive.sh diff --git a/modules/hyprland/bin/hypr-screenshot.sh b/modules/hyprland/scripts/hypr-screenshot.sh similarity index 100% rename from modules/hyprland/bin/hypr-screenshot.sh rename to modules/hyprland/scripts/hypr-screenshot.sh diff --git a/modules/hyprland/bin/hypr-supertab.sh b/modules/hyprland/scripts/hypr-supertab.sh similarity index 100% rename from modules/hyprland/bin/hypr-supertab.sh rename to modules/hyprland/scripts/hypr-supertab.sh diff --git a/modules/hyprland/bin/hypr-togglefloatingorsplit.sh b/modules/hyprland/scripts/hypr-togglefloatingorsplit.sh similarity index 100% rename from modules/hyprland/bin/hypr-togglefloatingorsplit.sh rename to modules/hyprland/scripts/hypr-togglefloatingorsplit.sh diff --git a/modules/hyprland/bin/hypr-togglefullscreenorspecial.sh b/modules/hyprland/scripts/hypr-togglefullscreenorspecial.sh similarity index 100% rename from modules/hyprland/bin/hypr-togglefullscreenorspecial.sh rename to modules/hyprland/scripts/hypr-togglefullscreenorspecial.sh diff --git a/modules/hyprland/bin/hypr-togglegrouporkill.sh b/modules/hyprland/scripts/hypr-togglegrouporkill.sh similarity index 100% rename from modules/hyprland/bin/hypr-togglegrouporkill.sh rename to modules/hyprland/scripts/hypr-togglegrouporkill.sh diff --git a/modules/hyprland/bin/hypr-togglegrouporlockornavigate.sh b/modules/hyprland/scripts/hypr-togglegrouporlockornavigate.sh similarity index 100% rename from modules/hyprland/bin/hypr-togglegrouporlockornavigate.sh rename to modules/hyprland/scripts/hypr-togglegrouporlockornavigate.sh diff --git a/modules/hyprland/bin/rofi-hyprwindow.sh b/modules/hyprland/scripts/rofi-hyprwindow.sh similarity index 100% rename from modules/hyprland/bin/rofi-hyprwindow.sh rename to modules/hyprland/scripts/rofi-hyprwindow.sh diff --git a/modules/hyprland/bin/rofi-sinks.sh b/modules/hyprland/scripts/rofi-sinks.sh similarity index 97% rename from modules/hyprland/bin/rofi-sinks.sh rename to modules/hyprland/scripts/rofi-sinks.sh index cc948c0e..7ce27757 100644 --- a/modules/hyprland/bin/rofi-sinks.sh +++ b/modules/hyprland/scripts/rofi-sinks.sh @@ -73,21 +73,24 @@ if [ -z "${1-}" ]; then # extra sinks added to copy of file cat $dir/detected > $dir/appended while read sink; do + # ensure this extra sink wasn't already detected if [[ -z "$(grep $sink $dir/detected)" ]]; then + # Add the sink to the list, formatted nice for rofi - # extra_sink "$sink" >> $dir/appended icon="audio-off" echo -n "$(named_sink $sink)\\0icon\\x1f${icon}\\x1finfo\\x1f${sink}" >> $dir/appended + fi done < $dir/extra # output sinks, filtering any sinks to be hidden - filter=$(sed -z s/.$// $dir/hidden | tr '\n' '|' ) + filter="$(sed -z s/.$// $dir/hidden | tr '\n' '|' )" # if there are no hidden sinks to filter, just output appended if [[ -z "$filter" ]]; then echo -en "$(cat $dir/appended)" + # if there are, filter with grep else echo -en "$(grep -vE "${filter}" $dir/appended)" diff --git a/modules/hyprland/bin/rofi-toggle.sh b/modules/hyprland/scripts/rofi-toggle.sh similarity index 100% rename from modules/hyprland/bin/rofi-toggle.sh rename to modules/hyprland/scripts/rofi-toggle.sh diff --git a/modules/hyprland/bin/waybar-groupies.sh b/modules/hyprland/scripts/waybar-groupies.sh similarity index 100% rename from modules/hyprland/bin/waybar-groupies.sh rename to modules/hyprland/scripts/waybar-groupies.sh diff --git a/modules/hyprland/settings/scripts.nix b/modules/hyprland/settings/scripts.nix index 181ab83b..98b95381 100644 --- a/modules/hyprland/settings/scripts.nix +++ b/modules/hyprland/settings/scripts.nix @@ -5,10 +5,12 @@ inherit (lib) filterAttrs hasSuffix mkIf mkShellScript removeSuffix; inputs = with pkgs; [ + bluez config.programs.rofi.finalPackage coreutils gawk gettext + gnugrep gnused grim hyprland @@ -17,6 +19,7 @@ keyd libnotify procps + pulseaudio slurp socat swappy @@ -25,7 +28,7 @@ scripts = attrNames( filterAttrs ( n: v: v == "regular" && hasSuffix ".sh" n) - ( readDir ../bin ) + ( readDir ../scripts ) ); in { @@ -36,7 +39,7 @@ in { mkShellScript { inherit inputs; name = removeSuffix ".sh" name; - text = ../bin/${name}; + text = ../scripts/${name}; } )) scripts;