Compare commits

...

12 Commits

Author SHA1 Message Date
529e71f854 Fixing waifus and adding refined rename script 2025-02-16 23:39:25 +01:00
d7f063b128 Cleaning up from end up till 300 manually 2025-02-16 23:10:20 +01:00
022c9d8fff cleanup waifus + adding script for missing waifu detection 2023-12-11 23:05:05 +01:00
4e9d0b8c03 add new waifus 2023-12-11 22:18:22 +01:00
fe20bfdc1c add new waifus till 442 2023-08-27 22:14:07 +02:00
93e6c14ede Change cache location 2023-08-27 22:13:39 +02:00
f68fc3234d switch submodule url 2022-12-18 14:12:23 +01:00
a36b2aa3f8 Fixing colors when is disabled lolcat 2022-08-19 21:46:07 +02:00
d1ad88abd3 Added make to lolcat instructions 2022-05-25 21:13:25 +02:00
d7517bd21d Fixed link 2022-05-24 22:55:41 +02:00
7e0460cb6c Change lolcat path 2022-05-24 22:52:03 +02:00
afe8a29a24 Updated readme for lolcat 2022-05-24 22:50:50 +02:00
1442 changed files with 110 additions and 23 deletions

2
.gitmodules vendored
View File

@ -1,3 +1,3 @@
[submodule "lolcat"]
path = lolcat
url = git@github.com:jaseg/lolcat.git
url = https://github.com/sevi-kun/lolcat.git

View File

@ -12,6 +12,22 @@ Just a little script and some 256x images for some terminal shine UwU.
Just place this folder somewhere, and add the path of the motd.sh to your .bashrc.
```
git clone https://git.nussnougate.net/Lexeloid/.motd.git
```
### lolcat
> For faster lolcat we use a C implementation from [jaseg](https://github.com/jaseg/lolcat).
```
git submodule init
git submodule update
cd lolcat
make
```
## Limitations
At the moment, it only works in the kitty terminal.

57
motd.sh
View File

@ -1,41 +1,56 @@
# Fancy waifu motd
#####################################################################
# #
# Fancy waifu motd #
# #
#####################################################################
MOTDPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" # path to motd folder
CACHEFILE="/tmp/waifu.cache" # to cache waifu state
RESOLUTION=256 # resolution of waifu
CENTER=true # center motd?
LOLCAT=false # use lolcat? (start delay)
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
##### User config
#####################################################################
RESOLUTION=128 # resolution of waifu
CENTER=true # center motd?
LOLCAT=true # use lolcat? (start delay)
UNAMEARG="-sr" # uname arguments
UPTIMEARG="--pretty" # uptime arguments
MINTERMWIDTH=100 # minimal width of term, to display motd (change depending on resolution, 0 to disable)
MOTDCOLOR="\033[0m" # Bash color code for motd text (no lolcat)
UNAMECOLOR="\033[0m" # Bash color code for uname (no lolcat)
UPTIMECOLOR="\033[0m" # Bash color code for uptime (no lolcat)
#####################################################################
##### Script config
#####################################################################
CACHEFILE="$HOME/.cache/waifu.cache" # to cache waifu state
MOTDPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" # path to motd folder
tput_cols=$(/usr/bin/tput cols) # terminal columns
WAIFUS=$(($(ls $MOTDPATH/waifus/*.256.png | wc -w) - 1)) # count of waifus
lx="$MOTDPATH/lolcat/lolcat" # lolcat
#####################################################################
function 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)
echo -en $UPTIMECOLOR
/bin/cat $MOTDPATH/motd
echo -en $UNAMECOLOR
uname $UNAMEARG
echo -en $UPTIMECOLOR
uptime $UPTIMEARG
;;
1)
/bin/cat $MOTDPATH/motd | $lx
echo "test"
echo -en $UNAMECOLOR
uname $UNAMEARG | $lx
echo -en $UPTIMECOLOR
uptime $UPTIMEARG | $lx
;;
2)
echo -en $MOTDCOLOR
/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, ""; }'
@ -44,9 +59,7 @@ function output() {
;;
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
@ -54,8 +67,8 @@ function output() {
printf '\033[0m' #reset colors
}
# if [ $tput_cols -gt $MINTERMWIDTH ]
# then
if [ $tput_cols -gt $MINTERMWIDTH ]
then
if [ $TERM == "xterm-kitty" ]
then
if [ $((0 + RANDOM % 2)) -eq 0 ]
@ -81,4 +94,4 @@ printf '\033[0m' #reset colors
fi
fi
output $LOLCAT $CENTER
# fi
fi

13
waifus/count.py Normal file
View File

@ -0,0 +1,13 @@
# This script checks if corresponding png in format waifu-<count>.<res>.png exists. Values for <res> can be 64, 128, 256.
import sys
import os
count = 513
for i in range(1, count + 1):
for res in [64, 128, 256]:
filename = "waifu-" + str(i) + "." + str(res) + ".png"
if not os.path.exists(filename):
print(filename)

45
waifus/rename.sh Normal file
View File

@ -0,0 +1,45 @@
#!/bin/bash
shopt -s nullglob # Prevent errors if no files match
# Create a temporary directory
temp_dir=$(mktemp -d)
# Associative array to store unique image bases
declare -A unique_images
# Extract base names without resolution suffix
for file in *.64.png; do
base="${file%.64.png}"
unique_images["$base"]=1
done
# Convert keys to sorted array
unique_bases=("${!unique_images[@]}")
IFS=$'\n' sorted_bases=($(sort <<<"${unique_bases[*]}"))
unset IFS
# Renaming process
counter=0
for base in "${sorted_bases[@]}"; do
for res in 64 128 256; do
old_file="${base}.${res}.png"
new_file="${temp_dir}/waifu-${counter}.${res}.png"
if [[ -f "$old_file" ]]; then
mv "$old_file" "$new_file"
echo "Copied: $old_file -> $new_file"
fi
done
((counter++))
done
# Move the renamed files back
echo "Moving new files back..."
mv "${temp_dir}"/* .
# Remove the temporary directory
rmdir "${temp_dir}"
echo "Renaming complete and safe!"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 42 KiB

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