From df0e8ad678528138761143d64256e0c1679794d7 Mon Sep 17 00:00:00 2001 From: LordLexeloid Date: Mon, 15 Nov 2021 11:00:18 +0100 Subject: [PATCH] =?UTF-8?q?Variabeln=20f=C3=BCr=20anpassung=20der=20Schrif?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- motd.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/motd.sh b/motd.sh index 107733e..110b39d 100755 --- a/motd.sh +++ b/motd.sh @@ -1,6 +1,6 @@ # Fancy waifu motd -MOTDPATH="$HOME/.motd" # path to motd folder +MOTDPATH="$HOME/src/motd" # path to motd folder CACHEFILE="/tmp/waifu.cache" # to cache waifu state RESOLUTION=256 # resolution of waifu CENTER=true # center motd? @@ -9,6 +9,8 @@ UNAMEARG="-sr" # uname arguments UPTIMEARG="--pretty" # uptime arguments tput_cols=$(/usr/bin/tput cols) # terminal columns MINTERMWIDTH=200 # minimal width of term, to display motd +UNAMECOLOR="\033[1;38;5;93m" +UPTIMECOLOR="\033[1;38;5;99m" WAIFUS=$(($(ls $MOTDPATH/waifus/*.256.png | wc -w) - 1)) # count of waifus @@ -26,24 +28,31 @@ function output() { 1) /bin/cat $MOTDPATH/motd | $lx + echo "test" + echo -en $UNAMECOLOR uname $UNAMEARG | $lx + echo -en $UPTIMECOLOR uptime $UPTIMEARG | $lx ;; 2) /bin/cat $MOTDPATH/motd | awk '{ z = '$tput_cols' - length; y = int(z / 2); x = z - y; printf "%*s%s%*s\n", x, "", $0, y, ""; }' + echo -en $UNAMECOLOR uname $UNAMEARG | awk '{ z = '$tput_cols' - length; y = int(z / 2); x = z - y; printf "%*s%s%*s\n", x, "", $0, y, ""; }' + echo -en $UPTIMECOLOR 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 $MOTDPATH/motd | awk '{ z = '$tput_cols' - length; y = int(z / 2); x = z - y; printf "%*s%s%*s\n", x, "", $0, y, ""; }' | $lx + echo -en $UNAMECOLOR uname $UNAMEARG | awk '{ z = '$tput_cols' - length; y = int(z / 2); x = z - y; printf "%*s%s%*s\n", x, "", $0, y, ""; }' | $lx + echo -en $UPTIMECOLOR uptime $UPTIMEARG | awk '{ z = '$tput_cols' - length; y = int(z / 2); x = z - y; printf "%*s%s%*s\n", x, "", $0, y, ""; }' | $lx ;; esac -} +printf '\033[0m' #reset colors +} # if [ $tput_cols -gt $MINTERMWIDTH ] # then