diff --git a/home/linux/desktop/base/gtk.nix b/home/linux/desktop/base/gtk.nix index 8088459a..43b36091 100644 --- a/home/linux/desktop/base/gtk.nix +++ b/home/linux/desktop/base/gtk.nix @@ -11,7 +11,7 @@ gtk.enable = true; x11.enable = true; package = pkgs.bibata-cursors; - name = "Bibata-Modern-Classic"; + name = "Bibata-Modern-Ice"; size = 24; }; diff --git a/home/linux/desktop/hyprland/hypr-conf/hyprland.conf b/home/linux/desktop/hyprland/conf/hyprland.conf similarity index 79% rename from home/linux/desktop/hyprland/hypr-conf/hyprland.conf rename to home/linux/desktop/hyprland/conf/hyprland.conf index 68a2283a..4c10a6b4 100644 --- a/home/linux/desktop/hyprland/hypr-conf/hyprland.conf +++ b/home/linux/desktop/hyprland/conf/hyprland.conf @@ -1,28 +1,3 @@ -## Hyprland configuration file - -# color-scheme: cappuccin-mocha -source=~/.config/hypr/themes/mocha.conf - -env = _JAVA_AWT_WM_NONREPARENTING,1 -env = QT_WAYLAND_DISABLE_WINDOWDECORATION,1 -# fix https://github.com/hyprwm/Hyprland/issues/1520 -env = WLR_NO_HARDWARE_CURSORS,1 - -#-- Output ---------------------------------------------------- -# Configure your Display resolution, offset, scale and Monitors here, use `hyprctl monitors` to get the info. - - # format: - # monitor=name,resolution,position,scale - - - -# monitor=DP-2,3840x2160@144,0x0,1.6 -# workspace=DP-2,1 - -# Shoukei's builtin display(Macbook Pro 2022 13.3 inch) -monitor=eDP-1,2560x1660@60,0x0,1.5 -workspace=eDP-1,1 - #-- Input ---------------------------------------------------- # Configure mouse and touchpad here. input { @@ -206,10 +181,9 @@ bind=SUPER,mouse_up,workspace,e-1 #-- Startup ---------------------------------------------------- exec-once=~/.config/hypr/scripts/startup - -#-- Fcitx5 input method ---------------------------------------------------- +# -- Fcitx5 input method windowrule=pseudo,fcitx # enable this will make fcitx5 works, but fcitx5-configtool will not work! -exec-once=cp ~/.config/fcitx5/profile-bak ~/.config/fcitx5/profile # restore fcitx5 profile manged by nixos +exec-once=cp ~/.config/fcitx5/profile-bak ~/.config/fcitx5/profile # restore fcitx5 profile managed by nixos exec-once=fcitx5 -d --replace # start fcitx5 daemon bind=ALT,E,exec,pkill fcitx5 -9;sleep 1;fcitx5 -d --replace; sleep 1;fcitx5-remote -r @@ -220,20 +194,4 @@ windowrulev2 = size 640 400, class:^(.*jetbrains.*)$, title:^(splash)$ # -- Fix input method in vscode exec-once = hyprctl setcursor "Bibata-Modern-Ice" 24 -# 效果是 wayland 原生窗口缩放完全正常 -# xwayland 窗口先渲染到 200% 再降到 hyprland config 里 monitor 设置的值,看上去和原生没啥区别 -# 相比较一开始的方案输入法字体大小也正确了.唯一有点问题的可能是 xwayland 窗口下的鼠标指针大小不对 -exec-once = xprop -root -f _XWAYLAND_GLOBAL_OUTPUT_SCALE 32c -set _XWAYLAND_GLOBAL_OUTPUT_SCALE 2 --- Fix HiDPI - xwayland -# change monitor to high resolution, the last argument is the scale factor -monitor=,highres,auto,2 - -# unscale XWayland -xwayland { - force_zero_scaling = true -} - -# toolkit-specific scale -env = GDK_SCALE,2 -env = XCURSOR_SIZE,32 diff --git a/home/linux/desktop/hyprland/hypr-conf/mako/config b/home/linux/desktop/hyprland/conf/mako/config similarity index 100% rename from home/linux/desktop/hyprland/hypr-conf/mako/config rename to home/linux/desktop/hyprland/conf/mako/config diff --git a/home/linux/desktop/hyprland/hypr-conf/mako/icons/brightness-100.png b/home/linux/desktop/hyprland/conf/mako/icons/brightness-100.png similarity index 100% rename from home/linux/desktop/hyprland/hypr-conf/mako/icons/brightness-100.png rename to home/linux/desktop/hyprland/conf/mako/icons/brightness-100.png diff --git a/home/linux/desktop/hyprland/hypr-conf/mako/icons/brightness-20.png b/home/linux/desktop/hyprland/conf/mako/icons/brightness-20.png similarity index 100% rename from home/linux/desktop/hyprland/hypr-conf/mako/icons/brightness-20.png rename to home/linux/desktop/hyprland/conf/mako/icons/brightness-20.png diff --git a/home/linux/desktop/hyprland/hypr-conf/mako/icons/brightness-40.png b/home/linux/desktop/hyprland/conf/mako/icons/brightness-40.png similarity index 100% rename from home/linux/desktop/hyprland/hypr-conf/mako/icons/brightness-40.png rename to home/linux/desktop/hyprland/conf/mako/icons/brightness-40.png diff --git a/home/linux/desktop/hyprland/hypr-conf/mako/icons/brightness-60.png b/home/linux/desktop/hyprland/conf/mako/icons/brightness-60.png similarity index 100% rename from home/linux/desktop/hyprland/hypr-conf/mako/icons/brightness-60.png rename to home/linux/desktop/hyprland/conf/mako/icons/brightness-60.png diff --git a/home/linux/desktop/hyprland/hypr-conf/mako/icons/brightness-80.png b/home/linux/desktop/hyprland/conf/mako/icons/brightness-80.png similarity index 100% rename from home/linux/desktop/hyprland/hypr-conf/mako/icons/brightness-80.png rename to home/linux/desktop/hyprland/conf/mako/icons/brightness-80.png diff --git a/home/linux/desktop/hyprland/hypr-conf/mako/icons/dropper.png b/home/linux/desktop/hyprland/conf/mako/icons/dropper.png similarity index 100% rename from home/linux/desktop/hyprland/hypr-conf/mako/icons/dropper.png rename to home/linux/desktop/hyprland/conf/mako/icons/dropper.png diff --git a/home/linux/desktop/hyprland/hypr-conf/mako/icons/microphone-mute.png b/home/linux/desktop/hyprland/conf/mako/icons/microphone-mute.png similarity index 100% rename from home/linux/desktop/hyprland/hypr-conf/mako/icons/microphone-mute.png rename to home/linux/desktop/hyprland/conf/mako/icons/microphone-mute.png diff --git a/home/linux/desktop/hyprland/hypr-conf/mako/icons/microphone.png b/home/linux/desktop/hyprland/conf/mako/icons/microphone.png similarity index 100% rename from home/linux/desktop/hyprland/hypr-conf/mako/icons/microphone.png rename to home/linux/desktop/hyprland/conf/mako/icons/microphone.png diff --git a/home/linux/desktop/hyprland/hypr-conf/mako/icons/music.png b/home/linux/desktop/hyprland/conf/mako/icons/music.png similarity index 100% rename from home/linux/desktop/hyprland/hypr-conf/mako/icons/music.png rename to home/linux/desktop/hyprland/conf/mako/icons/music.png diff --git a/home/linux/desktop/hyprland/hypr-conf/mako/icons/palette.png b/home/linux/desktop/hyprland/conf/mako/icons/palette.png similarity index 100% rename from home/linux/desktop/hyprland/hypr-conf/mako/icons/palette.png rename to home/linux/desktop/hyprland/conf/mako/icons/palette.png diff --git a/home/linux/desktop/hyprland/hypr-conf/mako/icons/picture.png b/home/linux/desktop/hyprland/conf/mako/icons/picture.png similarity index 100% rename from home/linux/desktop/hyprland/hypr-conf/mako/icons/picture.png rename to home/linux/desktop/hyprland/conf/mako/icons/picture.png diff --git a/home/linux/desktop/hyprland/hypr-conf/mako/icons/timer.png b/home/linux/desktop/hyprland/conf/mako/icons/timer.png similarity index 100% rename from home/linux/desktop/hyprland/hypr-conf/mako/icons/timer.png rename to home/linux/desktop/hyprland/conf/mako/icons/timer.png diff --git a/home/linux/desktop/hyprland/hypr-conf/mako/icons/volume-high.png b/home/linux/desktop/hyprland/conf/mako/icons/volume-high.png similarity index 100% rename from home/linux/desktop/hyprland/hypr-conf/mako/icons/volume-high.png rename to home/linux/desktop/hyprland/conf/mako/icons/volume-high.png diff --git a/home/linux/desktop/hyprland/hypr-conf/mako/icons/volume-low.png b/home/linux/desktop/hyprland/conf/mako/icons/volume-low.png similarity index 100% rename from home/linux/desktop/hyprland/hypr-conf/mako/icons/volume-low.png rename to home/linux/desktop/hyprland/conf/mako/icons/volume-low.png diff --git a/home/linux/desktop/hyprland/hypr-conf/mako/icons/volume-mid.png b/home/linux/desktop/hyprland/conf/mako/icons/volume-mid.png similarity index 100% rename from home/linux/desktop/hyprland/hypr-conf/mako/icons/volume-mid.png rename to home/linux/desktop/hyprland/conf/mako/icons/volume-mid.png diff --git a/home/linux/desktop/hyprland/hypr-conf/mako/icons/volume-mute.png b/home/linux/desktop/hyprland/conf/mako/icons/volume-mute.png similarity index 100% rename from home/linux/desktop/hyprland/hypr-conf/mako/icons/volume-mute.png rename to home/linux/desktop/hyprland/conf/mako/icons/volume-mute.png diff --git a/home/linux/desktop/hyprland/mpd/mpd.conf b/home/linux/desktop/hyprland/conf/mpd/mpd.conf similarity index 100% rename from home/linux/desktop/hyprland/mpd/mpd.conf rename to home/linux/desktop/hyprland/conf/mpd/mpd.conf diff --git a/home/linux/desktop/hyprland/hypr-conf/scripts/brightness b/home/linux/desktop/hyprland/conf/scripts/brightness similarity index 100% rename from home/linux/desktop/hyprland/hypr-conf/scripts/brightness rename to home/linux/desktop/hyprland/conf/scripts/brightness diff --git a/home/linux/desktop/hyprland/hypr-conf/scripts/colorpicker b/home/linux/desktop/hyprland/conf/scripts/colorpicker similarity index 100% rename from home/linux/desktop/hyprland/hypr-conf/scripts/colorpicker rename to home/linux/desktop/hyprland/conf/scripts/colorpicker diff --git a/home/linux/desktop/hyprland/hypr-conf/scripts/lockscreen b/home/linux/desktop/hyprland/conf/scripts/lockscreen similarity index 100% rename from home/linux/desktop/hyprland/hypr-conf/scripts/lockscreen rename to home/linux/desktop/hyprland/conf/scripts/lockscreen diff --git a/home/linux/desktop/hyprland/hypr-conf/scripts/menu b/home/linux/desktop/hyprland/conf/scripts/menu similarity index 100% rename from home/linux/desktop/hyprland/hypr-conf/scripts/menu rename to home/linux/desktop/hyprland/conf/scripts/menu diff --git a/home/linux/desktop/hyprland/hypr-conf/scripts/notifications b/home/linux/desktop/hyprland/conf/scripts/notifications similarity index 100% rename from home/linux/desktop/hyprland/hypr-conf/scripts/notifications rename to home/linux/desktop/hyprland/conf/scripts/notifications diff --git a/home/linux/desktop/hyprland/hypr-conf/scripts/screenshot b/home/linux/desktop/hyprland/conf/scripts/screenshot similarity index 100% rename from home/linux/desktop/hyprland/hypr-conf/scripts/screenshot rename to home/linux/desktop/hyprland/conf/scripts/screenshot diff --git a/home/linux/desktop/hyprland/hypr-conf/scripts/startup b/home/linux/desktop/hyprland/conf/scripts/startup similarity index 100% rename from home/linux/desktop/hyprland/hypr-conf/scripts/startup rename to home/linux/desktop/hyprland/conf/scripts/startup diff --git a/home/linux/desktop/hyprland/hypr-conf/scripts/statusbar b/home/linux/desktop/hyprland/conf/scripts/statusbar similarity index 100% rename from home/linux/desktop/hyprland/hypr-conf/scripts/statusbar rename to home/linux/desktop/hyprland/conf/scripts/statusbar diff --git a/home/linux/desktop/hyprland/hypr-conf/scripts/volume b/home/linux/desktop/hyprland/conf/scripts/volume similarity index 100% rename from home/linux/desktop/hyprland/hypr-conf/scripts/volume rename to home/linux/desktop/hyprland/conf/scripts/volume diff --git a/home/linux/desktop/hyprland/hypr-conf/scripts/wlogout b/home/linux/desktop/hyprland/conf/scripts/wlogout similarity index 100% rename from home/linux/desktop/hyprland/hypr-conf/scripts/wlogout rename to home/linux/desktop/hyprland/conf/scripts/wlogout diff --git a/home/linux/desktop/hyprland/hypr-conf/waybar/config.jsonc b/home/linux/desktop/hyprland/conf/waybar/config.jsonc similarity index 100% rename from home/linux/desktop/hyprland/hypr-conf/waybar/config.jsonc rename to home/linux/desktop/hyprland/conf/waybar/config.jsonc diff --git a/home/linux/desktop/hyprland/hypr-conf/waybar/style.css b/home/linux/desktop/hyprland/conf/waybar/style.css similarity index 100% rename from home/linux/desktop/hyprland/hypr-conf/waybar/style.css rename to home/linux/desktop/hyprland/conf/waybar/style.css diff --git a/home/linux/desktop/hyprland/hypr-conf/wlogout/icons/hibernate.png b/home/linux/desktop/hyprland/conf/wlogout/icons/hibernate.png similarity index 100% rename from home/linux/desktop/hyprland/hypr-conf/wlogout/icons/hibernate.png rename to home/linux/desktop/hyprland/conf/wlogout/icons/hibernate.png diff --git a/home/linux/desktop/hyprland/hypr-conf/wlogout/icons/lock.png b/home/linux/desktop/hyprland/conf/wlogout/icons/lock.png similarity index 100% rename from home/linux/desktop/hyprland/hypr-conf/wlogout/icons/lock.png rename to home/linux/desktop/hyprland/conf/wlogout/icons/lock.png diff --git a/home/linux/desktop/hyprland/hypr-conf/wlogout/icons/logout.png b/home/linux/desktop/hyprland/conf/wlogout/icons/logout.png similarity index 100% rename from home/linux/desktop/hyprland/hypr-conf/wlogout/icons/logout.png rename to home/linux/desktop/hyprland/conf/wlogout/icons/logout.png diff --git a/home/linux/desktop/hyprland/hypr-conf/wlogout/icons/reboot.png b/home/linux/desktop/hyprland/conf/wlogout/icons/reboot.png similarity index 100% rename from home/linux/desktop/hyprland/hypr-conf/wlogout/icons/reboot.png rename to home/linux/desktop/hyprland/conf/wlogout/icons/reboot.png diff --git a/home/linux/desktop/hyprland/hypr-conf/wlogout/icons/shutdown.png b/home/linux/desktop/hyprland/conf/wlogout/icons/shutdown.png similarity index 100% rename from home/linux/desktop/hyprland/hypr-conf/wlogout/icons/shutdown.png rename to home/linux/desktop/hyprland/conf/wlogout/icons/shutdown.png diff --git a/home/linux/desktop/hyprland/hypr-conf/wlogout/icons/suspend.png b/home/linux/desktop/hyprland/conf/wlogout/icons/suspend.png similarity index 100% rename from home/linux/desktop/hyprland/hypr-conf/wlogout/icons/suspend.png rename to home/linux/desktop/hyprland/conf/wlogout/icons/suspend.png diff --git a/home/linux/desktop/hyprland/hypr-conf/wlogout/layout b/home/linux/desktop/hyprland/conf/wlogout/layout similarity index 100% rename from home/linux/desktop/hyprland/hypr-conf/wlogout/layout rename to home/linux/desktop/hyprland/conf/wlogout/layout diff --git a/home/linux/desktop/hyprland/hypr-conf/wlogout/style.css b/home/linux/desktop/hyprland/conf/wlogout/style.css similarity index 100% rename from home/linux/desktop/hyprland/hypr-conf/wlogout/style.css rename to home/linux/desktop/hyprland/conf/wlogout/style.css diff --git a/home/linux/desktop/hyprland/default.nix b/home/linux/desktop/hyprland/default.nix index b9a45ab2..23d697d5 100644 --- a/home/linux/desktop/hyprland/default.nix +++ b/home/linux/desktop/hyprland/default.nix @@ -10,22 +10,38 @@ with lib; let in { imports = [ anyrun.homeManagerModules.default - ./nvidia.nix + ./options ]; options.modules.desktop.hyprland = { enable = mkEnableOption "hyprland compositor"; + settings = lib.mkOption { + type = with lib.types; let + valueType = + nullOr (oneOf [ + bool + int + float + str + path + (attrsOf valueType) + (listOf valueType) + ]) + // { + description = "Hyprland configuration value"; + }; + in + valueType; + default = {}; + }; }; config = mkIf cfg.enable ( - mkMerge - (map - (path: import path args) - [ - ./hyprland.nix - ./packages.nix - ./anyrun.nix - ./wayland-apps.nix - ]) + mkMerge ([ + { + wayland.windowManager.hyprland.settings = cfg.settings; + } + ] + ++ (import ./values args)) ); } diff --git a/home/linux/desktop/hyprland/options/default.nix b/home/linux/desktop/hyprland/options/default.nix new file mode 100644 index 00000000..eeb48a40 --- /dev/null +++ b/home/linux/desktop/hyprland/options/default.nix @@ -0,0 +1,3 @@ +{mylib, ...}: { + imports = mylib.scanPaths ./.; +} diff --git a/home/linux/desktop/hyprland/nvidia.nix b/home/linux/desktop/hyprland/options/nvidia.nix similarity index 90% rename from home/linux/desktop/hyprland/nvidia.nix rename to home/linux/desktop/hyprland/options/nvidia.nix index 7118232a..2009c851 100644 --- a/home/linux/desktop/hyprland/nvidia.nix +++ b/home/linux/desktop/hyprland/options/nvidia.nix @@ -17,8 +17,8 @@ in { "XDG_SESSION_TYPE" = "wayland"; "GBM_BACKEND" = "nvidia-drm"; "__GLX_VENDOR_LIBRARY_NAME" = "nvidia"; + # fix https://github.com/hyprwm/Hyprland/issues/1520 "WLR_NO_HARDWARE_CURSORS" = "1"; - "WLR_EGL_NO_MODIFIRES" = "1"; }; }; } diff --git a/home/linux/desktop/hyprland/anyrun.nix b/home/linux/desktop/hyprland/values/anyrun.nix similarity index 100% rename from home/linux/desktop/hyprland/anyrun.nix rename to home/linux/desktop/hyprland/values/anyrun.nix diff --git a/home/linux/desktop/hyprland/values/default.nix b/home/linux/desktop/hyprland/values/default.nix new file mode 100644 index 00000000..0e13748d --- /dev/null +++ b/home/linux/desktop/hyprland/values/default.nix @@ -0,0 +1,4 @@ +{mylib, ...} @ args: +map +(path: import path args) +(mylib.scanPaths ./.) diff --git a/home/linux/desktop/hyprland/hyprland.nix b/home/linux/desktop/hyprland/values/hyprland.nix similarity index 70% rename from home/linux/desktop/hyprland/hyprland.nix rename to home/linux/desktop/hyprland/values/hyprland.nix index ab7392ed..293cbc41 100644 --- a/home/linux/desktop/hyprland/hyprland.nix +++ b/home/linux/desktop/hyprland/values/hyprland.nix @@ -11,9 +11,11 @@ # they are all depending on hyprland/i3's user graphical-session wayland.windowManager.hyprland = { enable = true; + settings = { + source = "${nur-ryan4yin.packages.${pkgs.system}.catppuccin-hyprland}/themes/mocha.conf"; + }; package = hyprland.packages.${pkgs.system}.hyprland; - settings = {}; - extraConfig = builtins.readFile ./hypr-conf/hyprland.conf; + extraConfig = builtins.readFile ../conf/hyprland.conf; # gammastep/wallpaper-switcher need this to be enabled. systemd.enable = true; }; @@ -28,29 +30,25 @@ # hyprland configs, based on https://github.com/notwidow/hyprland xdg.configFile = { "hypr/mako" = { - source = ./hypr-conf/mako; + source = ../conf/mako; recursive = true; }; "hypr/scripts" = { - source = ./hypr-conf/scripts; + source = ../conf/scripts; recursive = true; }; "hypr/waybar" = { - source = ./hypr-conf/waybar; + source = ../conf/waybar; recursive = true; }; "hypr/wlogout" = { - source = ./hypr-conf/wlogout; - recursive = true; - }; - "hypr/themes" = { - source = "${nur-ryan4yin.packages.${pkgs.system}.catppuccin-hyprland}/themes"; + source = ../conf/wlogout; recursive = true; }; # music player - mpd "mpd" = { - source = ./mpd; + source = ../conf/mpd; recursive = true; }; }; @@ -59,8 +57,14 @@ fonts.fontconfig.enable = true; systemd.user.sessionVariables = { - "NIXOS_OZONE_WL" = "1"; # for any ozone-based browser & electron apps to run on wayland - "MOZ_ENABLE_WAYLAND" = "1"; # for firefox to run on wayland - "MOZ_WEBRENDER" = "1"; + NIXOS_OZONE_WL = "1"; # for any ozone-based browser & electron apps to run on wayland + MOZ_ENABLE_WAYLAND = "1"; # for firefox to run on wayland + MOZ_WEBRENDER = "1"; + # toolkit-specific scale + GDK_SCALE = "2"; + XCURSOR_SIZE = "32"; + # misc + _JAVA_AWT_WM_NONREPARENTING = "1"; + QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; }; } diff --git a/home/linux/desktop/hyprland/packages.nix b/home/linux/desktop/hyprland/values/packages.nix similarity index 100% rename from home/linux/desktop/hyprland/packages.nix rename to home/linux/desktop/hyprland/values/packages.nix diff --git a/home/linux/desktop/hyprland/wayland-apps.nix b/home/linux/desktop/hyprland/values/wayland-apps.nix similarity index 100% rename from home/linux/desktop/hyprland/wayland-apps.nix rename to home/linux/desktop/hyprland/values/wayland-apps.nix diff --git a/hosts/12kingdoms/shoukei/home.nix b/hosts/12kingdoms/shoukei/home.nix index 300e74a1..2fae3eb1 100644 --- a/hosts/12kingdoms/shoukei/home.nix +++ b/hosts/12kingdoms/shoukei/home.nix @@ -1,9 +1,14 @@ { modules.desktop.hyprland = { nvidia = false; - # settings = { - # monitor = ""; - # }; + settings = { + # Configure your Display resolution, offset, scale and Monitors here, use `hyprctl monitors` to get the info. + # highres: get the best possible resolution + # auto: postition automatically + # 1.5: scale to 1.5 times + # bitdepth,10: enable 10 bit support + monitor = "eDP-1,highres,auto,1.5,bitdepth,10"; + }; }; modules.desktop.i3 = { diff --git a/hosts/idols/ai/home.nix b/hosts/idols/ai/home.nix index 6155c573..c8b05204 100644 --- a/hosts/idols/ai/home.nix +++ b/hosts/idols/ai/home.nix @@ -1,9 +1,14 @@ { modules.desktop.hyprland = { nvidia = false; - # settings = { - # monitor = ""; - # }; + settings = { + # Configure your Display resolution, offset, scale and Monitors here, use `hyprctl monitors` to get the info. + # highres: get the best possible resolution + # auto: postition automatically + # 1.5: scale to 1.5 times + # bitdepth,10: enable 10 bit support + monitor = "DP-2,highres,auto,1.5,bitdepth,10"; + }; }; modules.desktop.i3 = {