system/pkgs/wm/hyprland/hyprland.nix

416 lines
15 KiB
Nix
Raw Normal View History

2024-11-01 12:04:24 -04:00
{ pkgs, config, ... }:
2024-10-14 17:28:31 -04:00
{
wayland.windowManager.hyprland = {
# enable = true;
# package = pkgs.hyprland;
2024-11-01 12:04:24 -04:00
# package = hyprland.packages.stdenv.hostPlatform.system}.hyprland;
2024-10-14 17:28:31 -04:00
# xwayland.enable = true;
2024-11-01 12:04:24 -04:00
systemd.enable = true;
2025-05-03 12:34:07 -04:00
2024-11-01 12:04:24 -04:00
systemd.variables = ["--all"];
2024-10-14 17:28:31 -04:00
# device {
# name = "hanvon-ugee-shortcut-remote key bindings"
# };
settings = {
"$mod" = "SUPER";
2025-05-03 12:34:07 -04:00
2024-10-14 17:28:31 -04:00
env = [
"XDG_SESSION_TYPE,wayland"
"XDG_SESSION_DESKTOP,Hyprland"
"XDG_CURRENT_DESKTOP,Hyprland"
"MOZ_ENABLE_WAYLAND,1"
# "ANKI_WAYLAND,1"
2025-05-03 12:34:07 -04:00
"QT_AUTO_SCREEN_SCALE_FACTOR,1"
"QT_WAYLAND_DISABLE_WINDOWDECORATION,1"
"QT_QPA_PLATFORM=wayland,xcb" # removed ,xcb CGPT
"QT_QPA_PLATFORMTHEME,qt6ct"
"QT_QPA_PLATFORMTHEME,qt5ct"
2024-10-14 17:28:31 -04:00
2025-05-03 12:34:07 -04:00
"GDK_SCALE,1"
2024-11-29 18:31:17 -05:00
"GDK_BACKEND,wayland,x11,*"
2024-10-14 17:28:31 -04:00
2024-11-01 12:04:24 -04:00
# "GTK_THEME,FlatColor:dark"
# "GTK2_RC_FILES,/home/hadi/.local/share/themes/FlatColor/gtk-2.0/gtkrc"
2024-10-14 17:28:31 -04:00
2024-11-01 12:04:24 -04:00
# "DISABLE_QT5_COMPAT,0"
# "NIXOS_OZONE_WL,1"
2025-05-03 12:34:07 -04:00
"OZONE_PLATFORM,wayland"
"ELECTRON_OZONE_PLATFORM_HINT,wayland"
2024-11-01 12:04:24 -04:00
# "__GL_GSYNC_ALLOWED,0"
# "__GL_VRR_ALLOWED,0"
2024-10-14 17:28:31 -04:00
"__GLX_VENDOR_LIBRARY_NAME,nvidia"
2024-11-01 12:04:24 -04:00
# "DIRENV_LOG_FORMAT,"
2024-10-14 17:28:31 -04:00
# "WLR_DRM_NO_ATOMIC,1"
# "WLR_BACKEND,vulkan"
# "WLR_RENDERER,vulkan"
# "WLR_NO_HARDWARE_CURSORS,1"
2024-11-01 12:04:24 -04:00
# "APPIMAGELAUNCHER_DISABLE,1"
# "OZONE_PLATFORM,wayland"
# "SDL_VIDEODRIVER,wayland"
2025-05-03 12:34:07 -04:00
"CLUTTER_BACKEND,wayland"
2024-10-14 17:28:31 -04:00
"GBM_BACKEND,nvidia-drm"
"LIBVA_DRIVER_NAME,nvidia"
# "AQ_DRM_DEVICES,/dev/dri/card2/" # CHANGEME: Related to the GPU
# THEMING
# "HYPRCURSOR_THEME,~/.icons/Nordic-cursors"
# "HYPRCURSOR_SIZE,24x"
2024-11-01 12:04:24 -04:00
"HYPRCURSOR_THEME,Nordzy-cursors"
"HYPRCURSOR_SIZE,24"
"XCURSOR_THEME,Nordzy-cursors"
"XCURSOR_SIZE,24"
2024-10-14 17:28:31 -04:00
"HYPRLAND_TRACE=1"
2024-11-01 12:04:24 -04:00
2025-05-03 12:34:07 -04:00
"QT_STYLE_OVERRIDE=kvantum-dark"
# "QT_QPA_PLATFORMTHEME = qt6ct" # qt5ct no display
2024-10-14 17:28:31 -04:00
];
2025-05-03 12:34:07 -04:00
2024-10-14 17:28:31 -04:00
input = {
kb_layout = "us";
# kb_variant =;
# kb_model =;
# kb_options = grp:alt_shift_toggle,caps:backspace;
# kb_rules =;
follow_mouse = 1;
2024-11-29 18:31:17 -05:00
mouse_refocus = false;
2024-10-14 17:28:31 -04:00
touchpad = {
natural_scroll = "no";
tap_button_map = "lmr";
};
sensitivity = 0;
};
2025-05-03 12:34:07 -04:00
2024-10-14 17:28:31 -04:00
debug = { disable_logs = false; };
2025-05-03 12:34:07 -04:00
xwayland = {
enabled = true;
force_zero_scaling = true;
};
2024-10-14 17:28:31 -04:00
bindm = [
"$mod, mouse:272, movewindow"
2025-05-03 12:34:07 -04:00
# "$mod, Control_L, movewindow"
2024-10-14 17:28:31 -04:00
"$mod, mouse:273, resizewindow"
2025-05-03 12:34:07 -04:00
# "$mod, ALT_L, resizewindow"
2024-10-14 17:28:31 -04:00
];
2025-05-03 12:34:07 -04:00
2024-10-14 17:28:31 -04:00
bind = [
2025-05-03 12:34:07 -04:00
"$mod, mouse_down, workspace, e+1" # Scroll workspaces
"$mod, mouse_up, workspace, e-1" # Scroll workspaces
"$mod, mouse:275, exec, wl-copy $(wl-paste -p)" # copy selected text
"$mod, mouse:276, exec, wtype -M ctrl -M shift v -m ctrl -m shift" # paste by Ctrl+Shift+
2024-10-14 17:28:31 -04:00
"ALTSHIFT, H, movewindow, l"
"ALTSHIFT, L, movewindow, r"
"ALTSHIFT, K, movewindow, u"
"ALTSHIFT, J, movewindow, d"
"ALT,H,movefocus,l"
"ALT,L,movefocus,r"
"ALT,K,movefocus,u"
"ALT,J,movefocus,d"
"$mod, Q, killactive"
"ALT, T, togglefloating"
"ALT, F, fullscreen"
2025-05-03 12:34:07 -04:00
"$mod, Prior, exec, pkill -f kitty --class=kitty-logs || kitty --class='kitty-logs' journalctl -f"
2024-10-14 17:28:31 -04:00
# Minimize window
"ALT, M, movetoworkspace, special:magic"
"ALT, M, togglespecialworkspace, magic"
2025-05-03 12:34:07 -04:00
"Control_R+Shift_R, B, exec, ${config.home.homeDirectory}/bin/restore_minimized.sh Keybase"
"Control_R+Shift_R, X, exec, ${config.home.homeDirectory}/bin/restore_minimized.sh org.kde.kwalletmanager5"
"Control_R+Shift_R, N, exec, ${config.home.homeDirectory}/bin/restore_minimized.sh com.nextcloud.desktopclient.nextcloud"
"Control_R+Shift_R, Z, exec, ${config.home.homeDirectory}/bin/restore_minimized.sh zen-alpha"
"Control_R+Shift_R, S, exec, ${config.home.homeDirectory}/bin/restore_minimized.sh sublime_text"
# "$mod, R, exec, ${config.home.homeDirectory}/bin/restore_minimized.sh org.kde.dolphin"
2024-10-14 17:28:31 -04:00
"$mod, F, exec, firefox"
"$mod, Z, exec, zen"
"$mod, k, exec, kitty"
"$mod, G, exec, ghostty"
2025-05-03 12:34:07 -04:00
"$mod, Home, exec, firefox-developer-edition --new-tab http://webserver/jose/ --devtools"
# "$mod+SHIFT_R, k, exec, pypr toggle term"
"$mod+Shift_R, K, exec, konsole"
2024-10-14 17:28:31 -04:00
"$mod, S, exec, subl"
# "CTRLSHIFT, K&B, exec, hyprctl dispatch exec keybase-gui %u"
# ",XF86Search, exec, wofi --show drun"
2025-04-16 13:59:06 -04:00
",XF86Explorer, exec, dolphin"
2024-10-14 17:28:31 -04:00
",XF86Search, exec, pkill rofi || rofi -show drun -modi drun,filebrowser,run,window,ssh"
",XF86Calculator, exec, qalculate-qt"
2024-11-29 18:31:17 -05:00
"$mod, V, exec, cliphist list | rofi --dmenu | cliphist decode | wl-copy"
2025-04-16 13:59:06 -04:00
"$mod, Tab, exec, ${config.home.homeDirectory}/bin/audio_event_listener.sh"
2024-10-14 17:28:31 -04:00
"ALT, Tab, exec, hyprctl dispatch cyclenext"
"ALTSHIFT, Tab, exec, hyprctl dispatch cyclenext prev"
# "ALT, Tab, bringactivetotop"
# "CONTROL_ALT, L, exec, swaylock" # Need to config locker
", XF86AudioMicMute, exec ,swayosd-client --input-volume mute-toggle"
2025-04-16 13:59:06 -04:00
", XF86AudioMute, exec, swayosd-client --output-volume mute-toggle && wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
", XF86AudioRaiseVolume, exec, swayosd-client --output-volume 10 && wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1+"
", XF86AudioLowerVolume, exec, swayosd-client --output-volume -10 && wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1-"
", XF86AudioPrev, exec, playerctl previous"
", XF86AudioNext, exec, playerctl next"
", XF86AudioPlay, exec, playerctl play-pause"
# "$mod, XF86AudioRaiseVolume, exec, swayosd-client --output-volume raise --max-volume 120 && wpctl set-volume 46 0.1+"
# "$mod, XF86AudioLowerVolume, exec, swayosd-client --output-volume lower --max-volume 120 && wpctl set-volume 46 0.1-"
", Caps_Lock ,exec, swayosd-client --caps-lock"
2024-10-14 17:28:31 -04:00
"$mod, --release Caps_Lock, exec, swayosd-client --caps-lock-led input19::capslock"
"$mod, XF86MonBrightnessUp, exec, swayosd-client --brightness raise"
"$mod, XF86MonBrightnessDown, exec, swayosd-client --brightness lower"
# "$mod, XF86MonBrightnessUp exec swayosd-client --brightness +10"
# "$mod, XF86MonBrightnessDown exec swayosd-client --brightness -10"
"$mod+SHIFT, S, exec, hyprshot -m region"
"$mod, code:10, workspace, 1"
"$mod, code:11, workspace, 2"
"$mod, code:12, workspace, 3"
"$mod, code:13, workspace, 4"
"$mod, code:14, workspace, 5"
"$mod, code:15, workspace, 6"
"$mod, code:16, workspace, 7"
"$mod, code:17, workspace, 8"
"$mod, code:18, workspace, 9"
"$mod, code:19, workspace, 10"
2025-06-16 14:00:25 -04:00
"$mod, code:37, code:87, workspace, 1"
"$mod, code:37, code:88, workspace, 2"
"$mod, code:37, code:89, workspace, 3"
"$mod, code:37, code:83, workspace, 4"
"$mod, code:37, code:84, workspace, 5"
"$mod, code:37, code:85, workspace, 6"
"$mod, code:37, code:79, workspace, 7"
"$mod, code:37, code:80, workspace, 8"
"$mod, code:37, code:81, workspace, 9"
2024-10-14 17:28:31 -04:00
"ALTSHIFT, code:10, movetoworkspace, 1"
"ALTSHIFT, code:11, movetoworkspace, 2"
"ALTSHIFT, code:12, movetoworkspace, 3"
"ALTSHIFT, code:13, movetoworkspace, 4"
"ALTSHIFT, code:14, movetoworkspace, 5"
"ALTSHIFT, code:15, movetoworkspace, 6"
"ALTSHIFT, code:16, movetoworkspace, 7"
"ALTSHIFT, code:17, movetoworkspace, 8"
"ALTSHIFT, code:18, movetoworkspace, 9"
"ALTSHIFT, code:19, movetoworkspace, 10"
2025-06-16 14:00:25 -04:00
# Arrow keys scroll workspaces
"$mod, code:37, code:113, workspace, e+1"
"$mod, code:37, code:114, workspace, e-1"
2024-10-14 17:28:31 -04:00
];
cursor = {
# no_hardware_cursors = true;
2024-11-01 12:04:24 -04:00
default_monitor = "DP-5";
2024-10-14 17:28:31 -04:00
};
2025-05-03 12:34:07 -04:00
2024-10-14 17:28:31 -04:00
dwindle = {
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
pseudotile = true; # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
preserve_split = true; # you probably want this
2024-11-01 12:04:24 -04:00
special_scale_factor = 0.60; # Fix for floaters
2024-10-14 17:28:31 -04:00
};
2025-05-03 12:34:07 -04:00
2024-10-14 17:28:31 -04:00
monitor = [
"DP-3, 1920x1080, 0x616, 1"
2024-11-01 12:04:24 -04:00
"DP-5, 3840x2160, 1920x0, 1"
"DP-6, 1920x1080, 5760x266, 1, transform, 3" # or 3
2024-10-14 17:28:31 -04:00
];
workspace = [
"4,monitor:DP-3,default:true"
"5,monitor:DP-3,persistent:true"
"6,monitor:DP-3,persistent:true"
2024-11-01 12:04:24 -04:00
"1,monitor:DP-5,default:true,decorate:true"
"2,monitor:DP-5,persistent:true"
"3,monitor:DP-5,persistent:true"
"10,monitor:DP-5,persistent:true"
"7,monitor:DP-6,default:true,gapsin:2"
"8,monitor:DP-6,persistent:true"
"9,monitor:DP-6,persistent:true"
2024-10-14 17:28:31 -04:00
];
exec-once = [
"systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP"
"dbus-daemon --session --address=unix:path=$XDG_RUNTIME_DIR/bus"
2025-04-16 13:59:06 -04:00
# "dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP"
"dbus-update-activation-environment --systemd --all"
2024-10-14 17:28:31 -04:00
"systemctl --user start plasma-polkit-agent"
2025-06-19 13:17:25 -04:00
"/nix/store/4ll6r54d0v5lds248nm1nzhgbicja4da-kwallet-pam-6.3.5/libexec/pam_kwallet_init --no-startup-id" # Find a better path, changes on garbage collection
2024-10-14 17:28:31 -04:00
"waybar &"
2024-11-01 12:04:24 -04:00
# "hyprpaper &"
2024-10-14 17:28:31 -04:00
"hypridle &"
"swayosd &"
2025-06-16 14:00:25 -04:00
# "udiskie &"
2025-04-11 18:43:57 -04:00
"blueman-manager && blueman-applet & blueman-applet &"
2024-10-14 17:28:31 -04:00
"wl-paste --type text --watch cliphist store"
"wl-paste --type image --watch cliphist store"
2025-04-11 18:43:57 -04:00
# "${config.home.homeDirectory}/.config/hypr/scripts/start-in-tray.sh &"
2025-06-16 14:00:25 -04:00
"${config.home.homeDirectory}/.config/hypr/scripts/start-keybase-gui.sh &"
"input-remapper-control --command autoload &"
2025-05-03 12:34:07 -04:00
# "/nix/store/yvnjx0qis4qdajc52f4xswhz4g69lcbn-polkit-kde-agent-1-6.2.5/libexec/polkit-kde-authentication-agent-1"
2024-10-14 17:28:31 -04:00
2025-04-11 18:43:57 -04:00
"[workspace 4 silent] remmina --enable-fullscreen -c /home/wayne/.local/share/remmina/group_rdp_xeon_xeon-local.remmina"
# rdp://wayne@xeon.local"
2024-10-14 17:28:31 -04:00
2024-11-01 12:04:24 -04:00
"[workspace 7 silent] sublime3"
2024-12-01 14:11:41 -05:00
"[workspace 9 silent] keepassxc"
2025-04-11 18:43:57 -04:00
"[workspace 9 silent] nextcloud --background"
"[workspace 9 silent] keybase-gui %u"
2024-10-14 17:28:31 -04:00
2024-11-01 12:04:24 -04:00
# "/nix/store/r3fdp5rlxcihmqhpcgy91sj918wnrmrc-pyprland-2.3.4/bin/pypr --debug ~/tmp/pypr.log"
2024-10-14 17:28:31 -04:00
];
general = {
border_part_of_window = true;
layout = "dwindle";
gaps_in = 5;
gaps_out = 10;
border_size = 2;
resize_on_border = true;
};
animations = {
enabled=1;
animation = [
"windows,1,4,default,slide"
"border,1,5,default"
2025-05-03 12:34:07 -04:00
"fadeIn,1,5,default"
"workspaces,1,3,default,slidevert"
2024-10-14 17:28:31 -04:00
];
};
decoration = {
rounding = 8;
blur = {
enabled = true;
size = 5;
passes = 1;
};
2025-05-03 12:34:07 -04:00
shadow = {
enabled = true;
range = 60;
color = "0x66000000";
};
2024-10-14 17:28:31 -04:00
};
layerrule = [
"dimaround,rofi"
# "unset, rofi"
# "ignorezero, rofi"
"blurpopups, notifications"
2024-11-01 12:04:24 -04:00
"blur, waybar"
2024-10-14 17:28:31 -04:00
];
windowrule = [
# "opacity 0.9 override 0.5 override 0.8 override, ^(.*)$" # set opacity to 1.0 active, 0.5 inactive and 0.8 fullscreen for kitty
# "opacity 1 override 0.9 override 0.9 override, ^(zen-alpha)$" # set opacity to 1.0 active, 0.5 inactive and 0.8 fullscreen for kitty
2024-10-14 17:28:31 -04:00
# "opacity 1.0 override 0.5 override 0.8 override, ^(kitty)$" # set opacity to 1.0 active, 0.5 inactive and 0.8 fullscreen for kitty
"move -50% -50%, float, ^(org.keepassxc.KeePassXC)$"
2024-12-06 13:12:42 -05:00
"float, ^(Nextcloud)$"
2024-10-14 17:28:31 -04:00
# common modals
2024-12-06 13:12:42 -05:00
## "center,title:^(Open).*$"
2024-11-01 12:04:24 -04:00
# "center,title:^(Choose Files)$"
2024-12-06 13:12:42 -05:00
## "center,title:^(Save).*$"
2024-11-01 12:04:24 -04:00
# "center,title:^(Confirm to replace files)$"
# "center,title:^(File Operation Progress)$"
# "opacity 1.0 override 1 override 1 override, ^(REAPER)$"
2025-04-16 13:59:06 -04:00
# "float, title:Open Directory"
# "center, title:Open Directory"
# "size 900 500, title:Open Directory"
# "float, vlc"
"center, [vV]lc"
2024-10-14 17:28:31 -04:00
];
windowrulev2 = [
2024-12-06 13:12:42 -05:00
"minsize 1 1, class:^(sublime_text)$"
# REAPER Rules
# Drop down menus are very wonly and require special attention
# They only work in fullscreen but if we initially set fullscreen
# Reaper floats when we select from the toolbar?!!!
# We initially tile the window then fullscreen it to make toolbar menus work
"tile, class:^(REAPER)$"
"monitor DP-5, class:^(REAPER)$"
"workspace 3, class:^(REAPER)$"
# The following 3 lines make Dropdowns work
"float, title:^(menu)$, class:^(REAPER)$" # Important
"minsize 1 1, title:^(menu)$, class:^(REAPER)$" # Important
"move onscreen cursor, title:^(menu)$, class:^(REAPER)$" # Important
# "focusonactivate, class:(REAPER)"
# "allowsinput, class:(REAPER)"
# "focusonactivate, class:(REAPER), title(menu)"
# "stayfocused, title:^(menu)$, class:^(REAPER)$" # Order is important
2024-10-14 17:28:31 -04:00
# "float, class:REAPER"
# "move cursor 5px 15px, class:REAPER"
# Apply stayfocused only to transient (temporary) windows in Reaper
# "stayfocused, title:^(.*)$, class:REAPER"
# "stayfocused, parent:REAPER"
2024-12-06 13:12:42 -05:00
# "noswallow, class:REAPER"
2024-10-14 17:28:31 -04:00
# "stayfocused, title:^(.*)$, class:REAPER"
# "float, title:^(Open|Choose Files|Save As|Confirm to replace files|File Operation Progress)$, class:REAPER"
# "stayfocused, title:^(Open|Choose Files|Save As|Confirm to replace files|File Operation Progress)$, class:REAPER"
# "nofocus, class:REAPER"
# "fullscreen, title:^(File|Edit|View|Options|Help)$, class:REAPER"
2024-11-01 12:04:24 -04:00
# "float,class:^(google-chrome)$,title:^(Open Files)$"
# "float,class:^(google-chrome)$,title:^(Open File)$"
"float,class:^(Typora)$,title:^(Open File)$"
2024-12-06 13:12:42 -05:00
"float,class:^(com.nextcloud.desktopclient.nextcloud)$"
"float,class:^(Keybase)$"
"float,class:^(org.kde.kwalletmanager5)$"
"float,class:^(org.keepassxc.KeePassXC)$"
"float,class:^(Typora)$"
"workspace special:magic, class:^(my-app-class)$"
2025-04-16 13:59:06 -04:00
"float,title:^(VLC media player)$,"
"minsize 900 500,class:^([vV]lc)$"
2024-10-14 17:28:31 -04:00
];
input.numlock_by_default = true;
2025-05-03 12:34:07 -04:00
2024-10-14 17:28:31 -04:00
debug.suppress_errors = true;
2025-05-03 12:34:07 -04:00
# plugin = {
# hyprbars = {
# hyprbars-button = [
# "rgb(ff4040), 10, 󰖭, hyprctl dispatch killactive"
# "rgb(eeee11), 10, , hyprctl dispatch fullscreen 1"
# "rgb(00ff00), 10, 󰍈, hyprctl dispatch togglefloating"
# ];
# bar_height = 20;
# bar_blur = 0.5;
# bar_button_padding = 10;
# icon_on_hover = true;
# };
# hyprwinwrap = {
# class = "kitty-logs";
# # || class = "ff-dev";
# };
# };
};
2024-10-14 17:28:31 -04:00
# extraConfig = {};
2025-05-03 12:34:07 -04:00
# plugins = [
# pkgs.hyprlandPlugins.hyprbars
# pkgs.hyprlandPlugins.hyprwinwrap
# ];
2024-10-14 17:28:31 -04:00
};
}