Add changes from #2, thanks @ix
This commit is contained in:
parent
f808a9c076
commit
e3780099f4
18
fetch.sh
18
fetch.sh
|
@ -127,7 +127,11 @@ title="$(whoami)@$(hostname)"
|
||||||
|
|
||||||
# Operating System (Configurable with "-O" and "--distro" at launch)
|
# Operating System (Configurable with "-O" and "--distro" at launch)
|
||||||
# You can manually set this if the command below doesn't work for you.
|
# You can manually set this if the command below doesn't work for you.
|
||||||
os=$(awk '/^NAME=/' /etc/*ease | sed -n 's/^NAME=//p' | tr -d '"')
|
if type -p crux >/dev/null 2>&1; then
|
||||||
|
os="CRUX"
|
||||||
|
else
|
||||||
|
os=$(awk '/^NAME=/' /etc/*ease | sed -n 's/^NAME=//p' | tr -d '"')
|
||||||
|
fi
|
||||||
|
|
||||||
# Linux kernel name/version (Configurable with "-K" and "--kernel" at launch)
|
# Linux kernel name/version (Configurable with "-K" and "--kernel" at launch)
|
||||||
kernel=$(uname -r)
|
kernel=$(uname -r)
|
||||||
|
@ -199,7 +203,11 @@ cpuspeed () {
|
||||||
memory=$(free -m | awk '/Mem:/ {printf $3 "MB / " $2 "MB"}')
|
memory=$(free -m | awk '/Mem:/ {printf $3 "MB / " $2 "MB"}')
|
||||||
|
|
||||||
# Currently playing song/artist (Configurable with "-m" and "--song" at launch)
|
# Currently playing song/artist (Configurable with "-m" and "--song" at launch)
|
||||||
song=$(mpc current)
|
if type -p mpc >/dev/null 2>&1; then
|
||||||
|
song=$(mpc current)
|
||||||
|
else
|
||||||
|
song="Unknown"
|
||||||
|
fi
|
||||||
|
|
||||||
# Print terminal colors in a line
|
# Print terminal colors in a line
|
||||||
# (Configurable with "--printcols start end" at launch)
|
# (Configurable with "--printcols start end" at launch)
|
||||||
|
@ -488,9 +496,11 @@ printf "\n"
|
||||||
# Enable line wrap again
|
# Enable line wrap again
|
||||||
[ $linewrap -eq 0 ] && tput smam
|
[ $linewrap -eq 0 ] && tput smam
|
||||||
|
|
||||||
# Display the image
|
# If w3mimgviewer is found Display the image
|
||||||
printf "0;1;$xoffset;$yoffset;$imgsize;$imgsize;;;;;$img\n4;\n3;" |\
|
if type -p /usr/lib/w3m/w3mimgdisplay >/dev/null 2>&1; then
|
||||||
|
printf "0;1;$xoffset;$yoffset;$imgsize;$imgsize;;;;;$img\n4;\n3;" |\
|
||||||
/usr/lib/w3m/w3mimgdisplay
|
/usr/lib/w3m/w3mimgdisplay
|
||||||
|
fi
|
||||||
|
|
||||||
# Show the cursor again
|
# Show the cursor again
|
||||||
tput cnorm
|
tput cnorm
|
||||||
|
|
Reference in New Issue