From 587d29656c20749f42d5e3a1e33438ff5740f452 Mon Sep 17 00:00:00 2001 From: ryan4yin Date: Mon, 15 May 2023 18:58:52 +0800 Subject: [PATCH] fix: try to fix ime in firefox --- home/hyprland/default.nix | 7 +++++++ home/hyprland/hypr-conf/hyprland.conf | 14 +++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/home/hyprland/default.nix b/home/hyprland/default.nix index 29ef4a87..c482e1a3 100644 --- a/home/hyprland/default.nix +++ b/home/hyprland/default.nix @@ -28,6 +28,13 @@ # allow fontconfig to discover fonts and configurations installed through home.packages fonts.fontconfig.enable = true; + # set cursor size and dpi for 4k monitor + # this is for xwayland + xresources.properties = { + "Xcursor.size" = 16; + "Xft.dpi" = 160; + }; + 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 diff --git a/home/hyprland/hypr-conf/hyprland.conf b/home/hyprland/hypr-conf/hyprland.conf index 6753eaab..0360846d 100644 --- a/home/hyprland/hypr-conf/hyprland.conf +++ b/home/hyprland/hypr-conf/hyprland.conf @@ -196,4 +196,16 @@ exec-once=~/.config/hypr/scripts/startup 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=fcitx5 -d --replace # start fcitx5 daemon -bind=ALT,E,exec,pkill fcitx5 -9;sleep 1;fcitx5 -d --replace; sleep 1;fcitx5-remote -r \ No newline at end of file +bind=ALT,E,exec,pkill fcitx5 -9;sleep 1;fcitx5 -d --replace; sleep 1;fcitx5-remote -r + + +# -- 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 +exec-once = xrdb -merge ~/.Xresources +# env = GDK_SCALE,2 +env = XCURSOR_SIZE,48 +env = XCURSOR_THEME,"Bibata-Modern-Ice"