Incorporate omarchy-nix.
This commit is contained in:
17
home/programs/desktop/hyprland/autostart.nix
Normal file
17
home/programs/desktop/hyprland/autostart.nix
Normal file
@@ -0,0 +1,17 @@
|
||||
# ABOUTME: Hyprland autostart configuration
|
||||
# ABOUTME: Defines programs to run at Hyprland startup
|
||||
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
wayland.windowManager.hyprland.settings = {
|
||||
exec-once = [
|
||||
"hyprsunset"
|
||||
"systemctl --user start hyprpolkitagent"
|
||||
"wl-clip-persist --clipboard regular & clipse -listen"
|
||||
];
|
||||
|
||||
exec = [
|
||||
"pkill -SIGUSR2 waybar || waybar"
|
||||
];
|
||||
};
|
||||
}
|
||||
99
home/programs/desktop/hyprland/bindings.nix
Normal file
99
home/programs/desktop/hyprland/bindings.nix
Normal file
@@ -0,0 +1,99 @@
|
||||
# ABOUTME: Hyprland keybindings configuration
|
||||
# ABOUTME: Defines keyboard and mouse shortcuts for window management
|
||||
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
wayland.windowManager.hyprland.settings = {
|
||||
bind = [
|
||||
# Application launchers
|
||||
"$mod, Space, exec, $menu"
|
||||
"$mod, Return, exec, $terminal"
|
||||
"$mod, E, exec, $fileManager"
|
||||
"$mod, B, exec, $browser"
|
||||
|
||||
# Window management
|
||||
"$mod, W, killactive,"
|
||||
"$mod, BackSpace, killactive,"
|
||||
"$mod, V, togglefloating,"
|
||||
"$mod SHIFT, equal, fullscreen,"
|
||||
"$mod, J, togglesplit,"
|
||||
"$mod, P, pseudo,"
|
||||
|
||||
# Focus navigation
|
||||
"$mod, left, movefocus, l"
|
||||
"$mod, right, movefocus, r"
|
||||
"$mod, up, movefocus, u"
|
||||
"$mod, down, movefocus, d"
|
||||
|
||||
# Workspace switching
|
||||
"$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"
|
||||
|
||||
# Move window to workspace
|
||||
"$mod SHIFT, 1, movetoworkspace, 1"
|
||||
"$mod SHIFT, 2, movetoworkspace, 2"
|
||||
"$mod SHIFT, 3, movetoworkspace, 3"
|
||||
"$mod SHIFT, 4, movetoworkspace, 4"
|
||||
"$mod SHIFT, 5, movetoworkspace, 5"
|
||||
"$mod SHIFT, 6, movetoworkspace, 6"
|
||||
"$mod SHIFT, 7, movetoworkspace, 7"
|
||||
"$mod SHIFT, 8, movetoworkspace, 8"
|
||||
"$mod SHIFT, 9, movetoworkspace, 9"
|
||||
"$mod SHIFT, 0, movetoworkspace, 10"
|
||||
|
||||
# Workspace navigation
|
||||
"$mod, comma, workspace, m-1"
|
||||
"$mod, period, workspace, m+1"
|
||||
|
||||
# Window resize
|
||||
"$mod, minus, splitratio, -0.1"
|
||||
"$mod, equal, splitratio, +0.1"
|
||||
|
||||
# Lock screen
|
||||
"$mod, Escape, exec, loginctl lock-session"
|
||||
|
||||
# Screenshots
|
||||
", Print, exec, hyprshot -m region"
|
||||
"SHIFT, Print, exec, hyprshot -m window"
|
||||
"CTRL, Print, exec, hyprshot -m output"
|
||||
|
||||
# Color picker
|
||||
"$mod SHIFT, C, exec, hyprpicker -a"
|
||||
|
||||
# Clipboard manager
|
||||
"$mod SHIFT, V, exec, ghostty --class=clipse -e clipse"
|
||||
];
|
||||
|
||||
bindm = [
|
||||
# Mouse bindings for window management
|
||||
"$mod, mouse:272, movewindow"
|
||||
"$mod, mouse:273, resizewindow"
|
||||
];
|
||||
|
||||
binde = [
|
||||
# Repeatable bindings for media controls
|
||||
", XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+"
|
||||
", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
|
||||
", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
|
||||
|
||||
# Brightness controls
|
||||
", XF86MonBrightnessUp, exec, brightnessctl s +5%"
|
||||
", XF86MonBrightnessDown, exec, brightnessctl s 5%-"
|
||||
];
|
||||
|
||||
bindl = [
|
||||
# Media player controls
|
||||
", XF86AudioNext, exec, playerctl next"
|
||||
", XF86AudioPrev, exec, playerctl previous"
|
||||
", XF86AudioPlay, exec, playerctl play-pause"
|
||||
];
|
||||
};
|
||||
}
|
||||
39
home/programs/desktop/hyprland/default.nix
Normal file
39
home/programs/desktop/hyprland/default.nix
Normal file
@@ -0,0 +1,39 @@
|
||||
# ABOUTME: Hyprland window manager home-manager configuration
|
||||
# ABOUTME: Imports all hyprland submodules for complete WM setup
|
||||
|
||||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
cfg = import ../config.nix;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./bindings.nix
|
||||
./autostart.nix
|
||||
./input.nix
|
||||
./looknfeel.nix
|
||||
./windows.nix
|
||||
./envs.nix
|
||||
];
|
||||
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
systemd.enable = true;
|
||||
|
||||
settings = {
|
||||
# Monitor configuration
|
||||
monitor = cfg.monitors;
|
||||
|
||||
# Default applications
|
||||
"$terminal" = "ghostty";
|
||||
"$fileManager" = "nautilus";
|
||||
"$browser" = "google-chrome-stable --new-window --ozone-platform=wayland";
|
||||
"$menu" = "wofi --show drun";
|
||||
|
||||
# Mod key
|
||||
"$mod" = "SUPER";
|
||||
};
|
||||
};
|
||||
|
||||
# Hyprland polkit agent for privilege escalation
|
||||
services.hyprpolkitagent.enable = true;
|
||||
}
|
||||
56
home/programs/desktop/hyprland/envs.nix
Normal file
56
home/programs/desktop/hyprland/envs.nix
Normal file
@@ -0,0 +1,56 @@
|
||||
# ABOUTME: Hyprland environment variables configuration
|
||||
# ABOUTME: Sets up Wayland, cursor, and application environment variables
|
||||
|
||||
{ config, lib, pkgs, osConfig ? { }, ... }:
|
||||
let
|
||||
cfg = import ../config.nix;
|
||||
hasNvidiaDrivers = builtins.elem "nvidia" (osConfig.services.xserver.videoDrivers or []);
|
||||
nvidiaEnv = [
|
||||
"NVD_BACKEND,direct"
|
||||
"LIBVA_DRIVER_NAME,nvidia"
|
||||
"__GLX_VENDOR_LIBRARY_NAME,nvidia"
|
||||
];
|
||||
in
|
||||
{
|
||||
wayland.windowManager.hyprland.settings = {
|
||||
env = (lib.optionals hasNvidiaDrivers nvidiaEnv) ++ [
|
||||
"GDK_SCALE,${toString cfg.scale}"
|
||||
|
||||
# Cursor size and theme
|
||||
"XCURSOR_SIZE,24"
|
||||
"HYPRCURSOR_SIZE,24"
|
||||
"XCURSOR_THEME,Adwaita"
|
||||
"HYPRCURSOR_THEME,Adwaita"
|
||||
|
||||
# Force Wayland for applications
|
||||
"GDK_BACKEND,wayland"
|
||||
"QT_QPA_PLATFORM,wayland"
|
||||
"QT_STYLE_OVERRIDE,kvantum"
|
||||
"SDL_VIDEODRIVER,wayland"
|
||||
"MOZ_ENABLE_WAYLAND,1"
|
||||
"ELECTRON_OZONE_PLATFORM_HINT,wayland"
|
||||
"OZONE_PLATFORM,wayland"
|
||||
|
||||
# Chromium Wayland support
|
||||
"CHROMIUM_FLAGS,\"--enable-features=UseOzonePlatform --ozone-platform=wayland --gtk-version=4\""
|
||||
|
||||
# Make .desktop files available for wofi
|
||||
"XDG_DATA_DIRS,$XDG_DATA_DIRS:$HOME/.nix-profile/share:/nix/var/nix/profiles/default/share"
|
||||
|
||||
# XCompose support
|
||||
"XCOMPOSEFILE,~/.XCompose"
|
||||
"EDITOR,nvim"
|
||||
|
||||
# GTK dark theme
|
||||
"GTK_THEME,Adwaita:dark"
|
||||
];
|
||||
|
||||
xwayland = {
|
||||
force_zero_scaling = true;
|
||||
};
|
||||
|
||||
ecosystem = {
|
||||
no_update_news = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
23
home/programs/desktop/hyprland/input.nix
Normal file
23
home/programs/desktop/hyprland/input.nix
Normal file
@@ -0,0 +1,23 @@
|
||||
# ABOUTME: Hyprland input and gesture configuration
|
||||
# ABOUTME: Keyboard layout, mouse settings, and touchpad behavior
|
||||
|
||||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
wayland.windowManager.hyprland.settings = {
|
||||
input = lib.mkDefault {
|
||||
kb_layout = "us";
|
||||
kb_options = "caps:super,compose:ralt";
|
||||
|
||||
follow_mouse = 1;
|
||||
sensitivity = 0;
|
||||
|
||||
touchpad = {
|
||||
natural_scroll = false;
|
||||
};
|
||||
};
|
||||
|
||||
gestures = lib.mkDefault {
|
||||
workspace_swipe = false;
|
||||
};
|
||||
};
|
||||
}
|
||||
89
home/programs/desktop/hyprland/looknfeel.nix
Normal file
89
home/programs/desktop/hyprland/looknfeel.nix
Normal file
@@ -0,0 +1,89 @@
|
||||
# ABOUTME: Hyprland visual appearance configuration
|
||||
# ABOUTME: Window gaps, borders, animations, and decorations with nix-colors theming
|
||||
|
||||
{ config, pkgs, ... }:
|
||||
let
|
||||
palette = config.colorScheme.palette;
|
||||
hexToRgba = hex: alpha: "rgba(${hex}${alpha})";
|
||||
inactiveBorder = hexToRgba palette.base09 "aa";
|
||||
activeBorder = hexToRgba palette.base0D "aa";
|
||||
in
|
||||
{
|
||||
wayland.windowManager.hyprland.settings = {
|
||||
general = {
|
||||
gaps_in = 5;
|
||||
gaps_out = 10;
|
||||
border_size = 2;
|
||||
|
||||
"col.active_border" = activeBorder;
|
||||
"col.inactive_border" = inactiveBorder;
|
||||
|
||||
resize_on_border = false;
|
||||
allow_tearing = false;
|
||||
layout = "dwindle";
|
||||
};
|
||||
|
||||
decoration = {
|
||||
rounding = 4;
|
||||
|
||||
shadow = {
|
||||
enabled = false;
|
||||
range = 30;
|
||||
render_power = 3;
|
||||
ignore_window = true;
|
||||
color = "rgba(00000045)";
|
||||
};
|
||||
|
||||
blur = {
|
||||
enabled = true;
|
||||
size = 5;
|
||||
passes = 2;
|
||||
vibrancy = 0.1696;
|
||||
};
|
||||
};
|
||||
|
||||
animations = {
|
||||
enabled = true;
|
||||
|
||||
bezier = [
|
||||
"easeOutQuint,0.23,1,0.32,1"
|
||||
"easeInOutCubic,0.65,0.05,0.36,1"
|
||||
"linear,0,0,1,1"
|
||||
"almostLinear,0.5,0.5,0.75,1.0"
|
||||
"quick,0.15,0,0.1,1"
|
||||
];
|
||||
|
||||
animation = [
|
||||
"global, 1, 10, default"
|
||||
"border, 1, 5.39, easeOutQuint"
|
||||
"windows, 1, 4.79, easeOutQuint"
|
||||
"windowsIn, 1, 4.1, easeOutQuint, popin 87%"
|
||||
"windowsOut, 1, 1.49, linear, popin 87%"
|
||||
"fadeIn, 1, 1.73, almostLinear"
|
||||
"fadeOut, 1, 1.46, almostLinear"
|
||||
"fade, 1, 3.03, quick"
|
||||
"layers, 1, 3.81, easeOutQuint"
|
||||
"layersIn, 1, 4, easeOutQuint, fade"
|
||||
"layersOut, 1, 1.5, linear, fade"
|
||||
"fadeLayersIn, 1, 1.79, almostLinear"
|
||||
"fadeLayersOut, 1, 1.39, almostLinear"
|
||||
"workspaces, 0, 0, ease"
|
||||
];
|
||||
};
|
||||
|
||||
dwindle = {
|
||||
pseudotile = true;
|
||||
preserve_split = true;
|
||||
force_split = 2;
|
||||
};
|
||||
|
||||
master = {
|
||||
new_status = "master";
|
||||
};
|
||||
|
||||
misc = {
|
||||
disable_hyprland_logo = true;
|
||||
disable_splash_rendering = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
31
home/programs/desktop/hyprland/windows.nix
Normal file
31
home/programs/desktop/hyprland/windows.nix
Normal file
@@ -0,0 +1,31 @@
|
||||
# ABOUTME: Hyprland window rules configuration
|
||||
# ABOUTME: Defines per-application window behavior and layer rules
|
||||
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
wayland.windowManager.hyprland.settings = {
|
||||
windowrule = [
|
||||
"suppressevent maximize, class:.*"
|
||||
"tile, class:^(chromium)$"
|
||||
"float, class:^(org.pulseaudio.pavucontrol|blueberry.py)$"
|
||||
"float, class:^(steam)$"
|
||||
"fullscreen, class:^(com.libretro.RetroArch)$"
|
||||
"opacity 0.97 0.9, class:.*"
|
||||
"opacity 1 1, class:^(chromium|google-chrome|google-chrome-unstable)$, title:.*Youtube.*"
|
||||
"opacity 1 0.97, class:^(chromium|google-chrome|google-chrome-unstable)$"
|
||||
"opacity 0.97 0.9, initialClass:^(chrome-.*-Default)$"
|
||||
"opacity 1 1, initialClass:^(chrome-youtube.*-Default)$"
|
||||
"opacity 1 1, class:^(zoom|vlc|org.kde.kdenlive|com.obsproject.Studio)$"
|
||||
"opacity 1 1, class:^(com.libretro.RetroArch|steam)$"
|
||||
"nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0"
|
||||
"float, class:(clipse)"
|
||||
"size 622 652, class:(clipse)"
|
||||
"stayfocused, class:(clipse)"
|
||||
];
|
||||
|
||||
layerrule = [
|
||||
"blur,wofi"
|
||||
"blur,waybar"
|
||||
];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user