From 4d5b5893da0edaa755e4b7f9f56cfe2c27b1bc25 Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Sun, 24 Apr 2022 10:20:12 +0200 Subject: [PATCH] config/neofetch: update weather and add pinfo --- .config/neofetch/config-short.conf | 2 +- .config/neofetch/config.conf | 34 ++++++++++++++---------------- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/.config/neofetch/config-short.conf b/.config/neofetch/config-short.conf index 978b9d9..c9c3c2d 100644 --- a/.config/neofetch/config-short.conf +++ b/.config/neofetch/config-short.conf @@ -8,7 +8,7 @@ print_info() { info "OS" distro info "Host" model info "Memory" memory - prin "Weather" "$(timeout .4s curl --max-time 0.3 'wttr.in/?0?q?T' | awk '/°(C|F)/ {printf $(NF-1) $(NF) " ("a")"} /,/ {a=$0}' || echo Timeout)" + prin "Weather" "$(timeout .4s curl --max-time 1 'wttr.in/?0?q?T' | awk '/°(C|F)/ {printf $(NF-1) $(NF) " ("a")"} /,/ {a=$0}' || echo Timeout)" prin "IP" "$(timeout .4s ( curl --max-time 0.3 ifconfig.me && printf " / " && curl icanhazip.com ) )" } diff --git a/.config/neofetch/config.conf b/.config/neofetch/config.conf index aac7abd..13ffbf8 100644 --- a/.config/neofetch/config.conf +++ b/.config/neofetch/config.conf @@ -3,24 +3,23 @@ # See this wiki page for more info: # https://github.com/dylanaraps/neofetch/wiki/Customizing-Info +pinfo() { + info "$@" | sed -e 's/\x1b\[[0-9;]*[mC]//g' | xargs +} + print_info() { info title info underline - info "OS" distro info "Host" model - info "Kernel" kernel + prin "OS" "$(pinfo distro) $(pinfo kernel)" info "Uptime" uptime - info "Packages" packages - info "Shell" shell info "Resolution" resolution + info "Packages" packages + prin "Terminal" "$(pinfo term) $(pinfo "with font" term_font) running $(pinfo shell)" info "DE" de - info "WM" wm - info "WM Theme" wm_theme - info "Theme" theme - info "Icons" icons - info "Terminal" term - info "Terminal Font" term_font + prin "WM" "$(pinfo wm) $(pinfo wm_theme)" + prin "Theme" "$(pinfo theme) $(pinfo "with icons" icons)" info "CPU" cpu info "GPU" gpu info "Memory" memory @@ -28,22 +27,21 @@ print_info() { # info "GPU Driver" gpu_driver # Linux/macOS only # info "CPU Usage" cpu_usage # info "Disk" disk - # info "Battery" battery + info "Battery" battery # info "Font" font # info "Song" song # info "Local IP" local_ip - # info "Public IP" public_ip # info "Users" users # info "Install Date" install_date # info "Locale" locale # This only works on glibc systems. - prin "Weather" "$(curl wttr.in/?0?q?T -m 0.3 | awk '/°(C|F)/ {printf $(NF-1) $(NF) " ("a")"} /,/ {a=$0}' || echo Timeout)" - prin "IP" "$(curl ifconfig.me)" + #prin "IP" "$(curl ifconfig.me)" + info "Public IP" public_ip prin "IPv6" "$(curl icanhazip.com)" - info line_break + prin "Weather" "$(timeout .6s curl --max-time 1 'wttr.in/?0?q?T' | awk '/°(C|F)/ {printf $(NF-1) $(NF) " ("a")"} /,/ {a=$0}' || echo Timeout)" + info cols - info line_break } @@ -100,7 +98,7 @@ os_arch="on" # on: '2 days, 10 hours, 3 mins' # off: '2 days, 10 hours, 3 minutes' # tiny: '2d 10h 3m' -uptime_shorthand="on" +uptime_shorthand="off" # Shell @@ -115,7 +113,7 @@ uptime_shorthand="on" # Example: # on: '/bin/bash' # off: 'bash' -shell_path="off" +shell_path="on" # Show $SHELL version #