commit
3f983245bb
48
neofetch
48
neofetch
|
@ -2512,7 +2512,7 @@ trim() {
|
|||
# Error {{{
|
||||
|
||||
err() {
|
||||
err+="$(color 1)[!]$(color fg) $1
|
||||
err+="$(color 1)[!]\033[0m $1
|
||||
"
|
||||
}
|
||||
|
||||
|
@ -2598,17 +2598,6 @@ getuserconfig() {
|
|||
err "Sourced user config ($config_file)"
|
||||
}
|
||||
|
||||
# Check the commandline flags early for '--config none/off'
|
||||
case "$@" in
|
||||
*"--config off"* | *'--config "off"'* | *"--config 'off'"* | \
|
||||
*"--config none"* | *'--config "none"'* | *"--config 'none'"* | *"--stdout"*)
|
||||
config="off"
|
||||
;;
|
||||
esac
|
||||
|
||||
getdefaultconfig 2>/dev/null
|
||||
[ "${config:-on}" == "on" ] && getuserconfig 2>/dev/null
|
||||
|
||||
# }}}
|
||||
|
||||
# Progress bars {{{
|
||||
|
@ -2816,6 +2805,20 @@ exit 1
|
|||
|
||||
# Args {{{
|
||||
|
||||
getargs() {
|
||||
# Check the commandline flags early for '--config none/off'
|
||||
case "$@" in
|
||||
*"--config off"* | *'--config "off"'* | *"--config 'off'"* | \
|
||||
*"--config none"* | *'--config "none"'* | *"--config 'none'"* | *"--stdout"*)
|
||||
config="off"
|
||||
;;
|
||||
|
||||
*"--config --"*) ;;
|
||||
*"--config"*) config="off" ;;
|
||||
esac
|
||||
|
||||
[ "${config:-on}" == "on" ] && getuserconfig 2>/dev/null
|
||||
|
||||
while [ "$1" ]; do
|
||||
case $1 in
|
||||
# Info
|
||||
|
@ -2965,11 +2968,11 @@ while [ "$1" ]; do
|
|||
--test)
|
||||
info=(title underline distro kernel uptime packages shell resolution de wm wmtheme theme icons cpu cpu_usage gpu memory font disk battery song localip publicip users birthday term termfont)
|
||||
|
||||
readonly refresh_rate="on"
|
||||
readonly shell_version="on"
|
||||
readonly cpu_display="infobar"
|
||||
readonly memory_display="infobar"
|
||||
readonly disk_display="infobar"
|
||||
refresh_rate="on"
|
||||
shell_version="on"
|
||||
cpu_display="infobar"
|
||||
memory_display="infobar"
|
||||
disk_display="infobar"
|
||||
|
||||
printinfo() {
|
||||
if [ "$TRAVIS_OS_NAME" ]; then
|
||||
|
@ -2986,10 +2989,6 @@ while [ "$1" ]; do
|
|||
info linebreak
|
||||
printf "%b%s" "\033[$(tput lines)H"
|
||||
}
|
||||
|
||||
# Set the test func to readonly so a config source
|
||||
# doesn't overwrite it.
|
||||
readonly -f printinfo
|
||||
;;
|
||||
|
||||
-v) verbose="on" ;;
|
||||
|
@ -3000,12 +2999,15 @@ while [ "$1" ]; do
|
|||
|
||||
shift
|
||||
done
|
||||
}
|
||||
|
||||
# }}}
|
||||
|
||||
# Call Functions and Finish Up {{{
|
||||
|
||||
main() {
|
||||
getdefaultconfig 2>/dev/null
|
||||
getargs "$@"
|
||||
getos
|
||||
|
||||
# Restore cursor and clear screen on ctrl+c
|
||||
|
@ -3058,12 +3060,12 @@ main() {
|
|||
[ "$scrot" == "on" ] && takescrot
|
||||
|
||||
# Show error messages
|
||||
[ "$verbose" == "on" ] && printf "%s" "$err"
|
||||
[ "$verbose" == "on" ] && printf "%b%s" "$err"
|
||||
|
||||
# Reset exit status of the tests above
|
||||
printf "%s"
|
||||
}
|
||||
|
||||
main
|
||||
main "$@"
|
||||
|
||||
# }}}
|
||||
|
|
Reference in New Issue