From bfb5278efb5c530574e9b907565cdc3677318cfc Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 2 Jan 2017 11:44:37 +1100 Subject: [PATCH 1/4] General: Fix math syntax --- neofetch | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/neofetch b/neofetch index 2b982ffb..148ff2b4 100755 --- a/neofetch +++ b/neofetch @@ -524,7 +524,7 @@ get_shell() { get_de() { # If function was run, stop here. - (( "$de_run" == 1 )) && return + (( de_run == 1 )) && return case "$os" in "Mac OS X") de="Aqua" ;; @@ -536,7 +536,7 @@ get_de() { ;; *) - (( "$wm_run" != 1 )) && get_wm + (( wm_run != 1 )) && get_wm if [[ "$XDG_CURRENT_DESKTOP" ]]; then de="${de/'X-'}" @@ -581,7 +581,7 @@ get_de() { get_wm() { # If function was run, stop here. - (( "$wm_run" == 1 )) && return + (( wm_run == 1 )) && return if [[ -n "$DISPLAY" && "$os" != "Mac OS X" ]]; then id="$(xprop -root -notype | awk '$1=="_NET_SUPPORTING_WM_CHECK:"{print $5}')" @@ -610,8 +610,8 @@ get_wm() { } get_wm_theme() { - (( "$wm_run" != 1 )) && get_wm - (( "$de_run" != 1 )) && get_de + (( wm_run != 1 )) && get_wm + (( de_run != 1 )) && get_de case "$wm" in "E16") wm_theme="$(awk -F "= " '/theme.name/ {print $2}' "${HOME}/.e16/e_config--0.0.cfg")";; @@ -1345,7 +1345,7 @@ get_style() { if [[ -n "$DISPLAY" && "$os" != "Mac OS X" ]]; then # Get DE if user has disabled the function. - (( "$de_run" != 1 )) && get_de + (( de_run != 1 )) && get_de # Check for DE Theme. case "$de" in @@ -1502,7 +1502,7 @@ get_font() { get_term() { # If function was run, stop here. - (( "$term_run" == 1 )) && return + (( term_run == 1 )) && return # Workaround for macOS systems that # don't support the block below. @@ -1532,7 +1532,7 @@ get_term() { } get_term_font() { - (( "$term_run" != 1 )) && get_term + (( term_run != 1 )) && get_term case "$term" in "urxvt" | "urxvtd" | "xterm") @@ -2021,7 +2021,7 @@ get_wallpaper() { case "$os" in "Linux" | "BSD" | "Solaris" | "MINIX") # Get DE if user has disabled the function. - (( "$de_run" != 1 )) && get_de + (( de_run != 1 )) && get_de case "$de" in "MATE"*) image="$(gsettings get org.mate.background picture-filename)" ;; @@ -2928,7 +2928,7 @@ get_term_padding() { # # Note: This issue only seems to affect # URxvt. - (( "$term_run" != 1 )) && get_term + (( term_run != 1 )) && get_term case "$term" in "URxvt"*) From 0b188d7c5588ec333116e1d3af74778739465c2e Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 2 Jan 2017 11:46:07 +1100 Subject: [PATCH 2/4] DE: Check that WM isn't empty --- neofetch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neofetch b/neofetch index 148ff2b4..1547b02d 100755 --- a/neofetch +++ b/neofetch @@ -556,7 +556,7 @@ get_de() { # the desktop variables are sometimes also set to the # window manager name. This checks to see if WM == DE # and dicards the DE value. - [[ "$de" =~ $wm ]] && { unset -v de; return; } + [[ "$wm" && "$de" =~ $wm ]] && { unset -v de; return; } ;; esac From 8bacdc2cc1e6d0cfbd48f49b702148f03065432d Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 2 Jan 2017 11:48:23 +1100 Subject: [PATCH 3/4] DE: Fix empty var --- neofetch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neofetch b/neofetch index 1547b02d..31ecdb13 100755 --- a/neofetch +++ b/neofetch @@ -539,7 +539,7 @@ get_de() { (( wm_run != 1 )) && get_wm if [[ "$XDG_CURRENT_DESKTOP" ]]; then - de="${de/'X-'}" + de="${XDG_CURRENT_DESKTOP/'X-'}" de="${de/Budgie:GNOME/Budgie}" elif [[ "$DESKTOP_SESSION" ]]; then From 315dfc1ef0e440243767be72a5d5616dfff8c6f9 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 2 Jan 2017 11:50:29 +1100 Subject: [PATCH 4/4] General: Fix spacing --- neofetch | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/neofetch b/neofetch index 31ecdb13..caa82a20 100755 --- a/neofetch +++ b/neofetch @@ -524,7 +524,7 @@ get_shell() { get_de() { # If function was run, stop here. - (( de_run == 1 )) && return + ((de_run == 1)) && return case "$os" in "Mac OS X") de="Aqua" ;; @@ -536,7 +536,7 @@ get_de() { ;; *) - (( wm_run != 1 )) && get_wm + ((wm_run != 1)) && get_wm if [[ "$XDG_CURRENT_DESKTOP" ]]; then de="${XDG_CURRENT_DESKTOP/'X-'}" @@ -581,7 +581,7 @@ get_de() { get_wm() { # If function was run, stop here. - (( wm_run == 1 )) && return + ((wm_run == 1)) && return if [[ -n "$DISPLAY" && "$os" != "Mac OS X" ]]; then id="$(xprop -root -notype | awk '$1=="_NET_SUPPORTING_WM_CHECK:"{print $5}')" @@ -610,8 +610,8 @@ get_wm() { } get_wm_theme() { - (( wm_run != 1 )) && get_wm - (( de_run != 1 )) && get_de + ((wm_run != 1)) && get_wm + ((de_run != 1)) && get_de case "$wm" in "E16") wm_theme="$(awk -F "= " '/theme.name/ {print $2}' "${HOME}/.e16/e_config--0.0.cfg")";; @@ -1345,7 +1345,7 @@ get_style() { if [[ -n "$DISPLAY" && "$os" != "Mac OS X" ]]; then # Get DE if user has disabled the function. - (( de_run != 1 )) && get_de + ((de_run != 1)) && get_de # Check for DE Theme. case "$de" in @@ -1502,7 +1502,7 @@ get_font() { get_term() { # If function was run, stop here. - (( term_run == 1 )) && return + ((term_run == 1)) && return # Workaround for macOS systems that # don't support the block below. @@ -1532,7 +1532,7 @@ get_term() { } get_term_font() { - (( term_run != 1 )) && get_term + ((term_run != 1)) && get_term case "$term" in "urxvt" | "urxvtd" | "xterm") @@ -2021,7 +2021,7 @@ get_wallpaper() { case "$os" in "Linux" | "BSD" | "Solaris" | "MINIX") # Get DE if user has disabled the function. - (( de_run != 1 )) && get_de + ((de_run != 1)) && get_de case "$de" in "MATE"*) image="$(gsettings get org.mate.background picture-filename)" ;; @@ -2928,7 +2928,7 @@ get_term_padding() { # # Note: This issue only seems to affect # URxvt. - (( term_run != 1 )) && get_term + ((term_run != 1)) && get_term case "$term" in "URxvt"*)