feat: add hypridle and hyprlock, update nixos config

This commit is contained in:
2024-11-29 20:47:59 +05:00
parent 4448991055
commit 4b023c9430
6 changed files with 79 additions and 17 deletions

View File

@@ -0,0 +1,24 @@
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 # 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.
}

View File

@@ -39,7 +39,7 @@ $menu = wofi --show drun
# exec-once = $terminal
# exec-once = nm-applet &
exec-once = waybar
exec-once = waybar & swaync & hypridle
#############################
@@ -203,20 +203,23 @@ device {
$mainMod = SUPER # Sets "Windows" key as main modifier
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
bind = $mainMod, Q, exec, $terminal
bind = $mainMod, return, exec, $terminal
bind = $mainMod, C, killactive,
bind = $mainMod, M, exit,
bind = $mainMod, E, exec, $fileManager
bind = $mainMod, V, togglefloating,
bind = $mainMod, R, exec, $menu
bind = $mainMod, space, exec, $menu
bind = $mainMod, P, pseudo, # dwindle
bind = $mainMod, J, togglesplit, # dwindle
bind = , PRINT, exec, hyprshot -m window
bind = shift, PRINT, exec, hyprshot -m region
bind = $mainMod, L, exec, hyprlock
# Move focus with mainMod + arrow keys
bind = $mainMod, left, movefocus, l
bind = $mainMod, right, movefocus, r
bind = $mainMod, up, movefocus, u
bind = $mainMod, down, movefocus, d
bind = $mainMod, h, movefocus, l
bind = $mainMod, j, movefocus, u
bind = $mainMod, k, movefocus, d
bind = $mainMod, l, movefocus, r
# Switch workspaces with mainMod + [0-9]
bind = $mainMod, 1, workspace, 1

View File

@@ -0,0 +1,37 @@
label {
monitor =
text = Hi there, $USER
color = rgba(200, 200, 200, 1.0)
font_size = 25
font_family = ComicCodeLigatures
position = 0, 80
halign = center
valign = center
}
background {
monitor =
path = screenshot
color = rgba(25, 20, 20, 1.0)
blur_passes = 2
}
input-field {
monitor =
size = 20%, 5%
outline_thickness = 3
inner_color = rgba(0, 0, 0, 0.0) # no fill
outer_color = rgba(33ccffee) rgba(00ff99ee) 45deg
check_color=rgba(00ff99ee) rgba(ff6633ee) 120deg
fail_color=rgba(ff6633ee) rgba(ff0066ee) 40deg
font_color = rgb(143, 143, 143)
fade_on_empty = false
rounding = 15
position = 0, -20
halign = center
valign = center
}

View File

@@ -23,9 +23,7 @@
"temperature",
"backlight",
"keyboard-state",
"sway/language",
"battery",
"battery#bat2",
"clock",
"tray",
"custom/power"
@@ -37,7 +35,7 @@
"warp-on-scroll": false,
"format": "{name}: {icon}",
"format-icons": {
// "1": "",
"1": "",
// "2": "",
// "3": "",
// "4": "",
@@ -104,7 +102,7 @@
"spacing": 10
},
"clock": {
// "timezone": "America/New_York",
"timezone": "Asia/Karachi",
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
"format-alt": "{:%Y-%m-%d}"
},
@@ -130,7 +128,7 @@
},
"battery": {
"states": {
// "good": 95,
"good": 95,
"warning": 30,
"critical": 15
},
@@ -143,9 +141,6 @@
// "format-full": "",
"format-icons": ["", "", "", "", ""]
},
"battery#bat2": {
"bat": "BAT2"
},
"power-profiles-daemon": {
"format": "{icon}",
"tooltip-format": "Power profile: {profile}\nDriver: {driver}",
@@ -158,7 +153,6 @@
}
},
"network": {
// "interface": "wlp2*", // (Optional) To force the use of this interface
"format-wifi": "{essid} ({signalStrength}%) ",
"format-ethernet": "{ipaddr}/{cidr} ",
"tooltip-format": "{ifname} via {gwaddr} ",

View File

@@ -98,6 +98,10 @@ in
dolphin
waybar
font-awesome
swaynotificationcenter
hyprshot
hyprlock
hypridle
(nerdfonts.override { fonts = [ "JetBrainsMono" ]; })
];

View File

@@ -104,7 +104,7 @@
isNormalUser = true;
description = "Shahab Dogar";
extraGroups = [ "networkmanager" "wheel" ];
extraGroups = [ "networkmanager" "wheel" "input" ];
};
# Allow unfree packages