From ab1195859734907f1dbf7d4bb98d131f3a63a8e6 Mon Sep 17 00:00:00 2001 From: ryan4yin Date: Sat, 27 May 2023 14:25:24 +0800 Subject: [PATCH] feat: adjust cursor's size and dpi scale for rofi/i3 --- home/hyprland/default.nix | 12 +++++++++--- home/hyprland/gtk-3.0/settings.ini | 2 +- home/hyprland/gtkrc-2.0 | 2 +- home/i3/config | 6 ++++-- home/i3/default.nix | 15 ++++++++++++--- home/i3/scripts/power-profiles | 4 ++-- home/i3/scripts/powermenu | 4 ++-- 7 files changed, 31 insertions(+), 14 deletions(-) diff --git a/home/hyprland/default.nix b/home/hyprland/default.nix index ba181fcb..d9e68d5a 100644 --- a/home/hyprland/default.nix +++ b/home/hyprland/default.nix @@ -38,11 +38,17 @@ "WLR_EGL_NO_MODIFIRES" = "1"; }; - # set cursor size and dpi for 4k monitor # this is for xwayland + # set dpi for 4k monitor xresources.properties = { - "Xcursor.size" = 32; - "Xft.dpi" = 172; + "Xft.dpi" = 162; + }; + + # set Xcursor.theme & Xcursor.size in ~/.Xresources automatically + home.pointerCursor = { + name = "Qogir-dark"; + package = pkgs.qogir-theme; + size = 64; }; } diff --git a/home/hyprland/gtk-3.0/settings.ini b/home/hyprland/gtk-3.0/settings.ini index ff698632..d82c27fe 100644 --- a/home/hyprland/gtk-3.0/settings.ini +++ b/home/hyprland/gtk-3.0/settings.ini @@ -3,7 +3,7 @@ gtk-theme-name=Arc-Dark gtk-icon-theme-name=Qogir-dark gtk-font-name=Noto Sans 10 gtk-cursor-theme-name=Qogir-dark -gtk-cursor-theme-size=0 +gtk-cursor-theme-size=64 gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR gtk-button-images=0 diff --git a/home/hyprland/gtkrc-2.0 b/home/hyprland/gtkrc-2.0 index 87142647..6275c047 100644 --- a/home/hyprland/gtkrc-2.0 +++ b/home/hyprland/gtkrc-2.0 @@ -6,7 +6,7 @@ gtk-theme-name="Arc-Dark" gtk-icon-theme-name="Qogir-dark" gtk-font-name="Noto Sans 10" gtk-cursor-theme-name="Qogir-dark" -gtk-cursor-theme-size=0 +gtk-cursor-theme-size=64 gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR gtk-button-images=0 diff --git a/home/i3/config b/home/i3/config index 6c6b2e4e..d7dda85e 100644 --- a/home/i3/config +++ b/home/i3/config @@ -517,7 +517,8 @@ strip_workspace_numbers yes ## rofi bindings fancy application menu ($mod+d /F9 optional disabled) bindsym $mod+d exec rofi -modi drun -show drun \ - -config ~/.config/rofi/rofidmenu.rasi + -config ~/.config/rofi/rofidmenu.rasi \ + -dpi 162 #bindsym F9 exec rofi -modi drun -show drun \ # -config ~/.config/rofi/rofidmenu.rasi @@ -525,7 +526,8 @@ bindsym $mod+d exec rofi -modi drun -show drun \ ## rofi bindings for window menu ($mod+t /F10 optional disabled) bindsym $mod+t exec rofi -show window \ - -config ~/.config/rofi/rofidmenu.rasi + -config ~/.config/rofi/rofidmenu.rasi \ + -dpi 162 #bindsym F10 exec rofi -show window \ # -config ~/.config/rofi/rofidmenu.rasi diff --git a/home/i3/default.nix b/home/i3/default.nix index da1f2f12..70eb1831 100644 --- a/home/i3/default.nix +++ b/home/i3/default.nix @@ -32,9 +32,18 @@ "__GLX_VENDOR_LIBRARY_NAME" = "nvidia"; }; - # set cursor size and dpi for 4k monitor + # set dpi for 4k monitor xresources.properties = { - "Xcursor.size" = 32; - "Xft.dpi" = 172; + # dpi for Xorg's font + "Xft.dpi" = 162; + # or set a generic dpi + "*.dpi" = 162; + }; + + # set Xcursor.theme & Xcursor.size in ~/.Xresources automatically + home.pointerCursor = { + name = "Qogir-dark"; + package = pkgs.qogir-theme; + size = 64; }; } \ No newline at end of file diff --git a/home/i3/scripts/power-profiles b/home/i3/scripts/power-profiles index feb63dc5..07b00b69 100755 --- a/home/i3/scripts/power-profiles +++ b/home/i3/scripts/power-profiles @@ -141,11 +141,11 @@ function prepare_launcher() { rofi_colors=(-bc "${BORDER_COLOR}" -bg "${BG_COLOR}" -fg "${FG_COLOR}" \ -hlfg "${HLFG_COLOR}" -hlbg "${HLBG_COLOR}") launcher_exe="rofi" - launcher_options=(-dmenu -i -lines "${menu_nrows}" -p "${ROFI_TEXT}" \ + launcher_options=(-dpi 128 -dmenu -i -lines "${menu_nrows}" -p "${ROFI_TEXT}" \ "${rofi_colors}" "${ROFI_OPTIONS[@]}") elif [[ "$1" == "zenity" ]]; then launcher_exe="zenity" - launcher_options=(--list --title="${ZENITY_TITLE}" --text="${ZENITY_TEXT}" \ + launcher_options=(-dpi 128 --list --title="${ZENITY_TITLE}" --text="${ZENITY_TEXT}" \ "${ZENITY_OPTIONS[@]}") fi } diff --git a/home/i3/scripts/powermenu b/home/i3/scripts/powermenu index 791a9e4a..04386947 100755 --- a/home/i3/scripts/powermenu +++ b/home/i3/scripts/powermenu @@ -137,11 +137,11 @@ function prepare_launcher() { rofi_colors=(-bc "${BORDER_COLOR}" -bg "${BG_COLOR}" -fg "${FG_COLOR}" \ -hlfg "${HLFG_COLOR}" -hlbg "${HLBG_COLOR}") launcher_exe="rofi" - launcher_options=(-dmenu -i -lines "${menu_nrows}" -p "${ROFI_TEXT}" \ + launcher_options=(-dpi 128 -dmenu -i -lines "${menu_nrows}" -p "${ROFI_TEXT}" \ "${rofi_colors}" "${ROFI_OPTIONS[@]}") elif [[ "$1" == "zenity" ]]; then launcher_exe="zenity" - launcher_options=(--list --title="${ZENITY_TITLE}" --text="${ZENITY_TEXT}" \ + launcher_options=(-dpi 128 --list --title="${ZENITY_TITLE}" --text="${ZENITY_TEXT}" \ "${ZENITY_OPTIONS[@]}") fi }