[O] Trim trailing space in script

This commit is contained in:
Azalea (on HyDEV-Daisy) 2022-08-23 11:41:16 -04:00
parent f7aa3ea8ed
commit 80b79d7dbb
No known key found for this signature in database
GPG key ID: E289FAC0DA92DD2B

120
neofetch
View file

@ -1611,7 +1611,7 @@ get_title() {
case $title_fqdn in case $title_fqdn in
on) hostname=$(hostname -f) ;; on) hostname=$(hostname -f) ;;
*) *)
hostname=${HOSTNAME:-$(hostname)} hostname=${HOSTNAME:-$(hostname)}
hostname=${hostname%.*} hostname=${hostname%.*}
;; ;;
@ -3549,7 +3549,7 @@ get_style() {
kde_config_file="${kde_config_dir}/kdeglobals" kde_config_file="${kde_config_dir}/kdeglobals"
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="$(grep "^${kde}" "$kde_config_file")"
kde_theme="${kde_theme/*=}" kde_theme="${kde_theme/*=}"
if [[ "$kde" == "font" ]]; then if [[ "$kde" == "font" ]]; then
@ -3600,24 +3600,24 @@ get_style() {
type -p xfconf-query >/dev/null && \ type -p xfconf-query >/dev/null && \
gtk2_theme="$(xfconf-query -c xsettings -p "$xfconf")" gtk2_theme="$(xfconf-query -c xsettings -p "$xfconf")"
;; ;;
"Trinity") "Trinity")
tde_config_dir tde_config_dir
if [[ -f "${tde_config_dir}/kdeglobals" ]]; then if [[ -f "${tde_config_dir}/kdeglobals" ]]; then
tde_config_file="${tde_config_dir}/kdeglobals" tde_config_file="${tde_config_dir}/kdeglobals"
qt_theme="$(grep "^${kde}" "$tde_config_file")" qt_theme="$(grep "^${kde}" "$tde_config_file")"
qt_theme="${qt_theme/*=}" qt_theme="${qt_theme/*=}"
else else
err "Theme: TDE config files not found, skipping." err "Theme: TDE config files not found, skipping."
fi fi
;; ;;
"LXQt"*) "LXQt"*)
shopt -s nullglob shopt -s nullglob
if ! qt_theme=$(awk -F "=" -v r="^$lxqt" ' if ! qt_theme=$(awk -F "=" -v r="^$lxqt" '
$1~r { theme=$2 } $1~r { theme=$2 }
END { print theme } END { print theme }
' {/etc/xdg,/etc/xdg/*,"$XDG_CONFIG_HOME"}/lxqt/lxqt.con?); then ' {/etc/xdg,/etc/xdg/*,"$XDG_CONFIG_HOME"}/lxqt/lxqt.con?); then
err "Theme: Can't read LXQt config files. Unsetting Qt theme." err "Theme: Can't read LXQt config files. Unsetting Qt theme."
@ -3625,7 +3625,7 @@ get_style() {
fi fi
shopt -u nullglob shopt -u nullglob
;; ;;
esac esac
# Check for general GTK2 Theme. # Check for general GTK2 Theme.
@ -3679,14 +3679,14 @@ get_style() {
qt_theme="${qt_theme%'"'}" qt_theme="${qt_theme%'"'}"
qt_theme="${qt_theme#@Variant(}" qt_theme="${qt_theme#@Variant(}"
qt_theme="${qt_theme%)}" qt_theme="${qt_theme%)}"
# Read font name # Read font name
qt5ct_font_name="${qt_theme#*@}" qt5ct_font_name="${qt_theme#*@}"
qt5ct_font_name="${qt5ct_font_name%%@*}" qt5ct_font_name="${qt5ct_font_name%%@*}"
# Interpret backslashes # Interpret backslashes
qt5ct_font_name="$(printf "%b" "$qt5ct_font_name")" qt5ct_font_name="$(printf "%b" "$qt5ct_font_name")"
qt5ct_font_name="${qt5ct_font_name//[[:cntrl:]]}" # trim control characters qt5ct_font_name="${qt5ct_font_name//[[:cntrl:]]}" # trim control characters
# Get font size # Get font size
# Tread carefully, Qt sometimes uses @ in binary data # Tread carefully, Qt sometimes uses @ in binary data
local pre_size="${qt_theme#*@}" local pre_size="${qt_theme#*@}"
@ -3698,14 +3698,14 @@ get_style() {
local lowers=$(( ((raw_size[0]%16)<<8) + (raw_size[1]) )) local lowers=$(( ((raw_size[0]%16)<<8) + (raw_size[1]) ))
local upper4=$((raw_size[0]>>4 )) local upper4=$((raw_size[0]>>4 ))
qt5ct_font_size=$(( (2**(upper4+1)) + (lowers>>(11-upper4)) )) qt5ct_font_size=$(( (2**(upper4+1)) + (lowers>>(11-upper4)) ))
qt_theme="$qt5ct_font_name, $qt5ct_font_size" qt_theme="$qt5ct_font_name, $qt5ct_font_size"
fi fi
fi fi
# Forced Qt theme through environment variables - Apply only if handling widget style! # Forced Qt theme through environment variables - Apply only if handling widget style!
[[ "$kde" == "widgetStyle" && "$qt_theme" ]] && qt_theme="${QT_STYLE_OVERRIDE:-"$qt_theme"}" [[ "$kde" == "widgetStyle" && "$qt_theme" ]] && qt_theme="${QT_STYLE_OVERRIDE:-"$qt_theme"}"
# Reformat Qt fonts # Reformat Qt fonts
if [[ "$kde" == "font" && "$qt_theme" ]]; then if [[ "$kde" == "font" && "$qt_theme" ]]; then
qt_font_size="${qt_theme#*,}" qt_font_size="${qt_theme#*,}"
@ -4146,7 +4146,7 @@ END
"termite") "termite")
[[ -f "${XDG_CONFIG_HOME}/termite/config" ]] && \ [[ -f "${XDG_CONFIG_HOME}/termite/config" ]] && \
termite_config="${XDG_CONFIG_HOME}/termite/config" termite_config="${XDG_CONFIG_HOME}/termite/config"
XDG_DIR="/etc/xdg" XDG_DIR="/etc/xdg"
IFS=":" IFS=":"
for directory in $XDG_CONFIG_DIRS; do for directory in $XDG_CONFIG_DIRS; do
@ -5473,7 +5473,7 @@ kde_config_dir() {
elif type -p kde-config &>/dev/null; then elif type -p kde-config &>/dev/null; then
kde_config_dir="$(kde-config --path config)" kde_config_dir="$(kde-config --path config)"
elif [[ -d "${HOME}/.kde4" ]]; then elif [[ -d "${HOME}/.kde4" ]]; then
kde_config_dir="${HOME}/.kde4/share/config" kde_config_dir="${HOME}/.kde4/share/config"
@ -5487,15 +5487,15 @@ kde_config_dir() {
tde_config_dir() { tde_config_dir() {
if [[ "$tde_config_dir" ]]; then if [[ "$tde_config_dir" ]]; then
return return
elif type -p tde-config &>/dev/null; then elif type -p tde-config &>/dev/null; then
tde_config_dir="$(tde-config --path config)" tde_config_dir="$(tde-config --path config)"
elif [[ -d "${HOME}/.configtde" ]]; then elif [[ -d "${HOME}/.configtde" ]]; then
tde_config_dir="${HOME}/.configtde" tde_config_dir="${HOME}/.configtde"
fi fi
tde_config_dir="${tde_config_dir/$'/:'*}" tde_config_dir="${tde_config_dir/$'/:'*}"
} }
@ -6280,8 +6280,8 @@ ${c1} ........::::....
:#####:${c2}@@@@@@@@@@@@@@@@@@@${c1}:####; :#####:${c2}@@@@@@@@@@@@@@@@@@@${c1}:####;
:####:.${c2}@@@@@@@@@@@@@@@@${c1}:#####: :####:.${c2}@@@@@@@@@@@@@@@@${c1}:#####:
`:####:.${c2}@@@@@@@@@@@@@@${c1}:#####: `:####:.${c2}@@@@@@@@@@@@@@${c1}:#####:
``:##:.${c2}@@@@@@@@@@@@${c1}^## # : ``:##:.${c2}@@@@@@@@@@@@${c1}^## # :
: ## ${c2}\@@@;@@@/ ${c1}:: # : : ## ${c2}\@@@;@@@/ ${c1}:: # :
${c2} VVV ${c2} VVV
EOF EOF
;; ;;
@ -7154,7 +7154,7 @@ ${c3} ........
`╙▀█▄@»»»;`▀███▌¿ ,▄▀Ñ"` `╙▀█▄@»»»;`▀███▌¿ ,▄▀Ñ"`
`"╨▀█▄▄▄░`▐█████▄, ,▄▄▀▀░` `"╨▀█▄▄▄░`▐█████▄, ,▄▄▀▀░`
`"╙╩▀▀▀▀████████▓▌▌▌▀▀▀╨"`` `"╙╩▀▀▀▀████████▓▌▌▌▀▀▀╨"``
``""░╚╨╝╝╝╝╨╨░""`` ``""░╚╨╝╝╝╝╨╨░""``
EOF EOF
;; ;;
@ -11314,25 +11314,25 @@ EOF
"ravynOS") "ravynOS")
set_colors 15 set_colors 15
read -rd '' ascii_data <<'EOF' read -rd '' ascii_data <<'EOF'
${c1} ..oooo.. ${c1} ..oooo..
.o$$$$$$$$$$$$$$o. .o$$$$$$$$$$$$$$o.
od$$$$$$$$$$$$$$$$$$$$$o od$$$$$$$$$$$$$$$$$$$$$o
o$$$$$$$$$$$$$$$$$$$$$$$$$$o o$$$$$$$$$$$$$$$$$$$$$$$$$$o
.$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$. .$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$.
d$$$$$$$$$********$$$$$$$$$$$$$$$b d$$$$$$$$$********$$$$$$$$$$$$$$$b
d$$$$$$$* °****?$$$$$$$$b d$$$$$$$* °****?$$$$$$$$b
$$$$$$* °$$$$$$$ $$$$$$* °$$$$$$$
d$$** .oo$$$$$$$$b d$$** .oo$$$$$$$$b
*° o$$$$$$$$$$$$$$ *° o$$$$$$$$$$$$$$
o$$$$$$$$$$$$$$$$ o$$$$$$$$$$$$$$$$
o$$$$$$$$$$$$$$$$$P o$$$$$$$$$$$$$$$$$P
*$$$$$$$$$$$$$$$$$ *$$$$$$$$$$$$$$$$$
?$$$$$$$$$$$$$$P ?$$$$$$$$$$$$$$P
$$$$$$$$$$$$$P $$$$$$$$$$$$$P
$$$$$$$$$$$$P $$$$$$$$$$$$P
?$$$$$$$$$$* ?$$$$$$$$$$*
$$$$$$$*° $$$$$$$*°
d$$$$*° d$$$$*°
° °
EOF EOF
;; ;;
@ -13122,25 +13122,25 @@ EOF
"KrassOS"* | "Krass"*) "KrassOS"* | "Krass"*)
set_colors 4 7 set_colors 4 7
read -rd '' ascii_data <<'EOF' read -rd '' ascii_data <<'EOF'
${c1} ${c2}**@@@@@@@@@@@* ${c1} ${c2}**@@@@@@@@@@@*
${c2},@@@@%${c1}(((((((((((((${c2}%@@@@, ${c2},@@@@%${c1}(((((((((((((${c2}%@@@@,
${c2}#@@&${c1}(((((((((((((((((((((((${c2}&@@% ${c2}#@@&${c1}(((((((((((((((((((((((${c2}&@@%
${c2}@@&${c1}(((((((((((((((((((((((((((((${c2}@@@ ${c2}@@&${c1}(((((((((((((((((((((((((((((${c2}@@@
${c2}@@&${c1}(((((((((((((((((((((((((((((((((${c2}&@@ ${c2}@@&${c1}(((((((((((((((((((((((((((((((((${c2}&@@
${c2}.@@${c1}(((((((((((((((((((((((((((((((((((((${c2}@@. ${c2}.@@${c1}(((((((((((((((((((((((((((((((((((((${c2}@@.
${c2}@@${c1}(((((((((((((((((((((((((((((((((((((((${c2}@@ ${c2}@@${c1}(((((((((((((((((((((((((((((((((((((((${c2}@@
${c2}@@#${c1}(((((((((((((((((((((((((((((${c2}%@@@@@@@#${c1}(#${c2}@@ ${c2}@@#${c1}(((((((((((((((((((((((((((((${c2}%@@@@@@@#${c1}(#${c2}@@
${c2}.@@${c1}((((((((((((((((${c2}#%@@@@@@@@@&%#${c1}((((${c2}%@&${c1}((((${c2}@@. ${c2}.@@${c1}((((((((((((((((${c2}#%@@@@@@@@@&%#${c1}((((${c2}%@&${c1}((((${c2}@@.
${c2}.@@${c1}(((((((/(${c2}&@@@@@@%${c1}(/((((((((((((((${c2}@@/${c1}(((((${c2}@@. ${c2}.@@${c1}(((((((/(${c2}&@@@@@@%${c1}(/((((((((((((((${c2}@@/${c1}(((((${c2}@@.
${c2}.@@${c1}(///////////////////////////////${c2}@${c1}(///////${c2}@@ ${c2}.@@${c1}(///////////////////////////////${c2}@${c1}(///////${c2}@@
${c2}%@#${c1}/////////////////////////////(${c2}#${c1}////////${c2}%@% ${c2}%@#${c1}/////////////////////////////(${c2}#${c1}////////${c2}%@%
${c2} @@${c1}(///////////////////////////${c2}%${c1}/////////(${c2}@@ ${c2} @@${c1}(///////////////////////////${c2}%${c1}/////////(${c2}@@
${c2}@@#${c1}***********************************${c2}%@@ ${c2}@@#${c1}***********************************${c2}%@@
${c2}*@@${c1}********************************${c2}/@@/ ${c2}*@@${c1}********************************${c2}/@@/
${c2},@@#${c1}***************************${c2}%@@* ${c2},@@#${c1}***************************${c2}%@@*
${c2}@@@&${c1}********************${c2}/@@@@ ${c2}@@@&${c1}********************${c2}/@@@@
${c2}&@@@@&${c1}(//***//(${c2}&@@@@& ${c2}&@@@@&${c1}(//***//(${c2}&@@@@&
${c1} ${c2}**@@@@@@@@@@@* ${c1} ${c2}**@@@@@@@@@@@*
EOF EOF
;; ;;