From cf3418d994969b85b685fae09376009d28844022 Mon Sep 17 00:00:00 2001 From: Dylan Date: Sat, 19 Mar 2016 09:37:29 +1100 Subject: [PATCH 1/6] Fixed bugs with scrot usage --- config/config | 6 +++--- neofetch | 15 ++++++++++----- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/config/config b/config/config index 7375e390..18f6864f 100644 --- a/config/config +++ b/config/config @@ -6,7 +6,7 @@ # Speed up script by not using unicode export LC_ALL=C -export LANG=c +export LANG=C export LANGUAGE=C # Info Options {{{ @@ -368,12 +368,12 @@ scrot_cmd="scrot -c -d 3" # Scrot dir # Where to save the screenshots # --scrot_dir /path/to/screenshot/folder -scrot_dir="$HOME/Pictures" +scrot_dir="$HOME/Pictures/" # Scrot filename # What to name the screenshots # --scrot_name str -scrot_name="neofetch-%Y-%m-%d-%H:%M.png" +scrot_name="neofetch-$(date +%F-%T).png" # }}} diff --git a/neofetch b/neofetch index cfaea51b..41807510 100755 --- a/neofetch +++ b/neofetch @@ -388,12 +388,12 @@ scrot_cmd="scrot -c -d 3" # Scrot dir # Where to save the screenshots # --scrot_dir /path/to/screenshot/folder -scrot_dir="$HOME/Pictures" +scrot_dir="$HOME/Pictures/" # Scrot filename # What to name the screenshots # --scrot_name str -scrot_name="neofetch-%Y-%m-%d-%H:%M.png" +scrot_name="neofetch-$(date +%F-%T).png" # }}} @@ -2052,9 +2052,8 @@ getimage () { img="$thumbnail_dir/$imgname" } -scrot_path="$scrot_dir/$scrot_name" takescrot () { - $scrot_cmd "$scrot_path" + $scrot_cmd "${scrot_dir}${scrot_name}" } # }}} @@ -2721,7 +2720,13 @@ while [ "$1" ]; do --ascii_logo_size) ascii_logo_size="$2" ;; # Screenshot - --scrot | -s) scrot="on"; [ "$2" ] && scrot_path="$2" ;; + --scrot | -s) + scrot="on" + if [ "$2" ]; then + scrot_name="${2##*/}" + scrot_dir="${2/$scrot_name}" + fi + ;; --scrot_cmd) scrot_cmd="$2" ;; # Stdout From c120a4daa6f1221caecb953d77571dcb477e3f74 Mon Sep 17 00:00:00 2001 From: Dylan Date: Sat, 19 Mar 2016 10:58:03 +1100 Subject: [PATCH 2/6] Fix typo in function namne --- neofetch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neofetch b/neofetch index cfaea51b..8a9078af 100755 --- a/neofetch +++ b/neofetch @@ -55,7 +55,7 @@ printinfo () { info "GPU" gpu info "Memory" memory - # info "Font" gtkfont + # info "Font" font # info "Disk" disk # info "Battery" battery # info "Song" song From bb95137f01514d2b6a93dbffdbe4a5f52ccb8fa0 Mon Sep 17 00:00:00 2001 From: Andrew Titmuss Date: Sat, 19 Mar 2016 13:32:33 +1100 Subject: [PATCH 3/6] changed case to if, shaves 0.1 seconds from run time --- neofetch | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/neofetch b/neofetch index cfaea51b..4e1aa4fa 100755 --- a/neofetch +++ b/neofetch @@ -589,23 +589,23 @@ getuptime () { days=$((uptime / 86400)) # Format the output like Linux's "uptime -p" cmd. - case "$mins" in - 0) ;; - 1) uptime="up $mins minute" ;; - *) uptime="up $mins minutes" ;; - esac + if [ "$mins" == 1 ]; then + uptime="up $mins minute" + elif [ "$mins" != 0 ]; then + uptime="up $mins minutes" + fi - case "$hours" in - 0) ;; - 1) uptime="up $hours hour, ${uptime/up }" ;; - *) uptime="up $hours hours, ${uptime/up }" ;; - esac + if [ "$hours" == 1 ]; then + uptime="up $hours hour, ${uptime/up }" + elif [ "$mins" != 0 ]; then + uptime="up $hours hours, ${uptime/up }" + fi - case "$days" in - 0) ;; - 1) uptime="up $days day, ${uptime/up }" ;; - *) uptime="up $days days, ${uptime/up }" ;; - esac + if [ "$days" == 1 ]; then + uptime="up $days day, ${uptime/up }" + elif [ "$days" != 0 ]; then + uptime="up $days days, ${uptime/ up}" + fi ;; "Windows") From 5b9466cfec1798ed55ba30f708c7ad7acb536a1c Mon Sep 17 00:00:00 2001 From: Andrew Titmuss Date: Sat, 19 Mar 2016 13:38:48 +1100 Subject: [PATCH 4/6] made publicip function faster by using dig --- neofetch | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/neofetch b/neofetch index cfaea51b..c5149205 100755 --- a/neofetch +++ b/neofetch @@ -1659,7 +1659,10 @@ getlocalip () { } getpublicip () { - if type -p curl >/dev/null 2>&1; then + if type -p dig >/dev/null 2>&1; then + publicip="$(dig +short myip.opendns.com @resolver1.opendns.com)" + + elif type -p curl >/dev/null 2>&1; then publicip="$(curl -w '\n' "$public_ip_host")" elif type -p wget >/dev/null 2>&1; then From 31da3cf566087b8c60287789dbd602ddd449f699 Mon Sep 17 00:00:00 2001 From: dylan Date: Sat, 19 Mar 2016 16:56:03 +1100 Subject: [PATCH 5/6] Changelog --- 1.6.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/1.6.md b/1.6.md index 0639de8e..bfd724db 100644 --- a/1.6.md +++ b/1.6.md @@ -4,6 +4,7 @@ Thanks to the following people for contributing this release. +- **[@iandrewt](https://github.com/iandrewt)** - **[@dawidd6](https://github.com/dawidd6)** - **[@onodera-punpun](https://github.com/onodera-punpun)** @@ -11,3 +12,10 @@ Thanks to the following people for contributing this release. **OS**
- [ CRUX ] Also print the CRUX version. **[@onodera-punpun](https://github.com/onodera-punpun)** + +**Public IP**
+- Mad public IP function fasterby using `dig`. **[@iandrewt](https://github.com/iandrewt)** + + +### Scrot +- Fixed scrot function not using user defined options. From e594bbd2be194bed99e1b930aedf4aab848a2f3e Mon Sep 17 00:00:00 2001 From: Andrew Titmuss Date: Sat, 19 Mar 2016 17:34:05 +1100 Subject: [PATCH 6/6] remove second cpu_display option --- config/config | 2 -- 1 file changed, 2 deletions(-) diff --git a/config/config b/config/config index 18f6864f..2d021d07 100644 --- a/config/config +++ b/config/config @@ -260,11 +260,9 @@ progress_color_total="8" # barinfo: The bar is displayed before the info. # off: Only the info is displayed. # -# --cpu_displau bar/infobar/barinfo/off # --memory_display bar/infobar/barinfo/off # --battery_display bar/infobar/barinfo/off # --disk_display bar/infobar/barinfo/off -cpu_display="off" memory_display="off" battery_display="off" disk_display="off"