Added Hypridle and Hyprlock && switched to UWSM

This commit is contained in:
2025-11-27 15:23:59 -05:00
parent 1f1bd53be9
commit 96fdf27a60
11 changed files with 205 additions and 5 deletions

View File

@@ -3,7 +3,9 @@
}:
{
imports = [
./hypridle.nix
./hyprland.nix
./hyprlock.nix
./keybinds.nix
./monitors.nix
];

View File

@@ -0,0 +1,29 @@
{
...
}:
{
services.hypridle = {
enable = true;
settings = {
general = {
lock_cmd = "pidof hyprlock || hyprlock";
before_sleep_cmd = "loginctl lock-session";
};
listener = [
{
timeout = 300;
on-timeout = "loginctl lock-session";
}
{
timeout = 600;
on-timeout = "hyprctl dispatch dpms off";
on-resume = "hyprctl dispatch dpms on";
}
{
timeout = 1800;
on-timeout = "systemctl suspend || loginctl suspend";
}
];
};
};
}

View File

@@ -1,4 +1,5 @@
{
# inputs,
pkgs,
config,
...
@@ -8,8 +9,12 @@
hyprpolkitagent
];
xdg.configFile."uwsm/env".source =
"${config.home.sessionVariablesPackage}/etc/profile.d/hm-session-vars.sh";
wayland.windowManager.hyprland = {
enable = true;
systemd.enable = false;
package = null;
portalPackage = null;
@@ -48,14 +53,18 @@
];
exec-once = [
"systemctl --user enable --now hypridle.service"
"systemctl --user enable --now hyprpolkitagent.service"
"systemctl --user enable app-com.mitchellh.ghostty.service"
"wpaperd -d"
"systemctl enable --user app-com.mitchellh.ghostty.service"
];
env = [
"NIXOS_OZONE_WL, 1"
"HYPRSHOT_DIR, ${config.xdg.userDirs.extraConfig.XDG_SCREENSHOTS_DIR}"
"XDG_CURRENT_DESKTOP, Hyprland"
"XDG_SESSION_TYPE, wayland"
"XDG_SESSION_DESKTOP, Hyprland"
];
};
};

View File

@@ -0,0 +1,110 @@
{
config,
...
}:
let
primary-monitor = "eDP-1";
text-color = "rgba(${config.lib.stylix.colors.base0F}FF)";
entry-background-color = "rgba(${config.lib.stylix.colors.base0F}11)";
entry-border-color = "rgba(${config.lib.stylix.colors.base0F}55)";
font-family = "Rubik Light";
in
{
programs.hyprlock = {
enable = true;
settings = {
general = {
hide_cursor = true;
grace = 10;
};
background = [
{
path = "${config.xdg.userDirs.extraConfig.XDG_WALLPAPERS_DIR}/sunset_bay.jpg";
blur_passes = 3;
}
];
input-field = [
{
monitor = primary-monitor;
size = "250, 50";
outline_thickness = 2;
dots_size = 0.1;
dots_spacing = 0.3;
outer_color = entry-border-color;
inner_color = entry-background-color;
font_color = text-color;
fade_on_empty = true;
position = "0, 20";
halign = "center";
valign = "center";
}
];
label = [
{
# Caps Lock Warning
monitor = primary-monitor;
text = "cmd[update:250] check-capslock";
color = text-color;
font_size = 13;
font_family = font-family;
position = "0, -25";
halign = "center";
valign = "center";
}
{
# Clock
monitor = primary-monitor;
text = "$TIME";
color = text-color;
font_size = 65;
font_family = font-family;
position = "0, 300";
halign = "center";
valign = "center";
}
{
# Date
monitor = primary-monitor;
text = "cmd[update:5000] date +\"%A, %B %d\"";
color = text-color;
font_size = 17;
font_family = font-family;
position = "0, 240";
halign = "center";
valign = "center";
}
{
# User
monitor = primary-monitor;
text = " $USER";
color = text-color;
outline_thickness = 2;
dots_size = 0.2; # Scale of input-field height, 0.2 - 0.8
dots_spacing = 0.2; # Scale of dots' absolute size, 0.0 - 1.0
dots_center = true;
font_size = 20;
font_family = font-family;
position = "0, 50";
halign = "center";
valign = "bottom";
}
{
# Status
monitor = primary-monitor;
text = "cmd[update:5000] hyprlock-status";
color = text-color;
font_size = 14;
font_family = font-family;
position = "30, -30";
halign = "left";
valign = "top";
}
];
};
};
}

View File

@@ -21,7 +21,7 @@
}
{
label = "logout";
action = "loginctl terminate-user $USER";
action = "uwsm stop";
text = "Logout";
keybind = "e";
}

View File

@@ -0,0 +1,27 @@
############ Variables ############
enable_battery=false
battery_charging=false
####### Check availability ########
for battery in /sys/class/power_supply/*BAT*; do
if [[ -f "$battery/uevent" ]]; then
enable_battery=true
if [[ $(cat /sys/class/power_supply/*/status | head -1) == "Charging" ]]; then
battery_charging=true
fi
break
fi
done
############# Output #############
if [[ $enable_battery == true ]]; then
if [[ $battery_charging == true ]]; then
echo -n "(+) "
fi
echo -n "$(cat /sys/class/power_supply/*/capacity | head -1)"%
if [[ $battery_charging == false ]]; then
echo -n " remaining"
fi
fi
echo ""

View File

@@ -0,0 +1,7 @@
MAIN_KB_CAPS=$(hyprctl devices | grep -B 6 "main: yes" | grep "capsLock" | head -1 | awk '{print $2}')
if [ "$MAIN_KB_CAPS" = "yes" ]; then
echo "Caps Lock active"
else
echo ""
fi

View File

@@ -4,5 +4,16 @@
{
nixpkgs.overlays = [
(import ./heybrochecklog.nix)
(self: super: {
# battery-status = prev.writeShellApplication {
# name = "battery-status";
# text = builtins.readFile ./battery-status.sh;
# };
check-capslock = super.writeShellApplication {
name = "check-capslock";
text = builtins.readFile ./check-capslock.sh;
};
})
];
}
}

View File

@@ -14,11 +14,14 @@ in
programs = {
hyprland = {
enable = true;
withUWSM = true;
package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland;
portalPackage =
inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland;
};
mango.enable = true;
uwsm.enable = true;
};
environment.systemPackages = [
@@ -39,6 +42,7 @@ in
InputMethod = "qtvirtualkeyboard";
};
};
wayland.enable = true;
};
};
@@ -46,7 +50,7 @@ in
# displayManager.sddm.enable = true;
# desktopManager.plasma5.enable = true;
# Enable the System75 Cosmic Desktop Environment
# Enable the System76 Cosmic Desktop Environment
# displayManager.cosmic-greeter.enable = true;
# desktopManager.cosmic = {
# enable = true;

View File

@@ -8,6 +8,7 @@
fontconfig.enable = true;
packages = with pkgs; [
nerd-fonts.fira-code
rubik
];
};
}

View File

@@ -7,7 +7,7 @@
xserver = {
# Enable the X11 windowing system.
# You can disable this if you're only using the Wayland session.
enable = true;
enable = false;
# Configure keymap in X11
xkb = {