From 13b68d2929c2d6785801336bdcca5de2da5513eb Mon Sep 17 00:00:00 2001 From: czjstmax Date: Sat, 9 May 2026 15:55:17 +0200 Subject: ntfs sucks but windows users exist Signed-off-by: czjstmax --- cfg/fastfetch/?.sh | 39 --------------------------------------- cfg/fastfetch/random.sh | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 39 deletions(-) delete mode 100755 cfg/fastfetch/?.sh create mode 100755 cfg/fastfetch/random.sh (limited to 'cfg/fastfetch') diff --git a/cfg/fastfetch/?.sh b/cfg/fastfetch/?.sh deleted file mode 100755 index 311df29..0000000 --- a/cfg/fastfetch/?.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash - -# folder with ascii files -ascii_folder="/home/max/ii" -# a file to keep track of last used logo index -state_file="/tmp/fastfetch_logo_index" - -# array of ascii logo files -ascii_files=( - "$ascii_folder/maoscii.txt" - "$ascii_folder/enriscii.txt" - "$ascii_folder/marscii.txt" - "$ascii_folder/cafiscii1.txt" - "$ascii_folder/bakiscii.txt" - "$ascii_folder/cafiscii2.txt" -) - -# number of ascii files -count=${#ascii_files[@]} - -# read last index from file or start at -1 -if [[ -f "$state_file" ]]; then - last_index=$(cat "$state_file") -else - last_index=-1 -fi - -# calculate next index in rotation -next_index=$(( (last_index + 1) % count )) - -# save next index for next run -echo "$next_index" > "$state_file" - -# pick ascii file for this run -selected_ascii="${ascii_files[$next_index]}" - -# run fastfetch with selected ascii file -fastfetch --logo "$selected_ascii" - diff --git a/cfg/fastfetch/random.sh b/cfg/fastfetch/random.sh new file mode 100755 index 0000000..f0d0e56 --- /dev/null +++ b/cfg/fastfetch/random.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +# renamed to 'random.sh' from '?.sh' otherwise windows users cry + +# folder with ascii files +ascii_folder="/home/max/ii" +# a file to keep track of last used logo index +state_file="/tmp/fastfetch_logo_index" + +# array of ascii logo files +ascii_files=( + "$ascii_folder/maoscii.txt" + "$ascii_folder/enriscii.txt" + "$ascii_folder/marscii.txt" + "$ascii_folder/cafiscii1.txt" + "$ascii_folder/bakiscii.txt" + "$ascii_folder/cafiscii2.txt" +) + +# number of ascii files +count=${#ascii_files[@]} + +# read last index from file or start at -1 +if [[ -f "$state_file" ]]; then + last_index=$(cat "$state_file") +else + last_index=-1 +fi + +# calculate next index in rotation +next_index=$(( (last_index + 1) % count )) + +# save next index for next run +echo "$next_index" > "$state_file" + +# pick ascii file for this run +selected_ascii="${ascii_files[$next_index]}" + +# run fastfetch with selected ascii file +fastfetch --logo "$selected_ascii" + -- cgit v1.3.1