More options in motd.sh

This commit is contained in:
sevi-kun 2021-07-16 02:55:53 +02:00
parent bc6a8bf6b3
commit fb93fab2ab
162 changed files with 51 additions and 21 deletions

4
motd
View File

@ -1,4 +0,0 @@
_
/ \| _. _ ._o._ _. _ _.o._ _ _. _ _ _ _ _|_ oo._ _ _.._ _ _.|
\_/|<(_|(/_| || |(_|_>(_||| | |(_|_>(/_o (_|(_)_>| ||_|||| |_>(_|| | |(_|o
/ _| _|

62
motd.sh
View File

@ -1,8 +1,46 @@
# Fancy waifu motd # Fancy waifu motd
WAIFUS=52 WAIFUS=52 # count of waifus
CACHEFILE="$HOME/.cache/waifu" RESOLUTION=128 # resolution of waifu
MINTERMWIDTH=200 CACHEFILE="$HOME/.cache/waifu" # to cache waifu state
MINTERMWIDTH=200 # minimal width of term, to display motd
CENTER=true # center motd?
LOLCAT=false # use lolcat?
UNAMEARG="-sr" # uname arguments
UPTIMEARG="--pretty" # uptime arguments
output() {
val=0
if [ $1 == "true" ]; then val=$(($val + 1)); fi
if [ $2 == "true" ]; then val=$(($val + 2)); fi
if [ -f "/usr/games/lolcat" ]; then lx="/usr/games/lolcat"; else lx="/usr/bin/lolcat"; fi
case "$val" in
0)
/bin/cat /usr/share/motd/motd
uname $UNAMEARG
uptime $UPTIMEARG
;;
1)
/bin/cat /usr/share/motd/motd | $lx
uname $UNAMEARG | $lx
uptime $UPTIMEARG | $lx
;;
2)
/bin/cat /usr/share/motd/motd | awk '{ z = '$(tput cols)' - length; y = int(z / 2); x = z - y; printf "%*s%s%*s\n", x, "", $0, y, ""; }'
uname $UNAMEARG | awk '{ z = '$(tput cols)' - length; y = int(z / 2); x = z - y; printf "%*s%s%*s\n", x, "", $0, y, ""; }'
uptime $UPTIMEARG | awk '{ z = '$(tput cols)' - length; y = int(z / 2); x = z - y; printf "%*s%s%*s\n", x, "", $0, y, ""; }'
;;
3)
/bin/cat /usr/share/motd/motd | awk '{ z = '$(tput cols)' - length; y = int(z / 2); x = z - y; printf "%*s%s%*s\n", x, "", $0, y, ""; }' | $lx
uname $UNAMEARG | awk '{ z = '$(tput cols)' - length; y = int(z / 2); x = z - y; printf "%*s%s%*s\n", x, "", $0, y, ""; }' | $lx
uptime $UPTIMEARG | awk '{ z = '$(tput cols)' - length; y = int(z / 2); x = z - y; printf "%*s%s%*s\n", x, "", $0, y, ""; }' | $lx
;;
esac
}
if [ $(tput cols) -gt $MINTERMWIDTH ] if [ $(tput cols) -gt $MINTERMWIDTH ]
then then
@ -23,22 +61,14 @@ then
echo 0 > $CACHEFILE echo 0 > $CACHEFILE
WAIFU=$((0 + RANDOM % $WAIFUS)) WAIFU=$((0 + RANDOM % $WAIFUS))
else else
echo $(expr $WAIFU + 1) > $CACHEFILE echo $(($WAIFU + 1)) > $CACHEFILE
fi fi
kitty +kitten icat "/usr/share/motd/waifus/waifu-$WAIFU.png" if $CENTER; then kitty +kitten icat "/usr/share/motd/waifus/waifu-$WAIFU.$RESOLUTION.png"; else kitty +kitten icat --align left "/usr/share/motd/waifus/waifu-$WAIFU.$RESOLUTION.png"; fi
else else
kitty +kitten icat "/usr/share/motd/waifus/waifu-$((0 + RANDOM % $WAIFUS)).png" if $CENTER; then kitty +kitten icat "/usr/share/motd/waifus/waifu-$((0 + RANDOM % $WAIFUS)).$RESOLUTION.png"; else kitty +kitten icat --align left "/usr/share/motd/waifus/waifu-$((0 + RANDOM % $WAIFUS)).$RESOLUTION.png"; fi
fi fi
fi fi
if [ -f "/usr/games/lolcat" ] output $LOLCAT $CENTER
then
cat /usr/share/motd/motd | awk '{ z = '$(tput cols)' - length; y = int(z / 2); x = z - y; printf "%*s%s%*s\n", x, "", $0, y, ""; }' | /usr/games/lolcat
uname -sr | awk '{ z = '$(tput cols)' - length; y = int(z / 2); x = z - y; printf "%*s%s%*s\n", x, "", $0, y, ""; }' | /usr/games/lolcat
uptime | awk '{ z = '$(tput cols)' - length; y = int(z / 2); x = z - y; printf "%*s%s%*s\n", x, "", $0, y, ""; }' | /usr/games/lolcat
else
cat /usr/share/motd/motd | awk '{ z = '$(tput cols)' - length; y = int(z / 2); x = z - y; printf "%*s%s%*s\n", x, "", $0, y, ""; }' | lolcat
uname -sr | awk '{ z = '$(tput cols)' - length; y = int(z / 2); x = z - y; printf "%*s%s%*s\n", x, "", $0, y, ""; }' | lolcat
uptime | awk '{ z = '$(tput cols)' - length; y = int(z / 2); x = z - y; printf "%*s%s%*s\n", x, "", $0, y, ""; }' | lolcat
fi fi
fi

4
motd_bak Normal file
View File

@ -0,0 +1,4 @@
_
/ \| _. _ ._o._ _. _ _.o._ _ _. _ _ _ _ _|_ oo._ _ _.._ _ _.|
\_/|<(_|(/_| || |(_|_>(_||| | |(_|_>(/_o (_|(_)_>| ||_|||| |_>(_|| | |(_|o
/ _| _|

BIN
waifus/waifu-0.128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

BIN
waifus/waifu-0.64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
waifus/waifu-1.128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View File

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 64 KiB

BIN
waifus/waifu-1.64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
waifus/waifu-10.128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

View File

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 81 KiB

BIN
waifus/waifu-10.64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
waifus/waifu-11.128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

View File

Before

Width:  |  Height:  |  Size: 72 KiB

After

Width:  |  Height:  |  Size: 72 KiB

BIN
waifus/waifu-11.64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
waifus/waifu-12.128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB

BIN
waifus/waifu-12.64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
waifus/waifu-13.128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

BIN
waifus/waifu-13.64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
waifus/waifu-14.128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 65 KiB

BIN
waifus/waifu-14.64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
waifus/waifu-15.128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

View File

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 76 KiB

BIN
waifus/waifu-15.64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
waifus/waifu-16.128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 56 KiB

BIN
waifus/waifu-16.64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
waifus/waifu-17.128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View File

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 55 KiB

BIN
waifus/waifu-17.64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
waifus/waifu-18.128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

BIN
waifus/waifu-18.64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

BIN
waifus/waifu-19.128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB

BIN
waifus/waifu-19.64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

BIN
waifus/waifu-2.128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB

BIN
waifus/waifu-2.64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
waifus/waifu-20.128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

View File

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 69 KiB

BIN
waifus/waifu-20.64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
waifus/waifu-21.128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

View File

Before

Width:  |  Height:  |  Size: 87 KiB

After

Width:  |  Height:  |  Size: 87 KiB

BIN
waifus/waifu-21.64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
waifus/waifu-22.128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

View File

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 75 KiB

BIN
waifus/waifu-22.64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
waifus/waifu-23.128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

View File

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 94 KiB

BIN
waifus/waifu-23.64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
waifus/waifu-24.128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

BIN
waifus/waifu-24.64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
waifus/waifu-25.128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View File

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 62 KiB

BIN
waifus/waifu-25.64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
waifus/waifu-26.128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

BIN
waifus/waifu-26.64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

BIN
waifus/waifu-27.128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

BIN
waifus/waifu-27.64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

BIN
waifus/waifu-28.128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

View File

Before

Width:  |  Height:  |  Size: 111 KiB

After

Width:  |  Height:  |  Size: 111 KiB

BIN
waifus/waifu-28.64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
waifus/waifu-29.128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 68 KiB

BIN
waifus/waifu-29.64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
waifus/waifu-3.128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View File

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 59 KiB

BIN
waifus/waifu-3.64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
waifus/waifu-30.128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

BIN
waifus/waifu-30.64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
waifus/waifu-31.128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 41 KiB

BIN
waifus/waifu-31.64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

BIN
waifus/waifu-32.128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

View File

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 74 KiB

BIN
waifus/waifu-32.64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
waifus/waifu-33.128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View File

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB

BIN
waifus/waifu-33.64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
waifus/waifu-34.128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View File

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB

BIN
waifus/waifu-34.64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
waifus/waifu-35.128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

View File

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 71 KiB

BIN
waifus/waifu-35.64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
waifus/waifu-36.128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 56 KiB

BIN
waifus/waifu-36.64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
waifus/waifu-37.128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 67 KiB

BIN
waifus/waifu-37.64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
waifus/waifu-38.128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Some files were not shown because too many files have changed in this diff Show More