Skip to content

Commit

Permalink
fix: hyprlock fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
erictossell committed Jul 5, 2024
1 parent f28703c commit ad7dc8a
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 73 deletions.
1 change: 0 additions & 1 deletion modules/hyprland/config/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
pkgs,
hyprlandConfig,
home-manager,
username,
Expand Down
57 changes: 1 addition & 56 deletions modules/hyprland/config/desktop.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,61 +13,6 @@
executable = true;
};

".config/hypr/hypridle.conf".text = ''
general {
lock_cmd = pidof hyprlock || hyprlock # avoid starting multiple hyprlock instances.
before_sleep_cmd = loginctl lock-session # lock before suspend.
after_sleep_cmd = hyprctl dispatch dpms on # to avoid having to press a key twice to turn on the display.
}
listener {
timeout = 150 # 2.5min.
on-timeout = brightnessctl -s set 10 # set monitor backlight to minimum, avoid 0 on OLED monitor.
on-resume = brightnessctl -r # monitor backlight restore.
}
# turn off keyboard backlight, comment out this section if you dont have a keyboard backlight.
listener {
timeout = 150 # 2.5min.
on-timeout = brightnessctl -sd rgb:kbd_backlight set 0 # turn off keyboard backlight.
on-resume = brightnessctl -rd rgb:kbd_backlight # turn on keyboard backlight.
}
listener {
timeout = 300 # 5min
on-timeout = loginctl lock-session # lock screen when timeout has passed
}
listener {
timeout = 330 # 5.5min
on-timeout = hyprctl dispatch dpms off # screen off when timeout has passed
on-resume = hyprctl dispatch dpms on # screen on when activity is detected after timeout has fired.
}
listener {
timeout = 1800 # 30min
on-timeout = systemctl suspend # suspend pc
}
'';

".config/hypr/hyprlock.conf".text = ''
background {
monitor =
path = /home/${username}/.config/backgrounds/nyc-macro.png # supports png, jpg, webp (no animations, though)
color = rgba(25, 20, 20, 1.0)
# all these options are taken from hyprland, see https://wiki.hyprland.org/Configuring/Variables/#blur for explanations
blur_passes = 0 # 0 disables blurring
blur_size = 7
noise = 0.0117
contrast = 0.8916
brightness = 0.8172
vibrancy = 0.1696
vibrancy_darkness = 0.0
}
'';

".config/hypr/hyprland.conf".text = ''
monitor=DP-2,preferred,1080x400,1
monitor=HDMI-A-1,preferred,3640x400,1
Expand Down Expand Up @@ -108,7 +53,7 @@
bind = $mainMod, r, exec, wofi --show drun
bind = $mainMod, p, pseudo, # dwindle
bind = $mainMod, j, togglesplit, # dwindle
bind = $mainMod, l, exec, swaylock
bind = $mainMod, l, exec, loginctl lock-session
bind = $mainMod, o, exec, bash -i ~/.config/hypr/toggle_waybar.sh
bind = $mainMod, s, exec, grim -g "$(slurp)" ~/Pictures/Screenshots/$(date +'%Y%m%d_%H%M%S').png
Expand Down
2 changes: 1 addition & 1 deletion modules/hyprland/config/laptop.nix
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
bind = $mainMod, r, exec, wofi --show drun
bind = $mainMod, p, pseudo, # dwindle
bind = $mainMod, j, togglesplit, # dwindle
bind = $mainMod, l, exec, swaylock
bind = $mainMod, l, exec, loginctl lock-session
bind = $mainMod, o, exec, bash -i ~/.config/hypr/toggle_waybar.sh
bind = $mainMod, s, exec, grim -g "$(slurp)" ~/Pictures/Screenshots/$(date +'%Y%m%d_%H%M%S').png
Expand Down
4 changes: 1 addition & 3 deletions modules/hyprland/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@
};

programs.hyprland.enable = true;
programs.hyprlock.enable = true;
programs.dconf.enable = true;

services.hypridle.enable = true;

services.gnome = {
gnome-keyring.enable = true;
};
Expand Down
12 changes: 0 additions & 12 deletions modules/hyprland/hypridle/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,6 @@
on-resume = brightnessctl -r # monitor backlight restore.
}
# turn off keyboard backlight, comment out this section if you dont have a keyboard backlight.
listener {
timeout = 150 # 2.5min.
on-timeout = brightnessctl -sd rgb:kbd_backlight set 0 # turn off keyboard backlight.
on-resume = brightnessctl -rd rgb:kbd_backlight # turn on keyboard backlight.
}
listener {
timeout = 300 # 5min
on-timeout = loginctl lock-session # lock screen when timeout has passed
Expand All @@ -36,11 +29,6 @@
on-timeout = hyprctl dispatch dpms off # screen off when timeout has passed
on-resume = hyprctl dispatch dpms on # screen on when activity is detected after timeout has fired.
}
listener {
timeout = 1800 # 30min
on-timeout = systemctl suspend # suspend pc
}
'';
};
};
Expand Down
1 change: 1 addition & 0 deletions modules/hyprland/hyprlock/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{ username, ... }:
{
programs.hyprlock.enable = true;
home-manager.users.${username} = _: {
home.file = {
".config/hypr/hyprlock.conf".text = ''
Expand Down

0 comments on commit ad7dc8a

Please sign in to comment.