diff --git a/src/modules/fullpageos/config b/src/modules/fullpageos/config index 74584588..cb99004f 100644 --- a/src/modules/fullpageos/config +++ b/src/modules/fullpageos/config @@ -13,6 +13,9 @@ [ -n "$FULLPAGEOS_OVERRIDE_KBD_MODEL" ] || FULLPAGEOS_OVERRIDE_KBD_MODEL=default [ -n "$FULLPAGEOS_OVERRIDE_KBD_LAYOUT" ] || FULLPAGEOS_OVERRIDE_KBD_LAYOUT=default +#disable keyboard shortcuts like (CTRL+w,CTRL+N,CTRL+t) for Chromium +[ -n "$FULLPAGEOS_DISABLE_CHROMIUM_KEYBOARD_SHORTCUTS" ] || FULLPAGEOS_DISABLE_CHROMIUM_KEYBOARD_SHORTCUTS=no + #override password, otherwise use image default [ -n "$FULLPAGEOS_OVERRIDE_PASSWORD" ] || FULLPAGEOS_OVERRIDE_PASSWORD=default diff --git a/src/modules/fullpageos/filesystem/boot/xbindkeys_disable.conf b/src/modules/fullpageos/filesystem/boot/xbindkeys_disable.conf new file mode 100644 index 00000000..cd22810d --- /dev/null +++ b/src/modules/fullpageos/filesystem/boot/xbindkeys_disable.conf @@ -0,0 +1,29 @@ +F11 +F12 +control + n +control + w +control + t +control + j +control + h +control + o +control + p +control + s +control + 2 +control + 3 +control + 4 +control + 5 +control + 6 +control + 7 +control + 8 +control + 9 +control + tab +control + alt + x +control + pagedown +control + shift + tab +control + pageup +control + shift + t +control+shift + N +control+shift + n +control + shift + i +control + shift + j +control + shift + c \ No newline at end of file diff --git a/src/modules/fullpageos/filesystem/opt/custompios/scripts/start_chromium_browser b/src/modules/fullpageos/filesystem/opt/custompios/scripts/start_chromium_browser index 05a38693..0dfae654 100755 --- a/src/modules/fullpageos/filesystem/opt/custompios/scripts/start_chromium_browser +++ b/src/modules/fullpageos/filesystem/opt/custompios/scripts/start_chromium_browser @@ -1,5 +1,44 @@ #!/bin/bash +PACKAGE="xbindkeys" + +# Starting xbindkeys if is installed +if apt list --installed "$PACKAGE" | grep -q "[installed]"; then + # Define the path to our custom config file (relative to the script) + DISABLE_CONFIG_PATH="/boot/firmware/xbindkeys_disable.conf" + # Define the path to the user's xbindkeysrc file + XBINDKEYS_RC="/home/$BASE_USER/.xbindkeysrc" + + # Function to generate the xbindkeysrc file based on our config + generate_xbindkeysrc() { + local config_path=$1 + local output_path="$XBINDKEYS_RC" + + # Create a temporary xbindkeys config file + local temp_file="/tmp/xbindkeysrc.temp" + > "$temp_file" # Clear the file + + # Read each line from the config file and format it for xbindkeysrc + while IFS= read -r combo; do + # Skip empty or commented lines + if [[ -z "$combo" || "$combo" =~ ^# ]]; then + continue + fi + echo "\"echo\"" >> "$temp_file" + echo " $combo" >> "$temp_file" + echo >> "$temp_file" + done < "$config_path" + + # Copy the temporary file to the user's home directory + cp "$temp_file" "$output_path" + #chown "$user":"$user" "$output_path" + rm "$temp_file" + } + echo "$PACKAGE is installed so starting the package!" + generate_xbindkeysrc "$DISABLE_CONFIG_PATH" + xbindkeys & +fi + flags=( --kiosk --touch-events=enabled diff --git a/src/modules/fullpageos/start_chroot_script b/src/modules/fullpageos/start_chroot_script index ce960f81..eaba5ddd 100755 --- a/src/modules/fullpageos/start_chroot_script +++ b/src/modules/fullpageos/start_chroot_script @@ -27,6 +27,14 @@ then systemctl disable getty@tty1 fi +# Disable keyboard shortcuts like (CTRL+w,CTRL+N,CTRL+t) for Chromium +if [ "$FULLPAGEOS_DISABLE_CHROMIUM_KEYBOARD_SHORTCUTS" == "yes" ] +then + #Only install if not disabled by configuration + echo "Disable keyboard shortcuts like (CTRL+w,CTRL+N,CTRL+t) for Chromium: $FULLPAGEOS_DISABLE_CHROMIUM_KEYBOARD_SHORTCUTS" + apt-get install xbindkeys -y +fi + remove_extra=$(remove_if_installed scratch squeak-plugins-scratch squeak-vm python-minecraftpi minecraft-pi sonic-pi oracle-java8-jdk bluej greenfoot libreoffice-common libreoffice-core freepats) apt-get remove -y --purge $remove_extra