Files
nixos/apps/hyprlock/scripts/random-text.nix
T
kenji 4a9aa15b77 feat(hyprlock): removed cyberpunk random-text
it does not fit the theme very well.
2026-03-09 17:47:07 -05:00

248 lines
4.8 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{pkgs, ...}: let
hakase-hyprlock-text-generator = pkgs.writeShellScriptBin "hakase-hyprlock-text-generator" ''
cache_file="''${XDG_RUNTIME_DIR:-/tmp}/hyprlock_greeting"
pid_file="''${XDG_RUNTIME_DIR:-/tmp}/hyprlock_greeting_pid"
current_pid=$(pgrep -x hyprlock | head -1)
# Pick new greeting only when hyprlock restarts
if [[ -f $pid_file && -f $cache_file ]]; then
old_pid=$(cat "$pid_file")
if [[ "$old_pid" == "$current_pid" ]]; then
cat "$cache_file"
exit 0
fi
fi
greetings=(
"Hello"
"Hola"
"Bonjour"
"Hallo"
"Ciao"
"Olá"
"Привет"
""
""
""
"مرحبا"
"שלום"
""
""
"Γειά σου"
"Merhaba"
"Xin chào"
"Cześć"
"Hej"
"Ahoj"
"Szia"
"Salut"
"Привіт"
""
""
"Jambo"
"Aloha"
"Sawubona"
"Hei"
"Hallå"
"Kamusta"
"Salam"
"Selamat"
"Saluton"
"Tere"
"Sveiki"
"Labas"
"Здраво"
"Здравей"
"Bok"
"Përshëndetje"
"Բարև"
""
"Сайн уу"
""
""
""
""
"Dia dhuit"
"Halò"
"Shwmae"
"Hoi"
"Halló"
"Kaixo"
"Bon dia"
"Ola"
"Ħello"
"ਿ "
" "
""
""
""
""
""
"Bawo"
"Ndeewo"
"Sannu"
"Iska warran"
"Kia ora"
"Bula"
"Talofa"
"Mālō e lelei"
""
""
"Yá'át'ééh"
"Allinllachu"
"Mba'éichapa"
"Salve"
"Moien"
"Apa khabar"
"Сәлем"
"Assalomu alaykum"
"Slav"
""
)
inspirations=(
"Dream Big"
"Stay True"
"Be Kind"
"Work Hard"
"Keep Going"
"Be Brave"
"Love Life"
"Stay Calm"
"Think Positive"
"Be Happy"
"No Fear"
"Have Faith"
"Trust Yourself"
"Focus Now"
"Take Action"
"Never Settle"
"Rise Up"
"Shine On"
"Stand Tall"
"Live Free"
"Just Begin"
"Create Joy"
"Stay Strong"
"Breathe Deep"
"Be Bold"
"Look Ahead"
"Move Forward"
"Aim High"
"Stay Humble"
"Find Peace"
"Do Good"
"Seek Truth"
"Love More"
"Be Yourself"
"Let Go"
"Keep Smiling"
"Stay Wild"
"Think Big"
"Be Awesome"
"Start Now"
"Enjoy Today"
"Choose Joy"
"Dream On"
"Fly High"
"Stay Focused"
"Be Fearless"
"Don't Stop"
"Make Waves"
"Be Original"
"Stay Curious"
"Be grateful"
"Keep pushing"
"Stay sharp"
"Why not?"
"Be still"
"Keep cool"
"Think twice"
"Be ready"
"Stay gold"
"Game on"
"Level up"
"Code on"
"Git commit"
"Hack on"
)
cyberpunk=(
"System: ONLINE"
"Encryption: ACTIVE"
"Access: GRANTED"
"Uptime: OPTIMAL"
"Link: ESTABLISHED"
"Protocol: SECURE"
"Daemon: WATCHING"
"Netrunner: READY"
"Signal: STRONG"
"Proxy: ENGAGED"
"Root: ACCESS"
"Kernel: PANIC"
)
yojijukugo=(
""
""
""
""
""
""
""
""
)
habits=(
"Check posture"
"Drink water"
"Shoulders down"
"Eyes off screen"
"Deep breath"
"Stretch now"
"Unclench jaw"
"Touch grass"
"Blink now"
"Stand up"
)
dev=(
"It works locally"
"Sudo please"
"Flake locked"
"Compiling..."
"Git push force"
"rm -rf /"
":q! to exit"
"Works on my machine"
"Coffee needed"
"Fixing bugs"
"Hello World"
"Null Pointer"
"Segfault"
)
# Combine all arrays
combined=(
"''${greetings[@]}"
"''${inspirations[@]}"
# "''${cyberpunk[@]}"
"''${yojijukugo[@]}"
"''${habits[@]}"
"''${dev[@]}"
)
idx=$((RANDOM % ''${#combined[@]}))
greeting="''${combined[$idx]}"
echo "$current_pid" > "$pid_file"
echo "$greeting" > "$cache_file"
echo "$greeting"
'';
in {
home.packages = [
hakase-hyprlock-text-generator
];
}