Compare commits

..

No commits in common. "0b4318d557b2d0c4539fc6e680ac7b23083fbc39" and "a55df5400f89a58f68e8f74dc6811f1a837ca8bc" have entirely different histories.

6 changed files with 67 additions and 121 deletions

View file

@ -3,6 +3,8 @@
## First time/TP-Config ## First time/TP-Config
- Add network configuration (replace nmtui) - Add network configuration (replace nmtui)
- Add hostname configuration (replace nmtui) - Add hostname configuration (replace nmtui)
- Add Enclosure plugin to suggested
- Bring back cancel buttons
## Misc ## Misc
- Cleanup - Cleanup

View file

@ -18,4 +18,5 @@ if ! id -u kiosk >/dev/null 2>&1; then
adduser --disabled-password --shell /usr/sbin/nologin --gecos "" kiosk adduser --disabled-password --shell /usr/sbin/nologin --gecos "" kiosk
fi fi
echo "${FIRST_USER_NAME}:${FIRST_USER_PASS}" | chpasswd echo "${FIRST_USER_NAME}:${FIRST_USER_PASS}" | chpasswd
echo "root:$(cat /dev/urandom | tr -dc _A-Z-a-z-0-9 | head -c40)" | chpasswd
EOF EOF

View file

@ -7,12 +7,6 @@ if [ "$EUID" -ne 0 ]; then
exit 1 exit 1
fi fi
# Prevent Ctrl+C since you shouldn't be able to exit this
trap '' SIGINT
# Set the FIRST_TIME variable to disable cancel boxes
FIRST_TIME="--nocancel"
# Import common functions # Import common functions
source /usr/local/lib/tp-lib.sh source /usr/local/lib/tp-lib.sh
@ -27,58 +21,58 @@ error_install () {
} }
recommended_menu () { recommended_menu () {
local RECOMMEND_MENU=$(dialog --title "Plugin Manager | Recommended Plugins" --checklist "Check plugins that you wish to install." 0 0 0 \ local RECOMMEND_MENU=$(dialog --nocancel --title "Plugin Manager | Recommended Plugins" --checklist "Check plugins that you wish to install." 0 0 0 \
"OctoPrint-Dashboard" "Adds a nice dashboard to OctoPrint." ON \ "OctoPrint-Dashboard" "Adds a nice dashboard to OctoPrint." ON \
"ExcludeRegion" "Select regions of the bed where you don't want to print." ON \ "ExcludeRegion" "Select regions of the bed where you don't want to print." ON \
"NavbarTemp" "Shows the temperature of the Pi, extruder(s) and bed in the navigation bar." ON \ "NavbarTemp" "Shows the temperature of the Pi, extruder(s) and bed in the navigation bar." ON \
"PrintTimeGenius" "Provides more accurate print time estimates." ON \ "PrintTimeGenius" "Provides more accurate print time estimates." ON \
"HeaterTimeout" "Turns off the hotend and bed after a set amount of time." ON \ "HeaterTimeout" "Turns off the hotend and bed after a set amount of time." ON \
"TouchUI" "Makes the UI easier to use on touchscreens. Also adds a virtual keyboard." ON 3>&1 1>&2 2>&3 || return 0) "TouchUI" "Makes the UI easier to use on touchscreens. Also adds a virtual keyboard." ON 3>&1 1>&2 2>&3)
RECOMMEND_MENU=($RECOMMEND_MENU) RECOMMEND_MENU=($RECOMMEND_MENU)
for ((i = 0; i < ${#RECOMMEND_MENU[@]}; i++)); do for ((i = 0; i < ${#RECOMMEND_MENU[@]}; i++)); do
echo $(( $i * 100 / ${#RECOMMEND_MENU[@]} )) | dialog --title "Plugin Manager" --gauge "Installing ${RECOMMEND_MENU[$i]}" 10 50 echo $(( $i * 100 / ${#RECOMMEND_MENU[@]} )) | dialog --title "Plugin Manager" --gauge "Installing ${RECOMMEND_MENU[$i]}" 10 50
case ${RECOMMEND_MENU[$i]} in case ${RECOMMEND_MENU[$i]} in
"OctoPrint-Dashboard") install_package "https://github.com/StefanCohen/OctoPrint-Dashboard/archive/master.zip" || error_install ${RECOMMEND_MENU[$i]}; install_package "https://github.com/OllisGit/OctoPrint-DisplayLayerProgress/releases/latest/download/master.zip" || error_install ${RECOMMEND_MENU[$i]};; "OctoPrint-Dashboard") install_package "https://github.com/StefanCohen/OctoPrint-Dashboard/archive/master.zip" || error_install "OctoPrint-Dashboard"; install_package "https://github.com/OllisGit/OctoPrint-DisplayLayerProgress/releases/latest/download/master.zip" || error_install "OctoPrint-Dashboard";;
"ExcludeRegion") install_package "https://github.com/bradcfisher/OctoPrint-ExcludeRegionPlugin/archive/master.zip" || error_install ${RECOMMEND_MENU[$i]};; "ExcludeRegion") install_package "https://github.com/bradcfisher/OctoPrint-ExcludeRegionPlugin/archive/master.zip" || error_install "ExcludeRegion";;
"NavbarTemp") install_package "https://github.com/imrahil/OctoPrint-NavbarTemp/archive/master.zip" || error_install ${RECOMMEND_MENU[$i]};; "NavbarTemp") install_package "https://github.com/imrahil/OctoPrint-NavbarTemp/archive/master.zip" || error_install "NavbarTemp";;
"PrintTimeGenius") install_package "https://github.com/eyal0/OctoPrint-PrintTimeGenius/archive/master.zip" || error_install ${RECOMMEND_MENU[$i]};; "PrintTimeGenius") install_package "https://github.com/eyal0/OctoPrint-PrintTimeGenius/archive/master.zip" || error_install "PrintTimeGenius";;
"HeaterTimeout") install_package "https://github.com/google/OctoPrint-HeaterTimeout/archive/master.zip" || error_install ${RECOMMEND_MENU[$i]};; "HeaterTimeout") install_package "https://github.com/google/OctoPrint-HeaterTimeout/archive/master.zip" || error_install "HeaterTimeout";;
"TouchUI") install_package "https://github.com/BillyBlaze/OctoPrint-TouchUI/archive/master.zip" || error_install ${RECOMMEND_MENU[$i]};; "TouchUI") install_package "https://github.com/BillyBlaze/OctoPrint-TouchUI/archive/master.zip" || error_install "TouchUI";;
esac esac
done done
} }
suggested_menu () { suggested_menu () {
local SUGGEST_MENU=$(dialog --title "Plugin Manager | Suggested Plugins" --checklist "Check plugins that you wish to install.\n\nSome of these may conflict with the recommended plugins." 0 0 0 \ local SUGGEST_MENU=$(dialog --nocancel --title "Plugin Manager | Suggested Plugins" --checklist "Check plugins that you wish to install.\n\nSome of these may conflict with the recommended plugins." 0 0 0 \
"Themeify" "Adds theming supports and a few themes to OctoPrint." OFF \ "Themeify" "Adds theming supports and a few themes to OctoPrint." OFF \
"Preheat" "Adds a preheat button to preheat the bed and extruder to the temperature set in the selected gcode file." OFF \ "Preheat" "Adds a preheat button to preheat the bed and extruder to the temperature set in the selected gcode file." OFF \
"ConsolidatedTabs" "Allows you to combine several tabs into one larger tab with draggable and resizable panels." OFF \ "ConsolidatedTabs" "Allows you to combine several tabs into one larger tab with draggable and resizable panels." OFF \
"DetailedProgress" "Sends commands to your printer to display current printing progress." OFF \ "DetailedProgress" "Sends commands to your printer to display current printing progress." OFF 3>&1 1>&2 2>&3)
"Enclosure" "Adds a lot of features for enclosures such as support for external temperature sensors." OFF 3>&1 1>&2 2>&3 || return 0)
SUGGEST_MENU=($SUGGEST_MENU) SUGGEST_MENU=($SUGGEST_MENU)
for ((i = 0; i < ${#SUGGEST_MENU[@]}; i++)); do for ((i = 0; i < ${#SUGGEST_MENU[@]}; i++)); do
echo $(( $i * 100 / ${#SUGGEST_MENU[@]} )) | dialog --title "Plugin Manager" --gauge "Installing ${SUGGEST_MENU[$i]}" 10 50 echo $(( $i * 100 / ${#SUGGEST_MENU[@]} )) | dialog --title "Plugin Manager" --gauge "Installing ${SUGGEST_MENU[$i]}" 10 50
case ${SUGGEST_MENU[$i]} in case ${SUGGEST_MENU[$i]} in
"Themeify") install_package "https://github.com/birkbjo/OctoPrint-Themeify/archive/master.zip" || error_install ${SUGGEST_MENU[$i]};; "Themeify") install_package "https://github.com/birkbjo/OctoPrint-Themeify/archive/master.zip" || error_install "Themeify";;
"Preheat") install_package "https://github.com/marian42/octoprint-preheat/archive/master.zip" || error_install ${SUGGEST_MENU[$i]};; "Preheat") install_package "https://github.com/marian42/octoprint-preheat/archive/master.zip" || error_install "Preheat";;
"ConsolidatedTabs") install_package "https://github.com/jneilliii/OctoPrint-ConsolidatedTabs/archive/master.zip" || error_install ${SUGGEST_MENU[$i]};; "ConsolidatedTabs") install_package "https://github.com/jneilliii/OctoPrint-ConsolidatedTabs/archive/master.zip" || error_install "ConsolidatedTabs";;
"DetailedProgress") install_package "https://github.com/tpmullan/OctoPrint-DetailedProgress/archive/master.zip" || error_install ${SUGGEST_MENU[$i]};; "DetailedProgress") install_package "https://github.com/tpmullan/OctoPrint-DetailedProgress/archive/master.zip" || error_install "DetailedProgress";;
"Enclosure") install_package "https://github.com/vitormhenrique/OctoPrint-Enclosure/archive/master.zip" || error_install ${SUGGEST_MENU[$i]};;
esac esac
done done
} }
dialog --title "NOTICE" --colors --msgbox "This collection of software is currently in beta, it may contain several bugs. This software is \Zb\Z1NOT\Zn recommended for a production environment." 10 50 dialog --title "NOTICE" --nocancel --colors --msgbox "This collection of software is currently in beta, it may contain several bugs. This software is \Zb\Z1NOT\Zn recommended for a production environment." 10 50
# Makes a certificate and key for Nginx HTTPS # Makes a certificate and key for Nginx HTTPS
openssl req -x509 -nodes -days 36500 -newkey rsa:4096 -subj "/C=/ST=/L=/O=/OU=/CN=*/emailAddress=" -out /etc/ssl/certs/nginx-octoprint.crt -keyout /etc/ssl/private/nginx-octoprint.key openssl req -x509 -nodes -days 36500 -newkey rsa:4096 -subj "/C=/ST=/L=/O=/OU=/CN=*/emailAddress=" -out /etc/ssl/certs/nginx-octoprint.crt -keyout /etc/ssl/private/nginx-octoprint.key
# Force the user to change the pi user's password before the RPi gets botnetted # Force the user to change the pi user's password before the RPi gets botnetted
change_password change_password
# Randomize the root password
echo "root:$(cat /dev/urandom | tr -dc _A-Z-a-z-0-9 | head -c40)" | chpasswd
dialog --title "Network Configuration" --nocancel --msgbox "Setup will now open nmtui, a program to help configure your ethernet/wireless interfaces. Hit Quit when you are done." 10 50 dialog --title "Network Configuration" --nocancel --msgbox "Setup will now open nmtui, a program to help configure your ethernet/wireless interfaces. Hit Quit when you are done." 10 50
nmtui nmtui
@ -115,9 +109,9 @@ fi
# If OctoPrint is running locally, ask if user wants to preinstall recommended plugins # If OctoPrint is running locally, ask if user wants to preinstall recommended plugins
if [[ -f /etc/systemd/system/multi-user.target.wants/octoprint.service ]] && dialog --title "Plugin Manager" --yesno "Do you wish to preinstall some suggested plugins?" 10 60; then if [[ -f /etc/systemd/system/multi-user.target.wants/octoprint.service ]] && dialog --title "Plugin Manager" --yesno "Do you wish to preinstall some suggested plugins?" 10 60; then
recommended_menu && suggested_menu recommended_menu || return 1
suggested_menu || return 1
chown -R octoprint:octoprint /srv/octoprint chown -R octoprint:octoprint /srv/octoprint
chown -R octoprint:octoprint /home/octoprint
fi fi
# Delete the autologin override and first-time setup utility # Delete the autologin override and first-time setup utility

View file

@ -1,23 +1,20 @@
change_password () { change_password () {
local PASSWORD="$(dialog --title "Change Password" $FIRST_TIME --insecure --passwordbox "Enter new password for user \"pi\"" 10 50 3>&1 1>&2 2>&3 || return 0)" local PASSWORD="$(dialog --title "Change Password" --nocancel --insecure --passwordbox "Enter new password for user \"pi\"" 10 50 3>&1 1>&2 2>&3)"
# If the password field was left blank, exit
# If the password field was left blank and we aren't in the first time setup, exit if [[ $? -ne 0 ]] || [[ $PASSWORD == "" ]]; then return 1; fi
[[ $PASSWORD == "" ]] && [[ $FIRST_TIME == "" ]] && return 0
# If we are in the first time setup and the password field is blank, make the user restart
[[ $PASSWORD == "" ]] && ! [[ $FIRST_TIME == "" ]] && change_password
# If the password is raspberry, tell the user he is an idiot # If the password is raspberry, tell the user he is an idiot
if [[ "$PASSWORD" == "raspberry" ]]; then if [[ "$PASSWORD" == "raspberry" ]]; then
dialog --title "Change Password" --msgbox "That password sucks. Please use a different one :)" 10 50 dialog --title "Change Password" --nocancel --msgbox "That password sucks. Please use a different one :)" 10 50
change_password change_password
return 0 return 0
fi fi
if [[ "$(dialog $FIRST_TIME --title "Change Password" --insecure --passwordbox "Confirm new password for user \"pi\"" 10 50 3>&1 1>&2 2>&3 || return 0)" == "$PASSWORD" ]]; then if [[ "$(dialog --nocancel --insecure --passwordbox "Confirm new password for user \"pi\"" 10 50 3>&1 1>&2 2>&3)" == "$PASSWORD" ]]; then
if [[ $? != 0 ]]; then return 1; fi
echo -e "pi:$PASSWORD" | chpasswd echo -e "pi:$PASSWORD" | chpasswd
else else
dialog --title "Change Password" --colors --msgbox "\Z1\ZbPasswords did not match!" 5 30 dialog --title "Change Password" --nocancel --colors --msgbox "\Z1\ZbPasswords did not match!" 5 30
change_password change_password
return 0 return 0
fi fi
@ -27,11 +24,11 @@ change_password () {
service_toggle () { service_toggle () {
# Toggle the checkboxes if the service is active or not # Toggle the checkboxes if the service is active or not
local SERVICE_MENU=$(dialog $FIRST_TIME --title "Select services" --checklist "Enable/disable services" 0 0 0 \ local SERVICE_MENU=$(dialog --separate-output --nocancel --title "Select services" --checklist "Enable/disable services" 0 0 0 \
"1" "OctoPrint" $(if [[ -f /etc/systemd/system/multi-user.target.wants/octoprint.service ]]; then echo "ON"; else echo "OFF"; fi) \ "1" "OctoPrint" $(if [[ -f /etc/systemd/system/multi-user.target.wants/octoprint.service ]]; then echo "ON"; else echo "OFF"; fi) \
"2" "MJPG-Streamer" $(if [[ -f /etc/systemd/system/multi-user.target.wants/mjpg-streamer.service ]]; then echo "ON"; else echo "OFF"; fi) \ "2" "MJPG-Streamer" $(if [[ -f /etc/systemd/system/multi-user.target.wants/mjpg-streamer.service ]]; then echo "ON"; else echo "OFF"; fi) \
"3" "GUI" $(if [[ $(systemctl get-default) == "graphical.target" ]]; then echo "ON"; else echo "OFF"; fi) \ "3" "GUI" $(if [[ $(systemctl get-default) == "graphical.target" ]]; then echo "ON"; else echo "OFF"; fi) \
"4" "SSH" $(if [[ -f /etc/systemd/system/multi-user.target.wants/ssh.service ]]; then echo "ON"; else echo "OFF"; fi) 3>&1 1>&2 2>&3 || return 0) "4" "SSH" $(if [[ -f /etc/systemd/system/multi-user.target.wants/ssh.service ]]; then echo "ON"; else echo "OFF"; fi) 3>&1 1>&2 2>&3)
SERVICE_MENU=($SERVICE_MENU) SERVICE_MENU=($SERVICE_MENU)
@ -49,77 +46,40 @@ service_toggle () {
esac esac
done done
# If FIRST_TIME is not empty, this is the first time boot so don't actually start stuff, otherwise use normal behaviour if [[ $ENABLE_OCTO == true ]]; then
if ! [[ "$FIRST_TIME" == "" ]]; then systemctl enable octoprint
if [[ $ENABLE_OCTO == true ]]; then
systemctl enable octoprint
else
systemctl disable octoprint
fi
if [[ $ENABLE_MJPG == true ]]; then
systemctl enable mjpg-streamer
raspi-config nonint do_camera 0 # Counter intuitively enables the camera
else
systemctl disable mjpg-streamer
raspi-config nonint do_camera 1 # Disables the camera
fi
if [[ $ENABLE_OCTO == true ]] && [[ $ENABLE_MJPG == true ]]; then
systemctl enable nginx
elif [[ $ENABLE_OCTO == false ]] && [[ $ENABLE_MJPG == false ]]; then
systemctl disable nginx
fi
if [[ $ENABLE_GUI == true ]]; then
systemctl set-default graphical.target
else
systemctl set-default multi-user.target
fi
if [[ $ENABLE_SSH == true ]]; then
systemctl enable ssh
else
systemctl disable ssh
fi
else else
if [[ $ENABLE_OCTO == true ]]; then systemctl disable octoprint
systemctl enable --now octoprint
else
systemctl disable --now octoprint
fi
if [[ $ENABLE_MJPG == true ]]; then
systemctl enable --now mjpg-streamer
raspi-config nonint do_camera 0 # Counter intuitively enables the camera
ASK_REBOOT=true
else
systemctl disable --now mjpg-streamer
raspi-config nonint do_camera 1 # Disables the camera
ASK_REBOOT=true
fi
if [[ $ENABLE_OCTO == true ]] && [[ $ENABLE_MJPG == true ]]; then
systemctl enable --now nginx
elif [[ $ENABLE_OCTO == false ]] && [[ $ENABLE_MJPG == false ]]; then
systemctl disable --now nginx
fi
if [[ $ENABLE_GUI == true ]]; then
systemctl set-default graphical.target
ASK_REBOOT=true
else
systemctl set-default multi-user.target
ASK_REBOOT=true
fi
if [[ $ENABLE_SSH == true ]]; then
systemctl enable --now ssh
else
systemctl disable --now ssh
fi
fi fi
if [[ $ENABLE_MJPG == true ]]; then
systemctl enable mjpg-streamer
raspi-config nonint do_camera 0 # Counter intuitively enables the camera
else
systemctl disable mjpg-streamer
raspi-config nonint do_camera 1 # Disables the camera
fi
if [[ $ENABLE_OCTO == true ]] && [[ $ENABLE_MJPG == true ]]; then
systemctl enable nginx
elif [[ $ENABLE_OCTO == false ]] && [[ $ENABLE_MJPG == false ]]; then
systemctl disable nginx
fi
if [[ $ENABLE_GUI == true ]]; then
systemctl set-default graphical.target
else
systemctl set-default multi-user.target
fi
if [[ $ENABLE_SSH == true ]]; then
systemctl enable ssh
else
systemctl disable ssh
fi
ASK_REBOOT=true
<< 'EOF' << 'EOF'
for ((i = 0; i <= 3; i++)); do for ((i = 0; i <= 3; i++)); do
for n in "${SERVICE_MENU[@]}"; do for n in "${SERVICE_MENU[@]}"; do
@ -142,9 +102,8 @@ EOF
} }
screen_timeout () { screen_timeout () {
local TIMEOUT=$(dialog $FIRST_TIME --title "Screen Timeout" --inputbox "Input your desired screen timeout in seconds.\nEnter \"off\" to disable the screen timeout.\n\nAdding a screen timeout can reduce screen burn in.\n\nDefault: off" 12 60 "off" 3>&1 1>&2 2>&3 || return 0) local TIMEOUT=$(dialog --nocancel --title "Screen Timeout" --inputbox "Input your desired screen timeout in seconds.\nEnter \"off\" to disable the screen timeout.\n\nAdding a screen timeout can reduce screen burn in.\n\nDefault: off" 12 60 "off" 3>&1 1>&2 2>&3)
# If timeout is blank, exit before we break everything
[[ "$TIMEOUT" == "" ]] && return 0 [[ "$TIMEOUT" == "" ]] && return 0
cat > /home/kiosk/.xtimeout << EOF cat > /home/kiosk/.xtimeout << EOF
@ -159,16 +118,11 @@ EOF
} }
octo_autologin () { octo_autologin () {
local AUTOLOGIN_MENU="$(dialog --title "OctoPrint AutoLogin" --inputbox "Enter the username of the user that you want the GUI to autologin as on startup." 10 50 $(octo-settings read accessControl autologinAs) 3>&1 1>&2 2>&3 || return 0)" local AUTOLOGIN_MENU="$(dialog --title "OctoPrint AutoLogin" --nocancel --inputbox "Enter the username of the user that you want the GUI to autologin as on startup." 10 50 $(octo-settings read accessControl autologinAs) 3>&1 1>&2 2>&3)"
# If the text field is blank, exit before everything (probably doesn't) break
[[ "$AUTOLOGIN_MENU" == "" ]] && return 0
octo-settings write accessControl autologinAs $AUTOLOGIN_MENU octo-settings write accessControl autologinAs $AUTOLOGIN_MENU
if [[ -f /etc/systemd/system/multi-user.target.wants/octoprint.service ]]; then if [[ -f /etc/systemd/system/multi-user.target.wants/octoprint.service ]]; then
systemctl restart octoprint systemctl restart octoprint
ASK_REBOOT=true
fi fi
} }
@ -182,7 +136,7 @@ nginx_listen () {
LISTEN="443" LISTEN="443"
fi fi
LISTEN=$(dialog --title "Nginx Config" --inputbox "Configure what port and IP Nginx should listen on.\nTo listen on all IPs, just enter the port.\nDefault: 443" 11 50 "$LISTEN" 3>&1 1>&2 2>&3 || return 0) LISTEN=$(dialog --title "Nginx Config" --nocancel --inputbox "Configure what port and IP Nginx should listen on.\nTo listen on all IPs, just enter the port.\nDefault: 443" 11 50 "$LISTEN" 3>&1 1>&2 2>&3)
[[ "$LISTEN" == "" ]] && return 0 [[ "$LISTEN" == "" ]] && return 0
@ -196,7 +150,7 @@ nginx_listen () {
} }
nginx_auth () { nginx_auth () {
local NGINXAUTH_MENU=$(dialog --colors $FIRST_TIME --insecure --title "Nginx Config" --mixedform "Input desired username and password for the MJPG stream.\n\nLeave both fields blank if you do not want authentication \Zb\Z1(NOT RECOMMENDED)\Zn." 12 60 0\ local NGINXAUTH_MENU=$(dialog --colors --nocancel --insecure --title "Nginx Config" --mixedform "Input desired username and password for the MJPG stream.\n\nLeave both fields blank if you do not want authentication \Zb\Z1(NOT RECOMMENDED)\Zn." 12 60 0\
"Username: " 1 1 "" 1 11 10 0 0 \ "Username: " 1 1 "" 1 11 10 0 0 \
"Password: " 2 1 "" 2 11 30 0 1 3>&1 1>&2 2>&3 || return 0) "Password: " 2 1 "" 2 11 30 0 1 3>&1 1>&2 2>&3 || return 0)
NGINXAUTH_MENU=($NGINXAUTH_MENU) NGINXAUTH_MENU=($NGINXAUTH_MENU)
@ -254,7 +208,7 @@ video_select () {
fi fi
done done
local DEVICE_MENU=$(dialog --title "MJPG Config" $FIRST_TIME --radiolist "Choose which video device you wish to use for MJPG-Streamer" 10 50 0 $DEVICELIST 3>&1 1>&2 2>&3 || return 0) local DEVICE_MENU=$(dialog --title "MJPG Config" --nocancel --radiolist "Choose which video device you wish to use for MJPG-Streamer" 10 50 0 $DEVICELIST 3>&1 1>&2 2>&3)
[[ "$DEVICE_MENU" == "" ]] && return 0 [[ "$DEVICE_MENU" == "" ]] && return 0
@ -275,12 +229,11 @@ video_config () {
VIDEO_DEVICE="/dev/video0" VIDEO_DEVICE="/dev/video0"
fi fi
local VIDEOCONFIG_MENU=$(dialog $FIRST_TIME --title "MJPG Config" --form "Choose desired camera resolution and framerate." 10 50 0\ local VIDEOCONFIG_MENU=$(dialog --nocancel --title "MJPG Config" --form "Choose desired camera resolution and framerate." 10 50 0\
"Resolution: " 1 1 "$VIDEO_SIZE" 1 13 10 0 \ "Resolution: " 1 1 "$VIDEO_SIZE" 1 13 10 0 \
"Framerate: " 2 1 "$FRAMERATE" 2 12 3 0 3>&1 1>&2 2>&3 || return 0) "Framerate: " 2 1 "$FRAMERATE" 2 12 3 0 3>&1 1>&2 2>&3)
VIDEOCONFIG_MENU=($VIDEOCONFIG_MENU) VIDEOCONFIG_MENU=($VIDEOCONFIG_MENU)
# If one of the fields is empty, tell the user to start over
if [[ "${VIDEOCONFIG_MENU[0]}" == "" ]] || [[ "${VIDEOCONFIG_MENU[1]}" == "" ]]; then if [[ "${VIDEOCONFIG_MENU[0]}" == "" ]] || [[ "${VIDEOCONFIG_MENU[1]}" == "" ]]; then
dialog --title "Error" --msgbox "Invalid input!" 10 50 dialog --title "Error" --msgbox "Invalid input!" 10 50
video_config video_config

View file

@ -4,7 +4,6 @@ set -e
mkdir -p "${ROOTFS_DIR}/home/kiosk" mkdir -p "${ROOTFS_DIR}/home/kiosk"
install -m 755 files/.xprofile "${ROOTFS_DIR}/home/kiosk/.xprofile" install -m 755 files/.xprofile "${ROOTFS_DIR}/home/kiosk/.xprofile"
install -m 755 files/.browser.sh "${ROOTFS_DIR}/home/kiosk/.browser.sh" install -m 755 files/.browser.sh "${ROOTFS_DIR}/home/kiosk/.browser.sh"
install -m 755 files/.xtimeout "${ROOTFS_DIR}/home/kiosk/.xtimeout"
mkdir -p "${ROOTFS_DIR}/home/kiosk/.config/openbox" mkdir -p "${ROOTFS_DIR}/home/kiosk/.config/openbox"
install -m 644 files/autostart "${ROOTFS_DIR}/home/kiosk/.config/openbox/autostart" install -m 644 files/autostart "${ROOTFS_DIR}/home/kiosk/.config/openbox/autostart"

View file

@ -1,3 +0,0 @@
xset s 60
xset -dpms
xset s noblank