fix: cursor size inconsistent

This commit is contained in:
DACHXY 2025-01-03 16:47:35 +08:00
parent 1307aa78fa
commit 5951b04024
11 changed files with 81 additions and 41 deletions

View file

@ -6,6 +6,7 @@
"exclusive": true,
"passthrough": false,
"position": "top",
"height": 40,
"spacing": 3,
"fixed-center": true,
"ipc": true,

View file

@ -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 = {

View file

@ -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''

View file

@ -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,15 +43,18 @@ in
systemd.enable = false;
package = inputs.hyprland.packages.${system}.hyprland;
plugins = (with inputs.hyprland-plugins.packages.${system}; [
plugins =
(with inputs.hyprland-plugins.packages.${system}; [
xtra-dispatchers
hyprexpo
hyprwinwrap
]) ++ ([
])
++ ([
inputs.hyprgrass.packages.${system}.default
]);
settings = {
settings =
{
bind = import ./hypr/bind.nix { inherit mainMod; };
bindm = import ./hypr/bindm.nix { inherit mainMod; };
monitor = import ./hypr/monitor.nix;
@ -43,11 +62,14 @@ in
exec-once = ''${startScript}'';
env = [
''HYPRCURSOR_THEME, ${cursorName}''
''HYPRCURSOR_SIZE, ${cursorSize}''
''HYPRCURSOR_SIZE, ${hyprcursor-size}''
''XCURSOR_THEME, ${cursorName}''
''XCURSOR_SIZE, ${cursorSize}''
''XCURSOR_SIZE, ${xcursor-size}''
];
} // window // windowrule // input;
}
// window
// windowrule
// input;
};
services.hyprpaper = {

View file

@ -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
;

View file

@ -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
;

View file

@ -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;
};
}

View file

@ -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" ];

View file

@ -1,8 +1,10 @@
{ ... }:
{ pkgs, ... }:
{
console = {
font = "Lat2-Terminus16";
earlySetup = true;
font = "ter-124b";
useXkbConfig = true;
packages = with pkgs; [ terminus_font ];
};
}

View file

@ -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"

View file

@ -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";
};