From 6c36a5ec300b26a56adec61417df7baf09433d30 Mon Sep 17 00:00:00 2001 From: Dmitrii Gudov Date: Fri, 19 Dec 2025 07:04:38 +0300 Subject: [PATCH] add some hypr rules, zsh cli, add steam, fix scaling --- home-manager/modules/cursor.nix | 2 +- home-manager/modules/hypr/hypr.nix | 4 +- .../modules/hypr/hyprland/keybinds.nix | 18 +- home-manager/modules/hypr/hyprland/rules.nix | 170 ++---------------- .../modules/hypr/hyprland/rules_old.nix | 167 +++++++++++++++++ home-manager/modules/hypr/hyprlock.nix | 17 +- home-manager/modules/programs.nix | 4 +- home-manager/modules/zsh/zsh.nix | 6 + nixos/configuration.nix | 6 +- nixos/modules/power.nix | 4 +- nixos/modules/programs.nix | 14 +- 11 files changed, 240 insertions(+), 172 deletions(-) create mode 100644 home-manager/modules/hypr/hyprland/rules_old.nix diff --git a/home-manager/modules/cursor.nix b/home-manager/modules/cursor.nix index 4cdcb40..8c8c1e3 100644 --- a/home-manager/modules/cursor.nix +++ b/home-manager/modules/cursor.nix @@ -6,7 +6,7 @@ gtk.enable = true; x11.enable = true; name = name; - size = 48; + size = 32; package = pkgs.runCommand "moveUp" { } '' mkdir -p $out/share/icons ln -s ${ diff --git a/home-manager/modules/hypr/hypr.nix b/home-manager/modules/hypr/hypr.nix index 6c97c97..439d018 100644 --- a/home-manager/modules/hypr/hypr.nix +++ b/home-manager/modules/hypr/hypr.nix @@ -8,9 +8,9 @@ # ./hyprland/env.nix # ./hyprland/execs.nix # ./hyprland/general.nix - # ./hyprland/rules.nix # ./hyprland/colors.nix # ./hyprland/active.nix + ./hyprland/rules.nix ./hyprland/keybinds.nix # done ./hyprlock.nix # done ./hypridle.nix # done @@ -45,6 +45,8 @@ enable = true; plugins = [ pkgs.hyprlandPlugins.hyprexpo ]; settings = { + xwayland = { force_zero_scaling = true; }; + layerrule = [ "noanim, vicinae" "blur,vicinae" "ignorealpha 0, vicinae" ]; env = [ "XCURSOR_SIZE,24" "HYPRCURSOR_SIZE,24" ]; diff --git a/home-manager/modules/hypr/hyprland/keybinds.nix b/home-manager/modules/hypr/hyprland/keybinds.nix index f0277fb..24f2bc8 100644 --- a/home-manager/modules/hypr/hyprland/keybinds.nix +++ b/home-manager/modules/hypr/hyprland/keybinds.nix @@ -1,9 +1,9 @@ { config, pkgs, ... }: # -- Missing -- -# Toggle cheatsheet -# Clipboard history -# Emoji +# Toggle cheatsheet (vicinae) +# Clipboard history (vicinae) +# Emoji (vicinae) # Toggle media controls ? # Change wallpaper # Restart hyprland and plugins @@ -55,7 +55,7 @@ "Ctrl+${super}, Right, workspace, r+1" "Ctrl+${super}, Left, workspace, r-1" - "${super}, L, exec, loginctl lock-session" + # "${super}, L, exec, loginctl lock-session" # '' # ${super}+Shift, D, exec, ~/.config/hypr/scripts/wallpaper/fetch_wallpaper.sh @@ -105,13 +105,20 @@ "${super}+Shift, 9, exec, ~/.config/hypr/scripts/workspace_action.sh movetoworkspacesilent 9" "${super}+Shift, 0, exec, ~/.config/hypr/scripts/workspace_action.sh movetoworkspacesilent 10" "${super}+Shift, S, movetoworkspacesilent, special" - "${super}, S, togglespecialworkspace" + "${super}, S, togglespecialworkspace, special" "RCtrl, 1, togglespecialworkspace, s1" "RCtrl, 2, togglespecialworkspace, s2" "RCtrl, 3, togglespecialworkspace, s3" "RCtrl, 4, togglespecialworkspace, s4" "RCtrl, 5, togglespecialworkspace, s5" + + "${super}+Rctrl, 1, movetoworkspacesilent, special:s1" + "${super}+Rctrl, 2, movetoworkspacesilent, special:s2" + "${super}+Rctrl, 3, movetoworkspacesilent, special:s3" + "${super}+Rctrl, 4, movetoworkspacesilent, special:s4" + "${super}+Rctrl, 5, movetoworkspacesilent, special:s5" + # '' # ${super}+Ctrl, 1, exec, [workspace special term; float; move 15% 15%; size 70% 70%] kitty # '' @@ -122,6 +129,7 @@ # "${super}+Shift, S, Screenshot, exec, hyprshot --freeze --clipboard-only --mode region --silent" ", Print, Screenshot, exec, hyprshot --freeze --clipboard-only --mode region --silent" "${super}+Shift, T, OCR, exec, hyprshot -m region --raw | tesseract stdin stdout" + "${super}, L, Lock screen, exec, hyprlock --immediate-render --no-fade-in" ]; bindm = [ diff --git a/home-manager/modules/hypr/hyprland/rules.nix b/home-manager/modules/hypr/hyprland/rules.nix index fa3821c..025bb16 100644 --- a/home-manager/modules/hypr/hyprland/rules.nix +++ b/home-manager/modules/hypr/hyprland/rules.nix @@ -1,160 +1,26 @@ +{ config, pkgs, ... }: + { wayland.windowManager.hyprland.settings = { - # Window rules windowrule = [ - "opacity 0.97 override 0.85 override 1 override, class:^(firefox|Code|obsidian|zen)$" + "bordercolor rgba(5CCBD180) rgba(6BBF59FF) 225deg, bordersize 2, onworkspace:special:special" + "bordercolor rgba(D1368E30) rgba(2C2C5BFF) 225deg, bordersize 2, onworkspace:special:s1" + "bordercolor rgba(F6BE9A30), bordersize 2, onworkspace:special:s2" + "bordercolor rgba(00464330), bordersize 2, onworkspace:special:s3" + "bordercolor rgba(FAF4D330), bordersize 2, onworkspace:special:s4" + "bordercolor rgba(FF00EA30) rgba(3A86FF80) 225deg, bordersize 2, onworkspace:special:s5" + + "noblur, opacity 1 1, onworkspace:special:s1" + "workspace 1, class:.*zen.*" ]; - windowrulev2 = [ - # Basic rules - "noblur,class:^()$,title:^()$" - "idleinhibit fullscreen, class:^(*)$" - "idleinhibit fullscreen, title:^(*)$" - "idleinhibit fullscreen, fullscreen:1" - - # Floating windows - "float, class:^(blueberry.py)$" - "float, class:^(steam)$" - "float, class:^(guifetch)$" # FlafyDev/guifetch - "float, class:^(pavucontrol)$" - "size 45%, class:^(pavucontrol)$" - "center, class:^(pavucontrol)$" - "float, class:^(org.pulseaudio.pavucontrol)$" - "size 45%, class:^(org.pulseaudio.pavucontrol)$" - "center, class:^(org.pulseaudio.pavucontrol)$" - "float, class:^(nm-connection-editor)$" - "size 45%, class:^(nm-connection-editor)$" - "center, class:^(nm-connection-editor)$" - "float, class:.*plasmawindowed.*" - "float, class:kcm_.*" - "float, class:.*bluedevilwizard" - "float, title:.*Welcome" - "float, title:^(illogical-impulse Settings)$" - "float, class:org.freedesktop.impl.portal.desktop.kde" - "float, class:^(Zotero)$" - "size 45%, class:^(Zotero)$" - - # Move rules - "float, class:^(plasma-changeicons)$" - "noinitialfocus, class:^(plasma-changeicons)$" - "move 999999 999999, class:^(plasma-changeicons)$" - "move 40 80, title:^(Copying — Dolphin)$" - - # Tiling - "tile, class:^dev.warp.Warp$" - - # Picture-in-Picture - "float, title:^([Pp]icture[-s]?[Ii]n[-s]?[Pp]icture)(.*)$" - "keepaspectratio, title:^([Pp]icture[-s]?[Ii]n[-s]?[Pp]icture)(.*)$" - "move 73% 72%, title:^([Pp]icture[-s]?[Ii]n[-s]?[Pp]icture)(.*)$" - "size 25%, title:^([Pp]icture[-s]?[Ii]n[-s]?[Pp]icture)(.*)$" - "pin, title:^([Pp]icture[-s]?[Ii]n[-s]?[Pp]icture)(.*)$" - - # Dialog windows - float+center - "center, title:^(Open File)(.*)$" - "center, title:^(Select a File)(.*)$" - "center, title:^(Choose wallpaper)(.*)$" - "center, title:^(Open Folder)(.*)$" - "center, title:^(Save As)(.*)$" - "center, title:^(Library)(.*)$" - "center, title:^(File Upload)(.*)$" - "center, title:^(.*)(wants to save)$" - "center, title:^(.*)(wants to open)$" - "float, title:^(Open File)(.*)$" - "float, title:^(Select a File)(.*)$" - "float, title:^(Choose wallpaper)(.*)$" - "float, title:^(Open Folder)(.*)$" - "float, title:^(Save As)(.*)$" - "float, title:^(Library)(.*)$" - "float, title:^(File Upload)(.*)$" - "float, title:^(.*)(wants to save)$" - "float, title:^(.*)(wants to open)$" - - # Tearing - "immediate, title:.*.exe" - "immediate, title:.*minecraft.*" - "immediate, class:^(steam_app).*" - - # No shadow for tiled windows - "noshadow, floating:0" - ]; - - # Workspace rules - workspace = [ "special:special, gapsout:30" ]; - - # Layer rules - layerrule = [ - # Basic layer rules - "noanim, walker" - "noanim, selection" - "noanim, overview" - "noanim, anyrun" - "noanim, indicator.*" - "noanim, osk" - "noanim, hyprpicker" - "noanim, noanim" - - # Blur effects - "blur, gtk-layer-shell" - "ignorezero, gtk-layer-shell" - "blur, launcher" - "ignorealpha 0.5, launcher" - "blur, notifications" - "ignorealpha 0.69, notifications" - "blur, logout_dialog" # wlogout - - # AGS rules - "animation slide left, sideleft.*" - "animation slide right, sideright.*" - "blur, session[0-9]*" - "blur, bar[0-9]*" - "ignorealpha 0.6, bar[0-9]*" - "blur, barcorner.*" - "ignorealpha 0.6, barcorner.*" - "blur, dock[0-9]*" - "ignorealpha 0.6, dock[0-9]*" - "blur, indicator.*" - "ignorealpha 0.6, indicator.*" - "blur, overview[0-9]*" - "ignorealpha 0.6, overview[0-9]*" - "blur, cheatsheet[0-9]*" - "ignorealpha 0.6, cheatsheet[0-9]*" - "blur, sideright[0-9]*" - "ignorealpha 0.6, sideright[0-9]*" - "blur, sideleft[0-9]*" - "ignorealpha 0.6, sideleft[0-9]*" - "blur, osk[0-9]*" - "ignorealpha 0.6, osk[0-9]*" - - # Quickshell rules - "blurpopups, quickshell:.*" - "blur, quickshell:.*" - "ignorealpha 0.79, quickshell:.*" - "animation slide top, quickshell:bar" - "animation fade, quickshell:screenCorners" - "animation slide right, quickshell:sidebarRight" - "animation slide left, quickshell:sidebarLeft" - "animation slide bottom, quickshell:osk" - "animation slide bottom, quickshell:dock" - "blur, quickshell:session" - "noanim, quickshell:session" - "ignorealpha 0, quickshell:session" - "animation fade, quickshell:notificationPopup" - "blur, quickshell:backgroundWidgets" - "ignorealpha 0.05, quickshell:backgroundWidgets" - "noanim, quickshell:screenshot" - "animation popin 120%, quickshell:screenCorners" - "noanim, quickshell:lockWindowPusher" - - # Launchers need to be FAST - "noanim, quickshell:overview" - "noanim, gtk4-layer-shell" - - # outfoxxed's stuff - "blur, shell:bar" - "ignorezero, shell:bar" - "blur, shell:notifications" - "ignorealpha 0.1, shell:notifications" + workspace = [ + "special:special,gapsout:50,gapsin:0,on-created-empty:[workspace special silent] spotify" + "special:s1,gapsout:50,gapsin:0,on-created-empty:[workspace s1 silent] kitty" + "special:s2,gapsout:50,gapsin:0" + "special:s3,gapsout:50,gapsin:0" + "special:s4,gapsout:50,gapsin:0" + "special:s5,gapsout:50,gapsin:0,on-created-empty:[workspace s5 silent] Telegram" ]; }; } diff --git a/home-manager/modules/hypr/hyprland/rules_old.nix b/home-manager/modules/hypr/hyprland/rules_old.nix new file mode 100644 index 0000000..8463471 --- /dev/null +++ b/home-manager/modules/hypr/hyprland/rules_old.nix @@ -0,0 +1,167 @@ +{ + wayland.windowManager.hyprland.settings = { + # Window rules + windowrule = [ + "opacity 0.97 override 0.85 override 1 override, class:^(firefox|Code|obsidian|zen)$" + ]; + + windowrulev2 = [ + # Basic rules + "noblur,class:^()$,title:^()$" + "idleinhibit fullscreen, class:^(*)$" + "idleinhibit fullscreen, title:^(*)$" + "idleinhibit fullscreen, fullscreen:1" + + # Floating windows + "float, class:^(blueberry.py)$" + "float, class:^(steam)$" + "float, class:^(guifetch)$" # FlafyDev/guifetch + "float, class:^(pavucontrol)$" + "size 45%, class:^(pavucontrol)$" + "center, class:^(pavucontrol)$" + "float, class:^(org.pulseaudio.pavucontrol)$" + "size 45%, class:^(org.pulseaudio.pavucontrol)$" + "center, class:^(org.pulseaudio.pavucontrol)$" + "float, class:^(nm-connection-editor)$" + "size 45%, class:^(nm-connection-editor)$" + "center, class:^(nm-connection-editor)$" + "float, class:.*plasmawindowed.*" + "float, class:kcm_.*" + "float, class:.*bluedevilwizard" + "float, title:.*Welcome" + "float, title:^(illogical-impulse Settings)$" + "float, class:org.freedesktop.impl.portal.desktop.kde" + "float, class:^(Zotero)$" + "size 45%, class:^(Zotero)$" + + # Move rules + "float, class:^(plasma-changeicons)$" + "noinitialfocus, class:^(plasma-changeicons)$" + "move 999999 999999, class:^(plasma-changeicons)$" + "move 40 80, title:^(Copying — Dolphin)$" + + # Tiling + "tile, class:^dev.warp.Warp$" + + # Picture-in-Picture + "float, title:^([Pp]icture[-s]?[Ii]n[-s]?[Pp]icture)(.*)$" + "keepaspectratio, title:^([Pp]icture[-s]?[Ii]n[-s]?[Pp]icture)(.*)$" + "move 73% 72%, title:^([Pp]icture[-s]?[Ii]n[-s]?[Pp]icture)(.*)$" + "size 25%, title:^([Pp]icture[-s]?[Ii]n[-s]?[Pp]icture)(.*)$" + "pin, title:^([Pp]icture[-s]?[Ii]n[-s]?[Pp]icture)(.*)$" + + # Dialog windows - float+center + "center, title:^(Open File)(.*)$" + "center, title:^(Select a File)(.*)$" + "center, title:^(Choose wallpaper)(.*)$" + "center, title:^(Open Folder)(.*)$" + "center, title:^(Save As)(.*)$" + "center, title:^(Library)(.*)$" + "center, title:^(File Upload)(.*)$" + "center, title:^(.*)(wants to save)$" + "center, title:^(.*)(wants to open)$" + "float, title:^(Open File)(.*)$" + "float, title:^(Select a File)(.*)$" + "float, title:^(Choose wallpaper)(.*)$" + "float, title:^(Open Folder)(.*)$" + "float, title:^(Save As)(.*)$" + "float, title:^(Library)(.*)$" + "float, title:^(File Upload)(.*)$" + "float, title:^(.*)(wants to save)$" + "float, title:^(.*)(wants to open)$" + + # Tearing + "immediate, title:.*.exe" + "immediate, title:.*minecraft.*" + "immediate, class:^(steam_app).*" + + # No shadow for tiled windows + "noshadow, floating:0" + ]; + + # Workspace rules + workspace = [ + "special:special,gapsout:50,gapsin:0,on-created-empty:[workspace special silent] spotify" + "special:s1,gapsout:50,gapsin:0,on-created-empty:[workspace s1 silent] kitty" + "special:s2,gapsout:50,gapsin:0" + "special:s3,gapsout:50,gapsin:0" + "special:s4,gapsout:50,gapsin:0" + "special:s5,gapsout:50,gapsin:0" + ]; + + # Layer rules + layerrule = [ + # Basic layer rules + "noanim, walker" + "noanim, selection" + "noanim, overview" + "noanim, anyrun" + "noanim, indicator.*" + "noanim, osk" + "noanim, hyprpicker" + "noanim, noanim" + + # Blur effects + "blur, gtk-layer-shell" + "ignorezero, gtk-layer-shell" + "blur, launcher" + "ignorealpha 0.5, launcher" + "blur, notifications" + "ignorealpha 0.69, notifications" + "blur, logout_dialog" # wlogout + + # AGS rules + "animation slide left, sideleft.*" + "animation slide right, sideright.*" + "blur, session[0-9]*" + "blur, bar[0-9]*" + "ignorealpha 0.6, bar[0-9]*" + "blur, barcorner.*" + "ignorealpha 0.6, barcorner.*" + "blur, dock[0-9]*" + "ignorealpha 0.6, dock[0-9]*" + "blur, indicator.*" + "ignorealpha 0.6, indicator.*" + "blur, overview[0-9]*" + "ignorealpha 0.6, overview[0-9]*" + "blur, cheatsheet[0-9]*" + "ignorealpha 0.6, cheatsheet[0-9]*" + "blur, sideright[0-9]*" + "ignorealpha 0.6, sideright[0-9]*" + "blur, sideleft[0-9]*" + "ignorealpha 0.6, sideleft[0-9]*" + "blur, osk[0-9]*" + "ignorealpha 0.6, osk[0-9]*" + + # Quickshell rules + "blurpopups, quickshell:.*" + "blur, quickshell:.*" + "ignorealpha 0.79, quickshell:.*" + "animation slide top, quickshell:bar" + "animation fade, quickshell:screenCorners" + "animation slide right, quickshell:sidebarRight" + "animation slide left, quickshell:sidebarLeft" + "animation slide bottom, quickshell:osk" + "animation slide bottom, quickshell:dock" + "blur, quickshell:session" + "noanim, quickshell:session" + "ignorealpha 0, quickshell:session" + "animation fade, quickshell:notificationPopup" + "blur, quickshell:backgroundWidgets" + "ignorealpha 0.05, quickshell:backgroundWidgets" + "noanim, quickshell:screenshot" + "animation popin 120%, quickshell:screenCorners" + "noanim, quickshell:lockWindowPusher" + + # Launchers need to be FAST + "noanim, quickshell:overview" + "noanim, gtk4-layer-shell" + + # outfoxxed's stuff + "blur, shell:bar" + "ignorezero, shell:bar" + "blur, shell:notifications" + "ignorealpha 0.1, shell:notifications" + ]; + }; +} diff --git a/home-manager/modules/hypr/hyprlock.nix b/home-manager/modules/hypr/hyprlock.nix index 3332acb..b31ae00 100644 --- a/home-manager/modules/hypr/hyprlock.nix +++ b/home-manager/modules/hypr/hyprlock.nix @@ -80,6 +80,21 @@ valign = center } + # FP + label { + monitor = + text = cmd[update:1000] echo $FPRINTPROMPT + color = $text_color + font_size = 18 + font_family = $font_family + shadow_passes = 3 + shadow_size = 4 + + position = -30, 30 + halign = right + valign = bottom + } + # Minutes label { monitor = @@ -160,7 +175,7 @@ valign = top } - label { # Status + label { # Status bat monitor = text = cmd[update:5000] ${config.home.homeDirectory}/.config/hypr/scripts/hyprlock-status.sh color = $text_color diff --git a/home-manager/modules/programs.nix b/home-manager/modules/programs.nix index 03739c0..a986765 100644 --- a/home-manager/modules/programs.nix +++ b/home-manager/modules/programs.nix @@ -9,9 +9,7 @@ spotify obsidian nixfmt-classic - # lmstudio plantuml - # amnezia-vpn btop python312 python312Packages.virtualenv @@ -24,6 +22,8 @@ todo pass gtypist + zip + unzip # yubikey-manager-qt # paprefs ]; diff --git a/home-manager/modules/zsh/zsh.nix b/home-manager/modules/zsh/zsh.nix index 2c8e566..317519f 100644 --- a/home-manager/modules/zsh/zsh.nix +++ b/home-manager/modules/zsh/zsh.nix @@ -16,6 +16,11 @@ neofetch yazi zenity + figlet + + bat + ripgrep + entr ]; home.file.".p10k.zsh".source = ./p10k.zsh; @@ -90,6 +95,7 @@ f() { git add -A && git commit -m "$1" && git push; unset -f f; }; f ''; og = ''f() { z github "$@" && code . && exit; unset -f f; }; f''; + wf = ''f() { watch -t -n1 "$@ | figlet -c -t -f doh"; unset -f f; }; f''; cnfg = "cd nixos-config && code . && exit"; x = "select_command"; diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 2cce451..8f49065 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -57,8 +57,10 @@ services.xserver.enable = true; # Enable the GNOME Desktop Environment. - services.xserver.displayManager.gdm.enable = true; - services.xserver.desktopManager.gnome.enable = true; + # services.xserver.displayManager.gdm.enable = true; + # services.xserver.desktopManager.gnome.enable = true; + services.displayManager.gdm.enable = true; + services.desktopManager.gnome.enable = true; # Configure keymap in X11 services.xserver.xkb = { diff --git a/nixos/modules/power.nix b/nixos/modules/power.nix index ad28001..ff3d81e 100644 --- a/nixos/modules/power.nix +++ b/nixos/modules/power.nix @@ -9,11 +9,13 @@ services.system76-scheduler.settings.cfsProfiles.enable = true; # networking.networkmanager.wifi.powersave = true; + boot.kernelParams = [ "usbcore.autosuspend=0" ]; + services.tlp = { enable = true; settings = { # power saving priority CPU_ENERGY_PERF_POLICY_ON_AC = "balance_performance"; - CPU_ENERGY_PERF_POLICY_ON_BAT = "power"; + CPU_ENERGY_PERF_POLICY_ON_BAT = "balance_power"; CPU_ENERGY_PERF_POLICY_ON_SAV = "power"; PLATFORM_PROFILE_ON_AC = "performance"; diff --git a/nixos/modules/programs.nix b/nixos/modules/programs.nix index 28c9630..a8f6fcc 100644 --- a/nixos/modules/programs.nix +++ b/nixos/modules/programs.nix @@ -32,11 +32,11 @@ }; }; - # programs.steam = { - # enable = true; - # remotePlay.openFirewall = - # true; # Open ports in the firewall for Steam Remote Play - # dedicatedServer.openFirewall = - # true; # Open ports in the firewall for Source Dedicated Server - # }; + programs.steam = { + enable = true; + remotePlay.openFirewall = + true; # Open ports in the firewall for Steam Remote Play + dedicatedServer.openFirewall = + true; # Open ports in the firewall for Source Dedicated Server + }; }