117117fi
118118GTK_ICON=" $( get_hyprConf " ICON_THEME" ) "
119119CURSOR_THEME=" $( get_hyprConf " CURSOR_THEME" ) "
120+ CURSOR_SIZE=${_CURSOR_SIZE:- " $( get_hyprConf " CURSOR_SIZE" ) " }
120121font_name=" $( get_hyprConf " FONT" ) "
121122font_size=" $( get_hyprConf " FONT_SIZE" ) "
122123monospace_font_name=" $( get_hyprConf " MONOSPACE_FONT" ) "
@@ -179,6 +180,7 @@ sed -i -e "/^gtk-theme-name=/c\gtk-theme-name=\"${GTK_THEME}\"" \
179180toml_write " ${confDir} /gtk-3.0/settings.ini" " Settings" " gtk-theme-name" " ${GTK_THEME} "
180181toml_write " ${confDir} /gtk-3.0/settings.ini" " Settings" " gtk-icon-theme-name" " ${GTK_ICON} "
181182toml_write " ${confDir} /gtk-3.0/settings.ini" " Settings" " gtk-cursor-theme-name" " ${CURSOR_THEME} "
183+ toml_write " ${confDir} /gtk-3.0/settings.ini" " Settings" " gtk-cursor-theme-size" " ${CURSOR_SIZE} "
182184toml_write " ${confDir} /gtk-3.0/settings.ini" " Settings" " gtk-font-name" " ${font_name} ${font_size} "
183185
184186# // gtk4
210212
211213sed -i -e " /^Net\/ThemeName /c\Net\/ThemeName \" ${GTK_THEME} \" " \
212214 -e " /^Net\/IconThemeName /c\Net\/IconThemeName \" ${GTK_ICON} \" " \
213- -e " /^Gtk\/CURSOR_THEMEName /c\Gtk\/CURSOR_THEMEName \" ${CURSOR_THEME} \" " \
215+ -e " /^Gtk\/CursorThemeName /c\Gtk\/CursorThemeName \" ${CURSOR_THEME} \" " \
216+ -e " /^Gtk\/CursorThemeSize /c\Gtk\/CursorThemeSize ${CURSOR_SIZE} " \
214217 " $confDir /xsettingsd/xsettingsd.conf"
215218
216219# // Legacy themes using ~/.themes also fixed GTK4 not following xdg
@@ -222,6 +225,33 @@ if [ ! -L "$HOME/.themes/${GTK_THEME}" ] && [ -d "${themesDir}/${GTK_THEME}" ];
222225 ln -snf " ${themesDir} /${GTK_THEME} " " $HOME /.themes/"
223226fi
224227
228+ # // .Xresources
229+ if [ -f " $HOME /.Xresources" ]; then
230+ sed -i -e " /^Xcursor\.theme:/c\Xcursor.theme: ${CURSOR_THEME} " \
231+ -e " /^Xcursor\.size:/c\Xcursor.size: ${CURSOR_SIZE} " " $HOME /.Xresources"
232+
233+ # Add if they don't exist
234+ grep -q " ^Xcursor\.theme:" " $HOME /.Xresources" || echo " Xcursor.theme: ${CURSOR_THEME} " >> " $HOME /.Xresources"
235+ grep -q " ^Xcursor\.size:" " $HOME /.Xresources" || echo " Xcursor.size: 30" >> " $HOME /.Xresources"
236+ else
237+ # Create .Xresources if it doesn't exist
238+ cat > " $HOME /.Xresources" << EOF
239+ Xcursor.theme: ${CURSOR_THEME}
240+ Xcursor.size: ${CURSOR_SIZE}
241+ EOF
242+ fi
243+
244+ # // .Xdefaults
245+
246+ if [ -f " $HOME /.Xdefaults" ]; then
247+ sed -i -e " /^Xcursor\.theme:/c\Xcursor.theme: ${CURSOR_THEME} " \
248+ -e " /^Xcursor\.size:/c\Xcursor.size: ${CURSOR_SIZE} " " $HOME /.Xdefaults"
249+
250+ # Add if they don't exist
251+ grep -q " ^Xcursor\.theme:" " $HOME /.Xdefaults" || echo " Xcursor.theme: ${CURSOR_THEME} " >> " $HOME /.Xdefaults"
252+ grep -q " ^Xcursor\.size:" " $HOME /.Xdefaults" || echo " Xcursor.size: 30" >> " $HOME /.Xdefaults"
253+ fi
254+
225255# // wallpaper
226256export -f pkg_installed
227257export scrDir
0 commit comments