#!/bin/bash

## Copyright (C) 2012 - 2025 ENCRYPTED SUPPORT LLC <adrelanos@whonix.org>
## See the file COPYING for copying conditions.

colors() {
   if [ "$TERM" = "" ]; then
      return 0
   fi

   ## Thanks to:
   ## http://mywiki.wooledge.org/BashFAQ/037
   ## Variables for terminal requests.
   [[ -t 2 ]] && {
      alt=$(      tput smcup  || tput ti      ) # Start alt display
      ealt=$(     tput rmcup  || tput te      ) # End   alt display
      hide=$(     tput civis  || tput vi      ) # Hide cursor
      show=$(     tput cnorm  || tput ve      ) # Show cursor
      save=$(     tput sc                     ) # Save cursor
      load=$(     tput rc                     ) # Load cursor
      bold=$(     tput bold   || tput md      ) # Start bold
      stout=$(    tput smso   || tput so      ) # Start stand-out
      estout=$(   tput rmso   || tput se      ) # End stand-out
      under=$(    tput smul   || tput us      ) # Start underline
      eunder=$(   tput rmul   || tput ue      ) # End   underline
      reset=$(    tput sgr0   || tput me      ) # Reset cursor
      blink=$(    tput blink  || tput mb      ) # Start blinking
      italic=$(   tput sitm   || tput ZH      ) # Start italic
      eitalic=$(  tput ritm   || tput ZR      ) # End   italic
      [[ $TERM != *-m ]] && {
      red=$(      tput setaf 1|| tput AF 1    )
      green=$(    tput setaf 2|| tput AF 2    )
      yellow=$(   tput setaf 3|| tput AF 3    )
      blue=$(     tput setaf 4|| tput AF 4    )
      magenta=$(  tput setaf 5|| tput AF 5    )
      cyan=$(     tput setaf 6|| tput AF 6    )
      }
      white=$(    tput setaf 7|| tput AF 7    )
      default=$(  tput op                     )
      eed=$(      tput ed     || tput cd      )   # Erase to end of display
      eel=$(      tput el     || tput ce      )   # Erase to end of line
      ebl=$(      tput el1    || tput cb      )   # Erase to beginning of line
      ewl=$eel$ebl                                # Erase whole line
      draw=$(     tput -S <<< '   enacs
                                      smacs
                                      acsc
                                      rmacs' || { \
                      tput eA; tput as;
                      tput ac; tput ae;         } )   # Drawing characters
      back=$'\b'
   } 2>/dev/null ||:
}

colors

echo "\
${bold}Documentation can be found on Kicksecure homepage.
https://www.kicksecure.com

${under}Change keyboard layout:${reset}
sudo dpkg-reconfigure keyboard-configuration
sudo dpkg-reconfigure console-data

${under}Default username and password:${reset}
Default username: user
Default password: No password required. (Passwordless login.)

${under}For slower output, run:${reset}
kicksecure | more

${bold}End of Kicksecure help.${reset}
"
