#!/bin/bash log() { if [[ $2 != "" ]]; then printf "\n[ERRO] $1\n" cat < /dev/null } install_color_emoji() { NOTOEMOJI_ZIPFILE=noto_color_emoji.zip FONT_STORE=$HOME/.local/share/fonts NOTOEMOJI_DIR=noto_color_emoji curl -o $NOTOEMOJI_ZIPFILE https://noto-website-2.storage.googleapis.com/pkgs/NotoColorEmoji-unhinted.zip unzip $NOTOEMOJI_ZIPFILE -d $NOTOEMOJI_DIR mkdir -p $FONT_STORE mv $NOTOEMOJI_DIR/*.ttf $FONT_STORE/ rm -r $NOTOEMOJI_DIR || true rm $NOTOEMOJI_ZIPFILE || true } check_raspberrypi() { if ! `lsb_release -a | grep -Eq "Raspbian|Debian"`; then log "this device appears not to be running raspbian os" 1 fi if ! `uname -m | grep -Eq "armv|aarch64"` ; then log "this device doesn't appear to be a raspberry pi" 1 fi if ! [[ "$DESKTOP_SESSION" == "rpd-labwc" ]]; then log "this device isn't running a supported desktop environment", 1 fi } CHROME_PWDSTORE_SWITCH="" install_kiosk_script() { GECKOBOARD_KIOSK_FILE=$HOME/.local/geckoboard_kiosk_mode LABWC_CONFIG_PATH=$HOME/.config/labwc LABWC_AUTOSTART=$LABWC_CONFIG_PATH/autostart cat > $GECKOBOARD_KIOSK_FILE <> $LABWC_AUTOSTART fi } # Display logo and intro to user # ASCII display generated at https://www.ascii-art-generator.org/ cat < /dev/null log "installing mscore fonts" sudo apt install -y ttf-mscorefonts-installer > /dev/null log "installing color emoji support" install_color_emoji > /dev/null log "setting up Geckoboard kiosk mode" printf "\nTo prevent default keyring requesting password input when opening Chrome\n" printf "We're going to instruct Chrome to store passwords unencrypted in its own store\n" printf "This would be the same as setting no password in your keyring\n" printf "If you intend to store the passwords in Chrome for websites\n" printf "It would be highly recommended not to use the unencrypted password store\n\n" printf "Do you want to use unencrypted password store for Chrome? [y/N]:" read disableKeyring if [[ "$disableKeyring" == "y" ]]; then CHROME_PWDSTORE_SWITCH="--password-store=basic" fi install_kiosk_script cat <