[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 "WM Theme" wm_theme
info "Theme" theme info "Theme" theme
info "Icons" icons info "Icons" icons
info "Cursor" cursor
info "Terminal" term info "Terminal" term
info "Terminal Font" term_font info "Terminal Font" term_font
info "CPU" cpu info "CPU" cpu
@ -3495,6 +3496,25 @@ get_style() {
qt_theme="$(grep "^${kde}" "$kde_config_file")" qt_theme="$(grep "^${kde}" "$kde_config_file")"
qt_theme="${qt_theme/*=}" 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 else
err "Theme: KDE config files not found, skipping." err "Theme: KDE config files not found, skipping."
fi fi
@ -3738,6 +3758,17 @@ get_font() {
font="$theme" 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() { get_term() {
# If function was run, stop here. # If function was run, stop here.
((term_run == 1)) && return ((term_run == 1)) && return
@ -6023,7 +6054,7 @@ get_args() {
# Known implicit unused variables. # Known implicit unused variables.
mpc_args=() mpc_args=()
printf '%s\n' "$kernel $icons $font $battery $locale ${mpc_args[*]}" printf '%s\n' "$kernel $icons $font $cursor $battery $locale ${mpc_args[*]}"
;; ;;
esac esac