Rework lockhelper for gunter
This commit is contained in:
parent
75064a7228
commit
8d419de159
@ -4,6 +4,25 @@
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
lockhelper = pkgs.callPackage ../scripts/lockhelper.nix { };
|
||||
monitorTopDesc = "BNQ G2420HDBL T2B04424SL000";
|
||||
monitorTopName = "desc:${monitorTopDesc}";
|
||||
monitorTopHash = builtins.substring 0 8 (builtins.hashString "sha256" monitorTopDesc);
|
||||
|
||||
monitorLeftDesc = "Samsung Electric Company LS27A600U HNMT502389";
|
||||
monitorLeftName = "desc:${monitorLeftDesc}";
|
||||
monitorLeftHash = builtins.substring 0 8 (builtins.hashString "sha256" monitorLeftDesc);
|
||||
|
||||
monitorCenterDesc = "Acer Technologies XB271HU #ASPVEKfgZ8Dd";
|
||||
monitorCenterName = "desc:${monitorCenterDesc}";
|
||||
monitorCenterHash = builtins.substring 0 8 (builtins.hashString "sha256" monitorCenterDesc);
|
||||
|
||||
monitorRightDesc = "Samsung Electric Company LS27A600U HNMT502390";
|
||||
monitorRightName = "desc:${monitorRightDesc}";
|
||||
monitorRightHash = builtins.substring 0 8 (builtins.hashString "sha256" monitorRightDesc);
|
||||
|
||||
in
|
||||
{
|
||||
options.hyprland.enable = lib.mkEnableOption "Hyprland";
|
||||
config = {
|
||||
@ -32,12 +51,12 @@
|
||||
settings = {
|
||||
general = {
|
||||
lock_cmd = "${pkgs.hyprlock}/bin/hyprlock";
|
||||
before_sleep_cmd = "lockhelper";
|
||||
before_sleep_cmd = "${lockhelper}/bin/lockhelper";
|
||||
ignore_dbus_inhibit = false;
|
||||
};
|
||||
listener = {
|
||||
timeout = 240;
|
||||
on-timeout = "lockhelper";
|
||||
on-timeout = "${lockhelper}/bin/lockhelper";
|
||||
};
|
||||
};
|
||||
};
|
||||
@ -47,8 +66,10 @@
|
||||
settings = {
|
||||
background = [
|
||||
{
|
||||
monitor = "DP-5";
|
||||
path = "/tmp/lockscreen/DP-5.png";
|
||||
monitor = monitorTopName;
|
||||
# path = "/tmp/lockscreen/${monitorTopHash}.png";
|
||||
path = "screenshot";
|
||||
color = "rgba(17, 17, 17, 1.0)";
|
||||
blur_passes = 3;
|
||||
contrast = 0.8916;
|
||||
brightness = 0.8172;
|
||||
@ -56,8 +77,22 @@
|
||||
vibrancy_darkness = 0.0;
|
||||
}
|
||||
{
|
||||
monitor = "DP-6";
|
||||
path = "/tmp/lockscreen/DP-6.png";
|
||||
monitor = monitorLeftName;
|
||||
# path = "/tmp/lockscreen/${monitorLeftHash}.png";
|
||||
path = "screenshot";
|
||||
color = "rgba(17, 17, 17, 1.0)";
|
||||
blur_passes = 3;
|
||||
contrast = 0.8916;
|
||||
brightness = 0.8172;
|
||||
vibrancy = 0.1696;
|
||||
vibrancy_darkness = 0.0;
|
||||
zindex = 1;
|
||||
}
|
||||
{
|
||||
monitor = monitorCenterName;
|
||||
# path = "/tmp/lockscreen/${monitorCenterHash}.png";
|
||||
path = "screenshot";
|
||||
color = "rgba(17, 17, 17, 1.0)";
|
||||
blur_passes = 3;
|
||||
contrast = 0.8916;
|
||||
brightness = 0.8172;
|
||||
@ -65,17 +100,10 @@
|
||||
vibrancy_darkness = 0.0;
|
||||
}
|
||||
{
|
||||
monitor = "DP-7";
|
||||
path = "/tmp/lockscreen/DP-7.png";
|
||||
blur_passes = 3;
|
||||
contrast = 0.8916;
|
||||
brightness = 0.8172;
|
||||
vibrancy = 0.1696;
|
||||
vibrancy_darkness = 0.0;
|
||||
}
|
||||
{
|
||||
monitor = "DP-8";
|
||||
path = "/tmp/lockscreen/DP-8.png";
|
||||
monitor = monitorRightName;
|
||||
# path = "/tmp/lockscreen/${monitorRightHash}.png";
|
||||
path = "screenshot";
|
||||
color = "rgba(17, 17, 17, 1.0)";
|
||||
blur_passes = 3;
|
||||
contrast = 0.8916;
|
||||
brightness = 0.8172;
|
||||
@ -85,9 +113,7 @@
|
||||
];
|
||||
|
||||
general = {
|
||||
no_fade_in = false;
|
||||
grace = 0;
|
||||
disable_loading_bar = true;
|
||||
};
|
||||
|
||||
input-field = [
|
||||
@ -155,10 +181,10 @@
|
||||
"$term" = "kitty";
|
||||
|
||||
# monitors
|
||||
"$mon_top" = "desc:BNQ G2420HDBL T2B04424SL000";
|
||||
"$mon_left" = "desc:Samsung Electric Company LS27A600U HNMT502389";
|
||||
"$mon_center" = "desc:Acer Technologies XB271HU #ASPVEKfgZ8Dd";
|
||||
"$mon_right" = "desc:Samsung Electric Company LS27A600U HNMT502390";
|
||||
"$mon_top" = monitorTopName;
|
||||
"$mon_left" = monitorLeftName;
|
||||
"$mon_center" = monitorCenterName;
|
||||
"$mon_right" = monitorRightName;
|
||||
|
||||
monitor = [
|
||||
"$mon_top,1920x1080@60,2560x0,1" # top T2B04424SL000
|
||||
@ -269,7 +295,7 @@
|
||||
"$mainMod,Return,exec,$term"
|
||||
|
||||
# hyprlock
|
||||
"$shiftMainMod,l,exec,lockhelper"
|
||||
"$shiftMainMod,l,exec,${lockhelper}/bin/lockhelper"
|
||||
|
||||
# rofi
|
||||
"$mainMod,D,exec,rofi-launcher"
|
||||
|
@ -1,7 +1,6 @@
|
||||
{ pkgs, config, ... }:
|
||||
{
|
||||
imports = [
|
||||
./lockhelper.nix
|
||||
./noita-helper.nix
|
||||
];
|
||||
home.file.".local/bin/hl-no-opacity" = {
|
||||
|
@ -1,14 +1,21 @@
|
||||
{ pkgs, ... }:
|
||||
let
|
||||
lockhelper = pkgs.writeShellApplication {
|
||||
{
|
||||
writeShellApplication,
|
||||
grim,
|
||||
jq,
|
||||
gawk,
|
||||
hyprland,
|
||||
hyprlock,
|
||||
procps,
|
||||
}:
|
||||
writeShellApplication {
|
||||
name = "lockhelper";
|
||||
runtimeInputs = with pkgs; [
|
||||
runtimeInputs = [
|
||||
grim
|
||||
jq
|
||||
gawk
|
||||
hyprland
|
||||
hyprlock
|
||||
procps
|
||||
];
|
||||
text = (builtins.readFile ./lockhelper.sh);
|
||||
};
|
||||
in
|
||||
{
|
||||
home.packages = [ lockhelper ];
|
||||
}
|
||||
|
@ -3,11 +3,14 @@ set -eo pipefail
|
||||
|
||||
mkdir -p /tmp/lockscreen || true
|
||||
|
||||
monitors=$(hyprctl monitors -j | jq -r '.[] | select( .name | contains ("DP")) | .name')
|
||||
monitor_lines=$(hyprctl monitors -j | jq -r '.[] | select (.name | contains ("DP")) | [.name, .description]| @tsv')
|
||||
|
||||
while IFS= read -r m; do
|
||||
grim -o "$m" "/tmp/lockscreen/$m.png" || true
|
||||
done <<< "$monitors"
|
||||
name=$(echo "$m" | awk -F $'\t' '{print $1}')
|
||||
sum=$(echo "$m" | awk -F $'\t' '{printf $2}' | sha256sum | awk '{print substr($1,1,8)}')
|
||||
|
||||
grim -o "$name" "/tmp/lockscreen/$sum.png" || true
|
||||
done <<< "$monitor_lines"
|
||||
|
||||
# Only lock if not already running
|
||||
if [ -z "$(pgrep hyprlock)" ]
|
||||
|
Loading…
x
Reference in New Issue
Block a user