From 8ab6181448ae9eeb69c5e3437aeb0dd561f2cee5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torjus=20H=C3=A5kestad?= Date: Mon, 10 Jun 2024 02:26:51 +0200 Subject: [PATCH] Improve hyprlock stuff --- flake.nix | 1 + home/hyprland/hyprlock_magicman.conf | 2 +- home/scripts/default.nix | 3 +++ home/scripts/lockhelper.nix | 15 +++++++++++++++ home/scripts/lockhelper.sh | 6 ++++++ home/scripts/randomwp.sh | 2 +- 6 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 home/scripts/lockhelper.nix create mode 100644 home/scripts/lockhelper.sh diff --git a/flake.nix b/flake.nix index 88cb5f6..e437f86 100644 --- a/flake.nix +++ b/flake.nix @@ -63,6 +63,7 @@ nixpkgs.overlays = [ overlay-stable ghettoptt.overlays.default + huecli.overlays.default ]; }) ./hosts/magicman diff --git a/home/hyprland/hyprlock_magicman.conf b/home/hyprland/hyprlock_magicman.conf index bad2784..fd5a982 100644 --- a/home/hyprland/hyprlock_magicman.conf +++ b/home/hyprland/hyprlock_magicman.conf @@ -2,7 +2,7 @@ source = ~/.cache/wal/colors-hyprland.conf # BACKGROUND background { monitor = - path = ~/wallpapers/current + path = /tmp/lock.png blur_passes = 3 contrast = 0.8916 brightness = 0.8172 diff --git a/home/scripts/default.nix b/home/scripts/default.nix index c4d0c1b..e9f26c4 100644 --- a/home/scripts/default.nix +++ b/home/scripts/default.nix @@ -1,4 +1,7 @@ { pkgs, config, ... }: { + imports = [ + ./lockhelper.nix + ]; home.file.".local/bin/hl-no-opacity" = { source = ./hl-no-opacity.sh; executable = true; diff --git a/home/scripts/lockhelper.nix b/home/scripts/lockhelper.nix new file mode 100644 index 0000000..3302fda --- /dev/null +++ b/home/scripts/lockhelper.nix @@ -0,0 +1,15 @@ +{ pkgs, ... }: +let + lockhelper = pkgs.writeShellApplication { + name = "lockhelper"; + runtimeInputs = with pkgs; [ + grimblast + ]; + text = (builtins.readFile ./lockhelper.sh); + }; +in +{ + home.packages = [ + lockhelper + ]; +} diff --git a/home/scripts/lockhelper.sh b/home/scripts/lockhelper.sh new file mode 100644 index 0000000..e35f87b --- /dev/null +++ b/home/scripts/lockhelper.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +set -eo pipefail + +grimblast save output /tmp/lock.png || true +hyprlock + diff --git a/home/scripts/randomwp.sh b/home/scripts/randomwp.sh index 276c272..52afe56 100644 --- a/home/scripts/randomwp.sh +++ b/home/scripts/randomwp.sh @@ -40,7 +40,7 @@ if command -v wal &> /dev/null; then fi unlink "$WALLPAPER_DIR/current" || true -ln -s "$wallpaper_path" "$WALLPAPER_DIR/current" +ln -s "$wallpaper_path" "$WALLPAPER_DIR/current.png" for monitor in $(hyprctl monitors | grep 'Monitor' | awk '{ print $2 }'); do hyprctl hyprpaper wallpaper "$monitor,$wallpaper_path"