Skip to content

Commit c99fc64

Browse files
committed
misc: Fixed substitutions.
1 parent 288036e commit c99fc64

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

neofetch

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -930,7 +930,7 @@ get_distro() {
930930
fi
931931

932932
distro="$(trim_quotes "$distro")"
933-
distro="${distro/'NAME='}"
933+
distro="${distro/NAME=}"
934934
;;
935935

936936
"Mac OS X")
@@ -1184,7 +1184,7 @@ get_uptime() {
11841184

11851185
"Mac OS X" | "iPhone OS" | "BSD" | "FreeMiNT")
11861186
boot="$(sysctl -n kern.boottime)"
1187-
boot="${boot/'{ sec = '}"
1187+
boot="${boot/\{ sec = }"
11881188
boot="${boot/,*}"
11891189

11901190
# Get current date in seconds.
@@ -1419,7 +1419,7 @@ get_de() {
14191419
((wm_run != 1)) && get_wm
14201420

14211421
if [[ "$XDG_CURRENT_DESKTOP" ]]; then
1422-
de="${XDG_CURRENT_DESKTOP/'X-'}"
1422+
de="${XDG_CURRENT_DESKTOP/X\-}"
14231423
de="${de/Budgie:GNOME/Budgie}"
14241424
de="${de/:Unity7:ubuntu}"
14251425

@@ -1682,7 +1682,7 @@ get_wm_theme() {
16821682
wm_theme="$(awk '/(decoration)/ {gsub(/\[/,"",$1); print $1; exit}' "$kdebugrc")"
16831683
fi
16841684

1685-
wm_theme="${wm_theme/'theme='}"
1685+
wm_theme="${wm_theme/theme=}"
16861686
;;
16871687

16881688
"Quartz Compositor")
@@ -1713,7 +1713,7 @@ get_wm_theme() {
17131713
path="${path//\\/\/}"
17141714

17151715
wm_theme="$(grep '^session\.styleFile:' "${path/\.exe/.rc}")"
1716-
wm_theme="${wm_theme/'session.styleFile: '}"
1716+
wm_theme="${wm_theme/session\.styleFile: }"
17171717
wm_theme="${wm_theme##*\\}"
17181718
wm_theme="${wm_theme%.*}"
17191719
;;
@@ -2061,8 +2061,8 @@ get_gpu() {
20612061
brand="${brand:-${gpu/*AMD*/AMD}}"
20622062
brand="${brand:-${gpu/*ATI*/ATi}}"
20632063

2064-
gpu="${gpu/'[AMD/ATI]' }"
2065-
gpu="${gpu/'[AMD]' }"
2064+
gpu="${gpu/\[AMD\/ATI\] }"
2065+
gpu="${gpu/\[AMD\] }"
20662066
gpu="${gpu/OEM }"
20672067
gpu="${gpu/Advanced Micro Devices, Inc.}"
20682068
gpu="${gpu/ \/ *}"
@@ -2079,8 +2079,8 @@ get_gpu() {
20792079

20802080
*"intel"*)
20812081
gpu="${gpu/*Intel/Intel}"
2082-
gpu="${gpu/'(R)'}"
2083-
gpu="${gpu/'Corporation'}"
2082+
gpu="${gpu/\(R\)}"
2083+
gpu="${gpu/Corporation}"
20842084
gpu="${gpu/ \(*}"
20852085
gpu="${gpu/Integrated Graphics Controller}"
20862086
gpu="${gpu/*Xeon*/Intel HD Graphics}"
@@ -2112,7 +2112,7 @@ get_gpu() {
21122112
else
21132113
gpu="$(system_profiler SPDisplaysDataType |\
21142114
awk -F': ' '/^\ *Chipset Model:/ {printf $2 ", "}')"
2115-
gpu="${gpu//'/ $'}"
2115+
gpu="${gpu//\/ \$}"
21162116
gpu="${gpu%,*}"
21172117

21182118
cache "gpu" "$gpu"
@@ -2172,7 +2172,7 @@ get_gpu() {
21722172

21732173
*)
21742174
gpu="$(glxinfo | grep -F 'OpenGL renderer string')"
2175-
gpu="${gpu/'OpenGL renderer string: '}"
2175+
gpu="${gpu/OpenGL renderer string: }"
21762176
;;
21772177
esac
21782178
;;
@@ -3099,7 +3099,7 @@ get_disk() {
30993099
for disk in "${disks[@]}"; do
31003100
# Create a second array and make each element split at whitespace this time.
31013101
IFS=" " read -ra disk_info <<< "$disk"
3102-
disk_perc="${disk_info[4]/'%'}"
3102+
disk_perc="${disk_info[4]/\%}"
31033103

31043104
case "$df_version" in
31053105
*"befhikm"*)
@@ -3216,9 +3216,9 @@ get_battery() {
32163216
[[ "$battery_state" ]] && battery+=" Charging"
32173217

32183218
case "$battery_display" in
3219-
"bar") battery="$(bar "${battery/'%'*}" 100)" ;;
3220-
"infobar") battery="${battery} $(bar "${battery/'%'*}" 100)" ;;
3221-
"barinfo") battery="$(bar "${battery/'%'*}" 100)${info_color} ${battery}" ;;
3219+
"bar") battery="$(bar "${battery/\%*}" 100)" ;;
3220+
"infobar") battery="${battery} $(bar "${battery/\%*}" 100)" ;;
3221+
"barinfo") battery="$(bar "${battery/\%*}" 100)${info_color} ${battery}" ;;
32223222
esac
32233223
}
32243224

@@ -3246,7 +3246,7 @@ get_local_ip() {
32463246

32473247
"Haiku")
32483248
local_ip="$(ifconfig | awk -F ': ' '/Bcast/ {print $2}')"
3249-
local_ip="${local_ip/', Bcast'}"
3249+
local_ip="${local_ip/, Bcast}"
32503250
;;
32513251
esac
32523252
}
@@ -3516,7 +3516,7 @@ END
35163516
esac
35173517

35183518
# Strip un-needed info from the path.
3519-
image="${image/'file://'}"
3519+
image="${image/file:\/\/}"
35203520
image="$(trim_quotes "$image")"
35213521
;;
35223522
esac
@@ -4175,7 +4175,7 @@ get_ppid() {
41754175
case "$os" in
41764176
"Windows")
41774177
ppid="$(ps -p "${1:-$PPID}" | awk '{printf $2}')"
4178-
ppid="${ppid/'PPID'}"
4178+
ppid="${ppid/PPID}"
41794179
;;
41804180

41814181
"Linux")
@@ -4196,7 +4196,7 @@ get_process_name() {
41964196
case "$os" in
41974197
"Windows")
41984198
name="$(ps -p "${1:-$PPID}" | awk '{printf $8}')"
4199-
name="${name/'COMMAND'}"
4199+
name="${name/COMMAND}"
42004200
name="${name/*\/}"
42014201
;;
42024202

0 commit comments

Comments
 (0)