[PR] dylanaraps/neofetch#1149 from alaughlin - adding cursor theme support

Upstream PR: https://github.com/dylanaraps/neofetch/pull/1149
Thanks to @alaughlin

Co-authored-by: Adam Laughlin <adamlaughlin@outlook.com>
This commit is contained in:
Azalea (on HyDEV-Daisy) 2022-08-11 21:15:26 -04:00
commit 9cf4b6cdcb

View file

@ -68,6 +68,7 @@ print_info() {
info "WM Theme" wm_theme
info "Theme" theme
info "Icons" icons
info "Cursor" cursor
info "Terminal" term
info "Terminal Font" term_font
info "CPU" cpu
@ -3495,6 +3496,25 @@ get_style() {
qt_theme="$(grep "^${kde}" "$kde_config_file")"
qt_theme="${qt_theme/*=}"
kde_theme="$(grep "^${kde}" "$kde_config_file")"
kde_theme="${kde_theme/*=}"
if [[ "$kde" == "font" ]]; then
kde_font_size="${kde_theme#*,}"
kde_font_size="${kde_font_size/,*}"
kde_theme="${kde_theme/,*} ${kde_theme/*,} ${kde_font_size}"
fi
if [[ "$kde" == "cursorTheme" ]]; then
if [[ -f "${kde_config_dir}/kcminputrc" ]]; then
kde_config_file="${kde_config_dir}/kcminputrc"
elif [[ -f "${kde_config_dir}/startupconfig" ]]; then
kde="cursortheme"
kde_config_file="${kde_config_dir}/startupconfig"
fi
kde_theme="$(grep "${kde}" "$kde_config_file")"
kde_theme="${kde_theme/*=}"
fi
kde_theme="$kde_theme [KDE], "
else
err "Theme: KDE config files not found, skipping."
fi
@ -3738,6 +3758,17 @@ get_font() {
font="$theme"
}
get_cursor() {
name="gtk-cursor-theme-name"
gsettings="cursor-theme"
gconf="cursor_theme"
xfconf="/Gtk/CursorThemeName"
kde="cursorTheme"
get_style
cursor="$theme"
}
get_term() {
# If function was run, stop here.
((term_run == 1)) && return
@ -6023,7 +6054,7 @@ get_args() {
# Known implicit unused variables.
mpc_args=()
printf '%s\n' "$kernel $icons $font $battery $locale ${mpc_args[*]}"
printf '%s\n' "$kernel $icons $font $cursor $battery $locale ${mpc_args[*]}"
;;
esac