home/natto: add hyprlock,hypridle and hyprpaper

also move hyprland.conf -> hyprland.nix

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
2025-09-10 16:39:57 +05:30
parent 5579bf49c3
commit 0bab44bf04
10 changed files with 396 additions and 274 deletions

View File

@@ -1,173 +0,0 @@
monitor=, highrr, auto, 1
input {
kb_layout = us,us
kb_variant = colemak_dh,
kb_model =
kb_options = grp:rctrl_toggle
kb_rules =
follow_mouse = 1
touchpad {
natural_scroll = yes
scroll_factor = 0.4
}
repeat_delay = 300
accel_profile = flat
}
general {
gaps_in = 5
gaps_out = 10
border_size = 2
# home-manager is going to override these
col.active_border = rgba(b4befeee) rgba(f5c2e7ff) 135deg
col.inactive_border = rgba(595959ff)
layout = dwindle
}
decoration {
rounding = 1
inactive_opacity = 0.8
shadow {
enabled = true
}
blur {
enabled = true
size = 8
new_optimizations = true
xray = true
}
}
animations {
enabled = yes
bezier =overshot,0.01, 0.9, 0.1, 1.05
bezier =easeoutexpo,0.16, 1, 0.3, 1
animation = windows, 1, 7, overshot, popin 50%
animation = windowsOut, 1, 7, easeoutexpo, popin 50%
animation = border, 1, 10, default
animation = fade, 1, 7, default
animation = workspaces, 1, 6, overshot
}
cursor {
no_hardware_cursors = true
}
dwindle {
pseudotile = yes
preserve_split = yes
}
gestures {
workspace_swipe = off
}
misc {
disable_hyprland_logo = true
}
$mainMod=SUPER
binde=$mainMod, RETURN, exec, foot
bindr=SUPER, D, exec, pkill tofi || tofi-drun | xargs hyprctl dispatch exec --
bindr=SUPER SHIFT, D, exec, pkill tofi || tofi-run --require-match=false | xargs hyprctl dispatch exec --
$playerctl=playerctl -p 'playerctld,%any'
bind=$mainMod, P, exec, $playerctl play-pause
bind=, XF86AudioPlay, exec, $playerctl play-pause
bind=, XF86AudioNext, exec, $playerctl position 5+
bind=, XF86AudioPrev, exec, $playerctl position 5-
bind=$mainMod, XF86AudioNext, exec, $playerctl next
bind=$mainMod, XF86AudioPrev, exec, $playerctl previous
binde=, XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+
binde=, XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
bind=, XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
binde=, XF86MonBrightnessUp, exec, light -A 5
binde=, XF86MonBrightnessDown, exec, light -U 5
bind=$mainMod SHIFT, F1, exec, setxkbmap us colemak_dh
bind=$mainMod SHIFT, F2, exec, setxkbmap us basic
bind=$mainMod SHIFT, F3, exec, setxkbmap in deva
bind=$mainMod SHIFT, F4, exec, setxkbmap in guru
bind=$mainMod SHIFT, F5, exec, setxkbmap colemak dhz
bind=, PRINT, exec, grimblast --notify copysave screen
bind=SHIFT, PRINT, exec, grimblast --notify copysave area
binde=$mainMod SHIFT, Q, killactive,
bind=$mainMod ALT, f, exit,
bind=$mainMod SHIFT, t, pseudo,
bind=$mainMod, f, fullscreen,
bind=$mainMod, t, togglefloating,
bindm=SUPER, mouse:272, movewindow
bindm=SUPER, mouse:273, resizewindow
bind=$mainMod, left, movefocus, l
bind=$mainMod, h, movefocus, l
bind=$mainMod, right, movefocus, r
bind=$mainMod, l, movefocus, r
bind=$mainMod, up, movefocus, u
bind=$mainMod, k, movefocus, u
bind=$mainMod, down, movefocus, d
bind=$mainMod, j, movefocus, d
binde=$mainMod SHIFT, left, movewindow, l
binde=$mainMod SHIFT, h, movewindow, l
binde=$mainMod SHIFT, right, movewindow, r
binde=$mainMod SHIFT, l, movewindow, r
binde=$mainMod SHIFT, up, movewindow, u
binde=$mainMod SHIFT, k, movewindow, u
binde=$mainMod SHIFT, down, movewindow, d
binde=$mainMod SHIFT, j, movewindow, d
binde=SHIFT ALT, left, resizeactive, -10 0
binde=SHIFT ALT, h, resizeactive, -10 0
binde=SHIFT ALT, right, resizeactive, 10 0
binde=SHIFT ALT, l, resizeactive, 10 0
binde=SHIFT ALT, up, resizeactive, 0 -10
binde=SHIFT ALT, k, resizeactive, 0 -10
binde=SHIFT ALT, down, resizeactive, 0 10
binde=SHIFT ALT, j, resizeactive, 0 10
bind=$mainMod, 1, workspace, 1
bind=$mainMod, 2, workspace, 2
bind=$mainMod, 3, workspace, 3
bind=$mainMod, 4, workspace, 4
bind=$mainMod, 5, workspace, 5
bind=$mainMod, 6, workspace, 6
bind=$mainMod, 7, workspace, 7
bind=$mainMod, 8, workspace, 8
bind=$mainMod, 9, workspace, 9
bind=$mainMod, 0, workspace, 10
bind=$mainMod SHIFT, 1, movetoworkspacesilent, 1
bind=$mainMod SHIFT, 2, movetoworkspacesilent, 2
bind=$mainMod SHIFT, 3, movetoworkspacesilent, 3
bind=$mainMod SHIFT, 4, movetoworkspacesilent, 4
bind=$mainMod SHIFT, 5, movetoworkspacesilent, 5
bind=$mainMod SHIFT, 6, movetoworkspacesilent, 6
bind=$mainMod SHIFT, 7, movetoworkspacesilent, 7
bind=$mainMod SHIFT, 8, movetoworkspacesilent, 8
bind=$mainMod SHIFT, 9, movetoworkspacesilent, 9
bind=$mainMod SHIFT, 0, movetoworkspacesilent, 10
bind=$mainMod SHIFT, comma, focusmonitor, -1
bind=$mainMod SHIFT, period, focusmonitor, +1
bind=CTRL ALT, r, pass, ^(com\.obsproject\.Studio)$
exec-once=eww open bar
exec-once=swaybg -i ~/Wallpapers/current.*

View File

@@ -28,6 +28,9 @@
# when wayland
./wayland.nix
./hyprpaper.nix
./hyprlock.nix
./hypridle.nix
./hyprland.nix
./foot.nix
./tofi.nix

View File

@@ -26,24 +26,23 @@
};
Service =
let
deps =
[
config.programs.eww.package
]
++ lib.optional config.wayland.windowManager.hyprland.enable config.wayland.windowManager.hyprland.package
++ (with pkgs; [
coreutils
bash
jq
less
gawk
socat
playerctl
networkmanager
iwgtk
wireplumber
])
++ lib.optional config.laptop pkgs.light;
deps = [
config.programs.eww.package
]
++ lib.optional config.wayland.windowManager.hyprland.enable config.wayland.windowManager.hyprland.package
++ (with pkgs; [
coreutils
bash
jq
less
gawk
socat
playerctl
networkmanager
iwgtk
wireplumber
])
++ lib.optional config.laptop pkgs.light;
in
{
Type = "simple";

29
home/natto/hypridle.nix Normal file
View File

@@ -0,0 +1,29 @@
{
pkgs,
config,
...
}:
let
lock = "${pkgs.systemd}/bin/loginctl lock-session";
timeout = 300;
in
{
# screen idle
services.hypridle = {
enable = true;
settings = {
general = {
before_sleep_cmd = lock;
lock_cmd = "pgrep hyprlock || ${config.programs.hyprlock.package}/bin/hyprlock";
};
listener = [
{
timeout = timeout;
on-timeout = lock;
}
];
};
};
}

View File

@@ -2,6 +2,7 @@
pkgs,
inputs,
config,
lib,
conf,
...
}:
@@ -10,32 +11,197 @@
windowManager = {
hyprland = {
enable = true;
package = inputs.hyprland.packages.${pkgs.system}.hyprland;
portalPackage = inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland;
xwayland = {
enable = true;
};
extraConfig =
(builtins.readFile ./config/hypr/hyprland.conf)
+ (with config.home.pointerCursor; ''
exec-once=hyprctl setcursor ${name} ${toString size}
'')
+ (with conf.colors.argb { a = "ee"; }; ''
general {
col.active_border = 0x${mauve} 0x${flamingo} 135deg
col.inactive_border = 0x${surface0}
}
'');
settings = {
monitor = ", highrr, auto, 1";
input = {
kb_layout = "us,us";
kb_variant = "colemak_dh";
kb_model = "";
kb_options = "grp:rctrl_toggle";
kb_rules = "";
repeat_delay = 300;
accel_profile = "flat";
follow_mouse = true;
touchpad = {
natural_scroll = true;
scroll_factor = 0.4;
};
};
general = with conf.colors.argb { a = "ee"; }; {
gaps_in = 5;
gaps_out = 10;
border_size = 2;
layout = "dwindle";
"col.active_border" = "0x${mauve} 0x${flamingo} 135deg";
"col.inactive_border" = "0x${surface0}";
};
decoration = {
rounding = 1;
inactive_opacity = 0.8;
shadow = {
enabled = true;
};
blur = {
enabled = true;
size = 8;
new_optimizations = true;
xray = true;
};
};
animations = {
enabled = true;
bezier = [
"overshot,0.01,0.9,0.1,1.05"
"easeoutexpo,0.16,1,0.3,1"
];
animation = [
"windows,1,7,overshot,popin 50%"
"windowsOut,1,7,easeoutexpo,popin 50%"
"border,1,10,default"
"fade,1,7,default"
"workspaces,1,6,overshot"
];
};
cursor = {
no_hardware_cursors = true;
};
dwindle = {
pseudotile = true;
preserve_split = true;
};
misc = {
disable_hyprland_logo = true;
};
"$mod" = "SUPER";
bind =
let
playerctl = "playerctl -p 'playerctld,%any'";
in
[
# Hyprland operations
"$mod ALT, f, exit,"
"$mod SHIFT, t, pseudo,"
"$mod, f, fullscreen,"
"$mod, t, togglefloating,"
"$mod, left, movefocus, l"
"$mod, h, movefocus, l"
"$mod, right, movefocus, r"
"$mod, l, movefocus, r"
"$mod, up, movefocus, u"
"$mod, k, movefocus, u"
"$mod, down, movefocus, d"
"$mod, j, movefocus, d"
"$mod, 1, workspace, 1"
"$mod, 2, workspace, 2"
"$mod, 3, workspace, 3"
"$mod, 4, workspace, 4"
"$mod, 5, workspace, 5"
"$mod, 6, workspace, 6"
"$mod, 7, workspace, 7"
"$mod, 8, workspace, 8"
"$mod, 9, workspace, 9"
"$mod, 0, workspace, 10"
"$mod SHIFT, 1, movetoworkspacesilent, 1"
"$mod SHIFT, 2, movetoworkspacesilent, 2"
"$mod SHIFT, 3, movetoworkspacesilent, 3"
"$mod SHIFT, 4, movetoworkspacesilent, 4"
"$mod SHIFT, 5, movetoworkspacesilent, 5"
"$mod SHIFT, 6, movetoworkspacesilent, 6"
"$mod SHIFT, 7, movetoworkspacesilent, 7"
"$mod SHIFT, 8, movetoworkspacesilent, 8"
"$mod SHIFT, 9, movetoworkspacesilent, 9"
"$mod SHIFT, 0, movetoworkspacesilent, 10"
"$mod SHIFT, comma, focusmonitor, -1"
"$mod SHIFT, period, focusmonitor, +1"
# Launchers
"$mod, RETURN, exec, foot"
"$mod, D, exec, pkill tofi || tofi-drun | xargs hyprctl dispatch exec --"
"$mod SHIFT, D, exec, pkill tofi || tofi-run --require-match=false | xargs hyprctl dispatch exec --"
# Media
", XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"
", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
# Backlight
", XF86MonBrightnessUp, exec, light -A 5"
", XF86MonBrightnessDown, exec, light -U 5"
# XWayland Keymaps
"$mod SHIFT, F1, exec, setxkbmap us colemak_dh"
"$mod SHIFT, F2, exec, setxkbmap us basic"
# Screenshot
", PRINT, exec, grimblast --notify copysave screen"
"SHIFT, PRINT, exec, grimblast --notify copysave area"
# Playerctl
"$mod, P, exec, ${playerctl} play-pause"
", XF86AudioPlay, exec, ${playerctl} play-pause"
", XF86AudioNext, exec, ${playerctl} position 5+"
", XF86AudioPrev, exec, ${playerctl} position 5-"
"$mod, XF86AudioNext, exec, ${playerctl} next"
"$mod, XF86AudioPrev, exec, ${playerctl} previous"
];
binde = [
# Hyprland operations
"$mod SHIFT, Q, killactive,"
"$mod SHIFT, left, movewindow, l"
"$mod SHIFT, h, movewindow, l"
"$mod SHIFT, right, movewindow, r"
"$mod SHIFT, l, movewindow, r"
"$mod SHIFT, up, movewindow, u"
"$mod SHIFT, k, movewindow, u"
"$mod SHIFT, down, movewindow, d"
"$mod SHIFT, j, movewindow, d"
"SHIFT ALT, left, resizeactive, -10 0"
"SHIFT ALT, h, resizeactive, -10 0"
"SHIFT ALT, right, resizeactive, 10 0"
"SHIFT ALT, l, resizeactive, 10 0"
"SHIFT ALT, up, resizeactive, 0 -10"
"SHIFT ALT, k, resizeactive, 0 -10"
"SHIFT ALT, down, resizeactive, 0 10"
"SHIFT ALT, j, resizeactive, 0 10"
];
bindm = [
# Mouse
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"
"$mod ALT, mouse:272, resizewindow"
];
exec-once = [
(with config.home.pointerCursor; "hyprctl setcursor ${name} ${toString size} ")
]
++ (with config.programs; lib.optional eww.enable "${eww.package}/bin/eww open bar");
};
};
};
};
home.packages = with pkgs; [
grim
slurp
inputs.hyprland-contrib.packages.${pkgs.system}.grimblast
wl-clipboard
swayimg
swaybg
];
}

80
home/natto/hyprlock.nix Normal file
View File

@@ -0,0 +1,80 @@
{
config,
pkgs,
conf,
...
}:
{
programs.hyprlock = {
enable = true;
settings = with conf.colors.argb { a = "ee"; }; {
general = {
hide_cursor = false;
};
background = [
{
monitor = "";
path = "screenshot";
blur_passes = 2;
}
];
input-field = [
{
monitor = "";
size = "300, 60";
outline_thickness = 4;
valign = "center";
halign = "center";
font_color = "0x${text}";
outer_color = "0x${mauve}";
inner_color = "0x${surface0}";
check_color = "0x${blue}";
fail_color = "0x${red}";
capslock_color = "0x${yellow}";
fade_on_empty = false;
hide_input = false;
placeholder_text = "Logged in as <b>$USER</b>";
fail_text = "Fail! <b>($ATTEMPTS)</b>";
dots_spacing = 0.2;
dots_center = true;
}
];
label = [
{
monitor = "";
text = "Layout: $LAYOUT";
font_size = 25;
color = "0x${text}";
position = "2%, -2%";
valign = "top";
halign = "left";
}
{
monitor = "";
text = "$TIME";
font_size = 90;
color = "0x${text}";
position = "-2%, 0";
valign = "top";
halign = "right";
}
{
monitor = "";
text = "cmd[update:3600000] date +\"%A, %d %B %Y\"";
font_size = 25;
color = "0x${text}";
position = "-2%, -10%";
valign = "top";
halign = "right";
}
];
};
};
}

18
home/natto/hyprpaper.nix Normal file
View File

@@ -0,0 +1,18 @@
{
config,
...
}:
{
services.hyprpaper = {
enable = true;
settings =
let
wallpaper = "${config.home.homeDirectory}/wallpaper.png";
in
{
preload = [ "${wallpaper}" ];
wallpaper = [ ", ${wallpaper}" ];
};
};
}

View File

@@ -67,7 +67,6 @@ in
home = {
packages = with pkgs; [
spotify
playerctl
mpc_cli
(ncmpcpp.override {
visualizerSupport = true;
@@ -89,4 +88,6 @@ in
path = "${home}/.config/mpdasrc";
symlink = false;
};
services.playerctld.enable = true;
}