Compare commits

..

2 Commits

Author SHA1 Message Date
julien 653e5f15d0 "Updates" 2026-04-08 13:09:12 +02:00
julien 8edb7bc02a "Updates" 2026-04-08 12:53:55 +02:00
+11 -13
View File
@@ -85,7 +85,7 @@ sudo mv /home/pleb/dptx.bin /lib/firmware/rockchip/dptx.bin
``` ```
```bash ```bash
sudo apt install -y cowsay fortune-mod toilet figlet sudo apt install -y cowsay fortune-mod toilet figlet ncal
sudo vim /etc/update-motd.d/01-cowsay sudo vim /etc/update-motd.d/01-cowsay
``` ```
@@ -103,7 +103,7 @@ sudo vim ~/local/bin/now
#!/bin/bash #!/bin/bash
# NAME: now # NAME: now
# PATH: $HOME/.local/bin # PATH: $HOME/bin
# DESC: Display current weather, calendar and time # DESC: Display current weather, calendar and time
# CALL: Called from terminal or ~/.bashrc # CALL: Called from terminal or ~/.bashrc
# DATE: Apr 6, 2017. Modified: Mar 30, 2018. # DATE: Apr 6, 2017. Modified: Mar 30, 2018.
@@ -119,10 +119,8 @@ TimeColumn=61 # Default is 49 for " " " " 61 " " " "
# Current weather, already in color so no need to override # Current weather, already in color so no need to override
echo " " echo " "
# Replace Edmonton with your city name, GPS, etc. See: curl wttr.in/:help echo " "
curl wttr.in/Rennes?0 --silent --max-time 3 curl wttr.in/Rennes?0 --silent --max-time 3
# Timeout #. Increase for slow connection---^
echo " " echo " "
echo " " # Pad with blank lines for calendar & time to fit echo " " # Pad with blank lines for calendar & time to fit
@@ -133,8 +131,8 @@ echo " " # Pad with blank lines for calendar & time to fit
# 36=cyan, 37=white # 36=cyan, 37=white
tput sc # Save cursor position. tput sc # Save cursor position.
# Move up 9 lines # Move up 10 lines
while [ $((++i)) -lt 10 ]; do tput cuu1; done while [ $((++i)) -lt 11 ]; do tput cuu1; done
# Depending on length of your city name and country name you will: # Depending on length of your city name and country name you will:
# 1. Comment out next three lines of code. Uncomment fourth code line. # 1. Comment out next three lines of code. Uncomment fourth code line.
@@ -148,7 +146,7 @@ printf " " # Blank out ", country" with x spaces
# -h needed to turn off formating: https://askubuntu.com/questions/1013954/bash-substring-stringoffsetlength-error/1013960#1013960 # -h needed to turn off formating: https://askubuntu.com/questions/1013954/bash-substring-stringoffsetlength-error/1013960#1013960
cal -h > /tmp/terminal cal > ~/tmp/terminal
CalLineCnt=1 CalLineCnt=1
Today=$(date +"%d") Today=$(date +"%d")
@@ -180,7 +178,7 @@ while IFS= read -r Cal; do
tput cud1 # Down one line tput cud1 # Down one line
tput cuf $DateColumn # Move 27 columns right tput cuf $DateColumn # Move 27 columns right
CalLineCnt=$((++CalLineCnt)) CalLineCnt=$((++CalLineCnt))
done < /tmp/terminal done < ~/tmp/terminal
printf "\033[00m" # color -- bright white (default) printf "\033[00m" # color -- bright white (default)
echo "" echo ""
@@ -198,13 +196,13 @@ tput cuf $TimeColumn # Move 49 columns right
# Do we have the toilet package? # Do we have the toilet package?
if hash toilet 2>/dev/null; then if hash toilet 2>/dev/null; then
echo " "$(date +"%I:%M %P")" " | \ echo " "$(date +"%I:%M %P")" " | \
toilet -f future --filter border > /tmp/terminal toilet -f future --filter border > ~/tmp/terminal
# Do we have the figlet package? # Do we have the figlet package?
elif hash figlet 2>/dev/null; then elif hash figlet 2>/dev/null; then
echo $(date +"%I:%M %P") | figlet > /tmp/terminal echo $(date +"%I:%M %P") | figlet > ~/tmp/terminal
# else use standard font # else use standard font
else else
echo $(date +"%I:%M %P") > /tmp/terminal echo $(date +"%I:%M %P") > ~/tmp/terminal
fi fi
while IFS= read -r Time; do while IFS= read -r Time; do
@@ -212,7 +210,7 @@ while IFS= read -r Time; do
printf "$Time" printf "$Time"
tput cud1 # Up one line tput cud1 # Up one line
tput cuf $TimeColumn # Move 49 columns right tput cuf $TimeColumn # Move 49 columns right
done < /tmp/terminal done < ~/tmp/terminal
tput rc # Restore saved cursor position. tput rc # Restore saved cursor position.