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. diff --git a/config/config b/config/config index 7375e390..2d021d07 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 {{{ @@ -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" @@ -368,12 +366,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..9cf0f049 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 @@ -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" # }}} @@ -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") @@ -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 @@ -2052,9 +2055,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 +2723,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