Variabeln für anpassung der Schrift
This commit is contained in:
		
							
								
								
									
										15
									
								
								motd.sh
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user