summaryrefslogtreecommitdiff
path: root/nixos/modules/colors.nix
diff options
context:
space:
mode:
authorcaley <195605706+cqley@users.noreply.github.com>2026-07-24 16:50:05 +0200
committerGitHub <noreply@github.com>2026-07-24 16:50:05 +0200
commit61e9afb50d6b6bf84a7a6f7c37e2c0ec4732ed37 (patch)
treeca8e2b787e1f1597cd6b6bf5f87ca377d7a2695c /nixos/modules/colors.nix
parent88c4ac11a5a8b8487636bf9b1c3cab0175f4b833 (diff)
Update colors.nix to conditionally handle HDMI-A-1
Modify color script to check for HDMI-A-1 monitor before executing awww commands.
Diffstat (limited to 'nixos/modules/colors.nix')
-rw-r--r--nixos/modules/colors.nix11
1 files changed, 8 insertions, 3 deletions
diff --git a/nixos/modules/colors.nix b/nixos/modules/colors.nix
index 98ce1cc..22759fe 100644
--- a/nixos/modules/colors.nix
+++ b/nixos/modules/colors.nix
@@ -8,9 +8,14 @@ let
colors="$HOME/.colors"
mkdir -p "$colors"
- awww_out=$(${pkgs.awww}/bin/awww img -o HDMI-A-1 "$1" --transition-type grow --transition-duration 1.5 --transition-fps 120 2>&1)
- [ $? -ne 0 ] && echo "colors: awww: $awww_out" >&2
- ${pkgs.awww}/bin/awww clear --outputs DP-1 2>/dev/null
+ if hyprctl monitors 2>/dev/null | ${pkgs.gnugrep}/bin/grep -q "HDMI-A-1"; then
+ awww_out=$(${pkgs.awww}/bin/awww img -o HDMI-A-1 "$1" --transition-type grow --transition-duration 1.5 --transition-fps 120 2>&1)
+ [ $? -ne 0 ] && echo "colors: awww: $awww_out" >&2
+ ${pkgs.awww}/bin/awww clear --outputs DP-1 2>/dev/null
+ else
+ awww_out=$(${pkgs.awww}/bin/awww img "$1" --transition-type grow --transition-duration 1.5 --transition-fps 120 2>&1)
+ [ $? -ne 0 ] && echo "colors: awww: $awww_out" >&2
+ fi
raw=$(${pkgs.imagemagick}/bin/magick "$1" -thumbnail 50x50^ -colors 8 -unique-colors txt:- 2>&1)