Variabeln für anpassung der Schrift
This commit is contained in:
		
							
								
								
									
										15
									
								
								motd.sh
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								motd.sh
									
									
									
									
									
								
							| @@ -1,6 +1,6 @@ | |||||||
| # Fancy waifu motd | # 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 | CACHEFILE="/tmp/waifu.cache"          # to cache waifu state | ||||||
| RESOLUTION=256                        # resolution of waifu | RESOLUTION=256                        # resolution of waifu | ||||||
| CENTER=true                           # center motd? | CENTER=true                           # center motd? | ||||||
| @@ -9,6 +9,8 @@ UNAMEARG="-sr"                        # uname arguments | |||||||
| UPTIMEARG="--pretty"                  # uptime arguments | UPTIMEARG="--pretty"                  # uptime arguments | ||||||
| tput_cols=$(/usr/bin/tput cols)       # terminal columns | tput_cols=$(/usr/bin/tput cols)       # terminal columns | ||||||
| MINTERMWIDTH=200                      # minimal width of term, to display motd | 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 | WAIFUS=$(($(ls $MOTDPATH/waifus/*.256.png | wc -w) - 1))   # count of waifus | ||||||
|  |  | ||||||
| @@ -26,24 +28,31 @@ function output() { | |||||||
|  |  | ||||||
|     1) |     1) | ||||||
|       /bin/cat $MOTDPATH/motd | $lx |       /bin/cat $MOTDPATH/motd | $lx | ||||||
|  |       echo "test" | ||||||
|  |       echo -en $UNAMECOLOR | ||||||
|       uname $UNAMEARG | $lx |       uname $UNAMEARG | $lx | ||||||
|  |       echo -en $UPTIMECOLOR | ||||||
|       uptime $UPTIMEARG | $lx |       uptime $UPTIMEARG | $lx | ||||||
|       ;; |       ;; | ||||||
|  |  | ||||||
|     2) |     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, ""; }' |       /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, ""; }' |       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, ""; }' |       uptime $UPTIMEARG | awk '{ z = '$tput_cols' - length; y = int(z / 2); x = z - y; printf "%*s%s%*s\n", x, "", $0, y, ""; }' | ||||||
|       ;; |       ;; | ||||||
|  |  | ||||||
|     3) |     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 |       /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 |       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 |       uptime $UPTIMEARG | awk '{ z = '$tput_cols' - length; y = int(z / 2); x = z - y; printf "%*s%s%*s\n", x, "", $0, y, ""; }' | $lx | ||||||
|       ;; |       ;; | ||||||
|   esac |   esac | ||||||
| } |  | ||||||
|  |  | ||||||
|  | printf  '\033[0m' #reset colors | ||||||
|  | } | ||||||
|  |  | ||||||
| # if [ $tput_cols -gt $MINTERMWIDTH ] | # if [ $tput_cols -gt $MINTERMWIDTH ] | ||||||
| # then | # then | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user