Added Hypridle and Hyprlock && switched to UWSM
This commit is contained in:
@@ -3,7 +3,9 @@
|
|||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
./hypridle.nix
|
||||||
./hyprland.nix
|
./hyprland.nix
|
||||||
|
./hyprlock.nix
|
||||||
./keybinds.nix
|
./keybinds.nix
|
||||||
./monitors.nix
|
./monitors.nix
|
||||||
];
|
];
|
||||||
|
|||||||
29
modules/home/hypr/hypridle.nix
Normal file
29
modules/home/hypr/hypridle.nix
Normal 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";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
|
# inputs,
|
||||||
pkgs,
|
pkgs,
|
||||||
config,
|
config,
|
||||||
...
|
...
|
||||||
@@ -8,8 +9,12 @@
|
|||||||
hyprpolkitagent
|
hyprpolkitagent
|
||||||
];
|
];
|
||||||
|
|
||||||
|
xdg.configFile."uwsm/env".source =
|
||||||
|
"${config.home.sessionVariablesPackage}/etc/profile.d/hm-session-vars.sh";
|
||||||
|
|
||||||
wayland.windowManager.hyprland = {
|
wayland.windowManager.hyprland = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
systemd.enable = false;
|
||||||
package = null;
|
package = null;
|
||||||
portalPackage = null;
|
portalPackage = null;
|
||||||
|
|
||||||
@@ -48,14 +53,18 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
exec-once = [
|
exec-once = [
|
||||||
|
"systemctl --user enable --now hypridle.service"
|
||||||
"systemctl --user enable --now hyprpolkitagent.service"
|
"systemctl --user enable --now hyprpolkitagent.service"
|
||||||
|
"systemctl --user enable app-com.mitchellh.ghostty.service"
|
||||||
"wpaperd -d"
|
"wpaperd -d"
|
||||||
"systemctl enable --user app-com.mitchellh.ghostty.service"
|
|
||||||
];
|
];
|
||||||
|
|
||||||
env = [
|
env = [
|
||||||
"NIXOS_OZONE_WL, 1"
|
"NIXOS_OZONE_WL, 1"
|
||||||
"HYPRSHOT_DIR, ${config.xdg.userDirs.extraConfig.XDG_SCREENSHOTS_DIR}"
|
"HYPRSHOT_DIR, ${config.xdg.userDirs.extraConfig.XDG_SCREENSHOTS_DIR}"
|
||||||
|
"XDG_CURRENT_DESKTOP, Hyprland"
|
||||||
|
"XDG_SESSION_TYPE, wayland"
|
||||||
|
"XDG_SESSION_DESKTOP, Hyprland"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
110
modules/home/hypr/hyprlock.nix
Normal file
110
modules/home/hypr/hyprlock.nix
Normal 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";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
label = "logout";
|
label = "logout";
|
||||||
action = "loginctl terminate-user $USER";
|
action = "uwsm stop";
|
||||||
text = "Logout";
|
text = "Logout";
|
||||||
keybind = "e";
|
keybind = "e";
|
||||||
}
|
}
|
||||||
|
|||||||
27
modules/overlays/battery-status.sh
Normal file
27
modules/overlays/battery-status.sh
Normal 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 ""
|
||||||
7
modules/overlays/check-capslock.sh
Normal file
7
modules/overlays/check-capslock.sh
Normal 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
|
||||||
@@ -4,5 +4,16 @@
|
|||||||
{
|
{
|
||||||
nixpkgs.overlays = [
|
nixpkgs.overlays = [
|
||||||
(import ./heybrochecklog.nix)
|
(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;
|
||||||
|
};
|
||||||
|
})
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@@ -14,11 +14,14 @@ in
|
|||||||
programs = {
|
programs = {
|
||||||
hyprland = {
|
hyprland = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
withUWSM = true;
|
||||||
package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland;
|
package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland;
|
||||||
portalPackage =
|
portalPackage =
|
||||||
inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland;
|
inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland;
|
||||||
|
|
||||||
};
|
};
|
||||||
mango.enable = true;
|
mango.enable = true;
|
||||||
|
uwsm.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
@@ -39,6 +42,7 @@ in
|
|||||||
InputMethod = "qtvirtualkeyboard";
|
InputMethod = "qtvirtualkeyboard";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
wayland.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -46,7 +50,7 @@ in
|
|||||||
# displayManager.sddm.enable = true;
|
# displayManager.sddm.enable = true;
|
||||||
# desktopManager.plasma5.enable = true;
|
# desktopManager.plasma5.enable = true;
|
||||||
|
|
||||||
# Enable the System75 Cosmic Desktop Environment
|
# Enable the System76 Cosmic Desktop Environment
|
||||||
# displayManager.cosmic-greeter.enable = true;
|
# displayManager.cosmic-greeter.enable = true;
|
||||||
# desktopManager.cosmic = {
|
# desktopManager.cosmic = {
|
||||||
# enable = true;
|
# enable = true;
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
fontconfig.enable = true;
|
fontconfig.enable = true;
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
nerd-fonts.fira-code
|
nerd-fonts.fira-code
|
||||||
|
rubik
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
xserver = {
|
xserver = {
|
||||||
# Enable the X11 windowing system.
|
# Enable the X11 windowing system.
|
||||||
# You can disable this if you're only using the Wayland session.
|
# You can disable this if you're only using the Wayland session.
|
||||||
enable = true;
|
enable = false;
|
||||||
|
|
||||||
# Configure keymap in X11
|
# Configure keymap in X11
|
||||||
xkb = {
|
xkb = {
|
||||||
|
|||||||
Reference in New Issue
Block a user