Skip to content

Commit

Permalink
[PR] dylanaraps/neofetch#1149 from alaughlin - adding cursor theme su…
Browse files Browse the repository at this point in the history
…pport

Upstream PR: dylanaraps/neofetch#1149
Thanks to @alaughlin

Co-authored-by: Adam Laughlin <[email protected]>
  • Loading branch information
hykilpikonna and alaughlin committed Aug 12, 2022
2 parents 42ca4dd + 9281ae5 commit 9cf4b6c
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion neofetch
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 9cf4b6c

Please sign in to comment.