{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
  ];
}
