system/pkgs/wm/hyprland/hyprland.nix

352 lines
13 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;
systemd.variables = ["--all"];
2024-10-14 17:28:31 -04:00
# device {
# name = "hanvon-ugee-shortcut-remote key bindings"
# };
settings = {
"$mod" = "SUPER";
env = [
"XDG_SESSION_TYPE,wayland"
"XDG_SESSION_DESKTOP,Hyprland"
"XDG_CURRENT_DESKTOP,Hyprland"
"MOZ_ENABLE_WAYLAND,1"
# "ANKI_WAYLAND,1"
2024-11-01 12:04:24 -04:00
# "QT_AUTO_SCREEN_SCALE_FACTOR,1"
# "QT_WAYLAND_DISABLE_WINDOWDECORATION,1"
# "QT_QPA_PLATFORM=wayland,xcb" # removed ,xcb CGPT
2024-10-14 17:28:31 -04:00
# "QT_QPA_PLATFORMTHEME,qt6ct"
2024-11-01 12:04:24 -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"
# "ELECTRON_OZONE_PLATFORM_HINT,auto"
# "__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"
# "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
# "QT_STYLE_OVERRIDE=kvantum"
"QT_QPA_PLATFORMTHEME = qt6ct" # qt5ct no display
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;
};
debug = { disable_logs = false; };
xwayland = { force_zero_scaling = true; };
binddevice = "hanvon-ugee-shortcut-remote-keyboard, CTRL+o, exec, hyprctl dispatch key Page_Down";
# hanvon-ugee-shortcut-remote key bindings
# bindl = [
# "DEVICE:hanvon-ugee-shortcut-remote-keyboard, CTRL, o, exec, firefox-pageup"
# "DEVICE:hanvon-ugee-shortcut-remote, , F5, exec, firefox-pagedown"
# ];
# Binding for remapping CTRL+o to PageDown on the remote
bindm = [
"$mod, mouse:272, movewindow"
"$mod, Control_L, movewindow"
"$mod, mouse:273, resizewindow"
"$mod, ALT_L, resizewindow"
"$mod, mouse_down, workspace, e+1" # Scroll workspaces
"$mod, mouse_up, workspace, e-1" # Scroll workspaces
",mouse:275,exec,wl-copy $(wl-paste -p)" # copy selected text
",mouse:276,exec,wtype -M ctrl -M shift v -m ctrl -m shift" # paste by Ctrl+Shift+
];
bind = [
"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"
# Minimize window
"ALT, M, movetoworkspace, special:magic"
"ALT, M, togglespecialworkspace, magic"
"Control_R+Shift_R, B, exec, ~/bin/restore_minimized.sh Keybase"
"Control_R+Shift_R, X, exec, ~/bin/restore_minimized.sh org.kde.kwalletmanager5"
"Control_R+Shift_R, N, exec, ~/bin/restore_minimized.sh com.nextcloud.desktopclient.nextcloud"
"Control_R+Shift_R, Z, exec, ~/bin/restore_minimized.sh zen-alpha"
"Control_R+Shift_R, S, exec, ~/bin/restore_minimized.sh sublime_text"
# "$mod, R, exec, ~/bin/restore_minimized.sh org.kde.dolphin"
"$mod, F, exec, firefox"
"$mod, Z, exec, zen"
"$mod, k, exec, kitty"
2024-11-01 12:04:24 -04:00
"$mod+SHIFT_R, k, exec, pypr toggle term"
2024-10-14 17:28:31 -04:00
"ALTSHIFT, K, exec, konsole"
"$mod, S, exec, subl"
# "CTRLSHIFT, K&B, exec, hyprctl dispatch exec keybase-gui %u"
# ",XF86Search, exec, wofi --show drun"
",XF86Explorer, exec, doublecmd"
",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"
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
", XF86AudioMute, exec, swayosd-client --output-volume mute-toggle"
", XF86AudioMicMute, exec ,swayosd-client --input-volume mute-toggle"
", XF86AudioRaiseVolume, exec, swayosd-client --output-volume 15"
", XF86AudioLowerVolume, exec, swayosd-client --output-volume -15"
"$mod, XF86AudioRaiseVolume, exec, swayosd-client --output-volume raise --max-volume 120"
"$mod, XF86AudioLowerVolume, exec, swayosd-client --output-volume lower --max-volume 120"
"$mod, --release Caps_Lock ,exec, swayosd-client --caps-lock"
"$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"
"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"
];
# ++ (
# builtins.concatLists (builtins.genList (i:
# let ws =i +1;
# in [
# "ALT code:1${toString i}, workspace, ${toString ws}"
# "ALTSHIFT, code:1$i{toString i}, movetoworkspace, ${toString ws}"
# ]
# )
# 9)
# );
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
};
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
};
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"
"dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP"
"systemctl --user start plasma-polkit-agent"
2024-11-01 12:04:24 -04:00
"/nix/store/fj1n850329w79nfvqz22cm36vk4x1ypc-kwallet-pam-6.0.5/libexec/pam_kwallet_init --no-startup-id"
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 &"
"udiskie &"
"wl-paste --type text --watch cliphist store"
"wl-paste --type image --watch cliphist store"
2024-11-01 12:04:24 -04:00
# "${config.home.homeDirectory}/.config/hypr/scripts/start-in-tray.sh"
"${config.home.homeDirectory}/.config/hypr/scripts/start-keybase-gui.sh"
2024-10-14 17:28:31 -04:00
2024-11-01 12:04:24 -04:00
# "[workspace 4 silent] remmina -c 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-11-29 18:31:17 -05:00
"[workspace 9 silentl] keepassxc"
"[workspace 9 silent] /home/wayne/.nix-profile/bin/nextcloud --background"
"[workspace 9 silent] /nix/store/104jb5a21d1d338zkl1f07si6brsmrk2-keybase-gui-6.2.4/bin/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"
"fadein,1,5,default"
"workspaces,1,3,default,vertslide"
];
};
decoration = {
rounding = 8;
drop_shadow = true;
shadow_range = 60;
col.shadow = "0x66000000";
blur = {
enabled = true;
size = 5;
passes = 1;
};
};
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
2024-11-01 12:04:24 -04:00
"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-11-29 18:31:17 -05:00
", float, ^(Nextcloud)$"
2024-10-14 17:28:31 -04:00
# common modals
2024-11-01 12:04:24 -04:00
"center,title:^(Open).*$"
# "center,title:^(Choose Files)$"
"center,title:^(Save).*$"
# "center,title:^(Confirm to replace files)$"
# "center,title:^(File Operation Progress)$"
2024-10-14 17:28:31 -04:00
];
windowrulev2 = [
2024-11-01 12:04:24 -04:00
# "workspace 7,class:dropdown_menu_class"
# "workspace 8,class:dropdown_menu_class"
# "workspace 9,class:dropdown_menu_class"
2024-10-14 17:28:31 -04:00
# "move cursor 5px 15px, class:sublime_text"
"minsize 1 1, class:sublime_text"
# "float, class:REAPER"
# "move cursor 5px 15px, class:REAPER"
"minsize 1 1, class:REAPER"
# "stayfocused, class:REAPER"
# Apply stayfocused only to transient (temporary) windows in Reaper
# "stayfocused, title:^(.*)$, class:REAPER"
# "stayfocused, parent:REAPER"
2024-11-29 18:31:17 -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-10-14 17:28:31 -04:00
"float,class:com.nextcloud.desktopclient.nextcloud"
"float,class:Keybase"
"float,class:org.kde.kwalletmanager5"
"float,class:org.keepassxc.KeePassXC"
2024-11-01 12:04:24 -04:00
"float,class:Typora"
2024-10-14 17:28:31 -04:00
"workspace special:magic, class:^my-app-class$"
];
input.numlock_by_default = true;
debug.suppress_errors = true;
};
# extraConfig = {};
# plugins = [];
};
}