From 5951b040240378b89040c35b6fb8fb0c5f4a9a13 Mon Sep 17 00:00:00 2001 From: DACHXY Date: Fri, 3 Jan 2025 16:47:35 +0800 Subject: [PATCH] fix: cursor size inconsistent --- home/config/waybar/config.json | 1 + home/user/gtk.nix | 4 +- home/user/hypr/exec.nix | 10 ++++- home/user/hyprland.nix | 68 ++++++++++++++++++++----------- system/dev/dn-lap/default.nix | 6 ++- system/dev/dn-pre7780/default.nix | 6 ++- system/modules/environment.nix | 1 - system/modules/hyprland.nix | 11 +++-- system/modules/misc.nix | 6 ++- system/modules/programs.nix | 6 ++- system/modules/services.nix | 3 +- 11 files changed, 81 insertions(+), 41 deletions(-) diff --git a/home/config/waybar/config.json b/home/config/waybar/config.json index a627007..7793b40 100644 --- a/home/config/waybar/config.json +++ b/home/config/waybar/config.json @@ -6,6 +6,7 @@ "exclusive": true, "passthrough": false, "position": "top", + "height": 40, "spacing": 3, "fixed-center": true, "ipc": true, diff --git a/home/user/gtk.nix b/home/user/gtk.nix index d579df0..ed78f4c 100644 --- a/home/user/gtk.nix +++ b/home/user/gtk.nix @@ -1,8 +1,8 @@ -{ pkgs, cursor-size, ... }: +{ pkgs, xcursor-size, ... }: let cursorName = "catppuccin-macchiato-lavender-cursors"; themeName = "catppuccin-macchiato-lavender-compact"; - cursorSize = pkgs.lib.strings.toInt cursor-size; + cursorSize = pkgs.lib.strings.toInt xcursor-size; in { gtk = { diff --git a/home/user/hypr/exec.nix b/home/user/hypr/exec.nix index 5b7a0c6..8c7983a 100644 --- a/home/user/hypr/exec.nix +++ b/home/user/hypr/exec.nix @@ -1,4 +1,9 @@ -{ pkgs, lib, inputs, system, terminal }: +{ + pkgs, + terminal, + xcursor-size, + ... +}: let swayncScript = pkgs.pkgs.writeShellScriptBin "swaync-start" '' XDG_CONFIG_HOME="$HOME/.dummy" # Prevent swaync use default gtk theme @@ -10,6 +15,8 @@ let dconf write /org/cinnamon/desktop/applications/terminal/exec "''\'${terminal}''\'" & dconf write /org/cinnamon/desktop/applications/terminal/exec-arg "''\'''\'" & + dconf write /org/gnome/desktop/interface/cursor-size ${xcursor-size} & + uwsm app -- ${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1 & uwsm app -- ${swayncScript}/bin/swaync-start & dbus-update-activation-environment --systemd --all & @@ -24,4 +31,3 @@ let ''; in ''${startupScript}/bin/start'' - diff --git a/home/user/hyprland.nix b/home/user/hyprland.nix index 9ccc464..ab481d5 100644 --- a/home/user/hyprland.nix +++ b/home/user/hyprland.nix @@ -1,14 +1,30 @@ -{ pkgs, lib, inputs, system, cursor-size, ... }: +{ + pkgs, + lib, + inputs, + system, + hyprcursor-size, + xcursor-size, + ... +}: let terminal = "ghostty"; - startScript = import ./hypr/exec.nix { inherit pkgs lib inputs system terminal; }; + startScript = import ./hypr/exec.nix { + inherit + pkgs + lib + inputs + system + terminal + xcursor-size + ; + }; mainMod = "SUPER"; window = import ./hypr/window.nix; windowrule = import ./hypr/windowrule.nix; input = import ./hypr/input.nix; plugins = import ./hypr/plugin.nix; - cursorSize = cursor-size; cursorName = "catppuccin-macchiato-lavender-cursors"; in { @@ -27,27 +43,33 @@ in systemd.enable = false; package = inputs.hyprland.packages.${system}.hyprland; - plugins = (with inputs.hyprland-plugins.packages.${system}; [ - xtra-dispatchers - hyprexpo - hyprwinwrap - ]) ++ ([ - inputs.hyprgrass.packages.${system}.default - ]); + plugins = + (with inputs.hyprland-plugins.packages.${system}; [ + xtra-dispatchers + hyprexpo + hyprwinwrap + ]) + ++ ([ + inputs.hyprgrass.packages.${system}.default + ]); - settings = { - bind = import ./hypr/bind.nix { inherit mainMod; }; - bindm = import ./hypr/bindm.nix { inherit mainMod; }; - monitor = import ./hypr/monitor.nix; - plugin = plugins; - exec-once = ''${startScript}''; - env = [ - ''HYPRCURSOR_THEME, ${cursorName}'' - ''HYPRCURSOR_SIZE, ${cursorSize}'' - ''XCURSOR_THEME, ${cursorName}'' - ''XCURSOR_SIZE, ${cursorSize}'' - ]; - } // window // windowrule // input; + settings = + { + bind = import ./hypr/bind.nix { inherit mainMod; }; + bindm = import ./hypr/bindm.nix { inherit mainMod; }; + monitor = import ./hypr/monitor.nix; + plugin = plugins; + exec-once = ''${startScript}''; + env = [ + ''HYPRCURSOR_THEME, ${cursorName}'' + ''HYPRCURSOR_SIZE, ${hyprcursor-size}'' + ''XCURSOR_THEME, ${cursorName}'' + ''XCURSOR_SIZE, ${xcursor-size}'' + ]; + } + // window + // windowrule + // input; }; services.hyprpaper = { diff --git a/system/dev/dn-lap/default.nix b/system/dev/dn-lap/default.nix index fd532b5..b848c51 100644 --- a/system/dev/dn-lap/default.nix +++ b/system/dev/dn-lap/default.nix @@ -9,7 +9,8 @@ }: let - cursor-size = "24"; + hyprcursor-size = "32"; + xcursor-size = "24"; in { imports = [ @@ -32,7 +33,8 @@ in inputs system nix-version - cursor-size + xcursor-size + hyprcursor-size git-config username ; diff --git a/system/dev/dn-pre7780/default.nix b/system/dev/dn-pre7780/default.nix index a63093a..22e9ec3 100644 --- a/system/dev/dn-pre7780/default.nix +++ b/system/dev/dn-pre7780/default.nix @@ -9,7 +9,8 @@ }: let - cursor-size = "32"; + hyprcursor-size = "32"; + xcursor-size = "24"; in { imports = [ @@ -36,7 +37,8 @@ in inputs system nix-version - cursor-size + xcursor-size + hyprcursor-size git-config username ; diff --git a/system/modules/environment.nix b/system/modules/environment.nix index 8c8228d..d4140bc 100644 --- a/system/modules/environment.nix +++ b/system/modules/environment.nix @@ -16,6 +16,5 @@ in environment.variables = { ELECTRON_OZONE_PLATFORM_HINT = "auto"; GSETTINGS_SCHEMA_DIR = "${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}/glib-2.0/schemas"; - HYPERCURSOR_SIZE = 24; }; } diff --git a/system/modules/hyprland.nix b/system/modules/hyprland.nix index f754a6c..2d6e6bb 100644 --- a/system/modules/hyprland.nix +++ b/system/modules/hyprland.nix @@ -12,7 +12,10 @@ enable = true; wlr.enable = true; xdgOpenUsePortal = true; - extraPortals = [ pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-wlr ]; + extraPortals = [ + pkgs.xdg-desktop-portal-gtk + pkgs.xdg-desktop-portal-wlr + ]; }; environment.sessionVariables = { @@ -22,7 +25,6 @@ environment.systemPackages = with pkgs; [ pyprland - hyprcursor hyprsunset hyprpicker hyprshot @@ -46,7 +48,10 @@ nix = { settings = { warn-dirty = false; - experimental-features = [ "nix-command" "flakes" ]; + experimental-features = [ + "nix-command" + "flakes" + ]; auto-optimise-store = true; substituters = [ "https://hyprland.cachix.org" ]; diff --git a/system/modules/misc.nix b/system/modules/misc.nix index d789cc6..271f219 100644 --- a/system/modules/misc.nix +++ b/system/modules/misc.nix @@ -1,8 +1,10 @@ -{ ... }: +{ pkgs, ... }: { console = { - font = "Lat2-Terminus16"; + earlySetup = true; + font = "ter-124b"; useXkbConfig = true; + packages = with pkgs; [ terminus_font ]; }; } diff --git a/system/modules/programs.nix b/system/modules/programs.nix index eb135c3..efffdc8 100644 --- a/system/modules/programs.nix +++ b/system/modules/programs.nix @@ -1,7 +1,9 @@ { pkgs, config, ... }: let - getIconScript = pkgs.writeShellScriptBin "get-icon" (builtins.readFile ../../home/config/scripts/getIcons.sh); + getIconScript = pkgs.writeShellScriptBin "get-icon" ( + builtins.readFile ../../home/config/scripts/getIcons.sh + ); in { programs = { @@ -33,7 +35,7 @@ in set -g status-left "#[fg=#84977f,bg=default,bold] █ session: #S" set -g status-right " #[fg=#828bb8,bg=default,bold]${config.networking.hostName}   " - setw -g window-status-format "#[bg=#171616,bg=default] #[fg=#495361,bg=default]#(${getIconScript}/get-icon #I) #W" + setw -g window-status-format "#[fg=#171616,bg=default] #[fg=#495361,bg=default]#(${getIconScript}/get-icon #I) #W" setw -g window-status-current-format "#[fg=#7e93a9,bg=default] #[fg=#7e93a9,bg=default,bold]#(${getIconScript}/get-icon #I) #W" diff --git a/system/modules/services.nix b/system/modules/services.nix index 469e28c..f8494ae 100644 --- a/system/modules/services.nix +++ b/system/modules/services.nix @@ -11,7 +11,6 @@ services = { dbus.enable = true; - picom.enable = true; blueman.enable = true; @@ -27,7 +26,7 @@ }; xserver = { - enable = true; + enable = false; xkb.layout = "us"; };