config/neofetch: update weather and add pinfo

This commit is contained in:
xeruf 2022-04-24 10:20:12 +02:00
parent 8abac2299c
commit 4d5b5893da
2 changed files with 17 additions and 19 deletions

View File

@ -8,7 +8,7 @@ print_info() {
info "OS" distro info "OS" distro
info "Host" model info "Host" model
info "Memory" memory 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 ) )" prin "IP" "$(timeout .4s ( curl --max-time 0.3 ifconfig.me && printf " / " && curl icanhazip.com ) )"
} }

View File

@ -3,24 +3,23 @@
# See this wiki page for more info: # See this wiki page for more info:
# https://github.com/dylanaraps/neofetch/wiki/Customizing-Info # https://github.com/dylanaraps/neofetch/wiki/Customizing-Info
pinfo() {
info "$@" | sed -e 's/\x1b\[[0-9;]*[mC]//g' | xargs
}
print_info() { print_info() {
info title info title
info underline info underline
info "OS" distro
info "Host" model info "Host" model
info "Kernel" kernel prin "OS" "$(pinfo distro) $(pinfo kernel)"
info "Uptime" uptime info "Uptime" uptime
info "Packages" packages
info "Shell" shell
info "Resolution" resolution info "Resolution" resolution
info "Packages" packages
prin "Terminal" "$(pinfo term) $(pinfo "with font" term_font) running $(pinfo shell)"
info "DE" de info "DE" de
info "WM" wm prin "WM" "$(pinfo wm) $(pinfo wm_theme)"
info "WM Theme" wm_theme prin "Theme" "$(pinfo theme) $(pinfo "with icons" icons)"
info "Theme" theme
info "Icons" icons
info "Terminal" term
info "Terminal Font" term_font
info "CPU" cpu info "CPU" cpu
info "GPU" gpu info "GPU" gpu
info "Memory" memory info "Memory" memory
@ -28,22 +27,21 @@ print_info() {
# info "GPU Driver" gpu_driver # Linux/macOS only # info "GPU Driver" gpu_driver # Linux/macOS only
# info "CPU Usage" cpu_usage # info "CPU Usage" cpu_usage
# info "Disk" disk # info "Disk" disk
# info "Battery" battery info "Battery" battery
# info "Font" font # info "Font" font
# info "Song" song # info "Song" song
# info "Local IP" local_ip # info "Local IP" local_ip
# info "Public IP" public_ip
# info "Users" users # info "Users" users
# info "Install Date" install_date # info "Install Date" install_date
# info "Locale" locale # This only works on glibc systems. # 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)" 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 cols
info line_break
} }
@ -100,7 +98,7 @@ os_arch="on"
# on: '2 days, 10 hours, 3 mins' # on: '2 days, 10 hours, 3 mins'
# off: '2 days, 10 hours, 3 minutes' # off: '2 days, 10 hours, 3 minutes'
# tiny: '2d 10h 3m' # tiny: '2d 10h 3m'
uptime_shorthand="on" uptime_shorthand="off"
# Shell # Shell
@ -115,7 +113,7 @@ uptime_shorthand="on"
# Example: # Example:
# on: '/bin/bash' # on: '/bin/bash'
# off: 'bash' # off: 'bash'
shell_path="off" shell_path="on"
# Show $SHELL version # Show $SHELL version
# #