Skip to content

Commit 7227de8

Browse files
committed
Add disable Chromium keyboard shortcuts
Note: Some shortcuts don't work after a long researh without a solution: control + shift + n control + alt + x all multi key conbination are failing.
1 parent 0dbcc2e commit 7227de8

File tree

6 files changed

+96
-2
lines changed

6 files changed

+96
-2
lines changed

.gitignore

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
1+
######################
2+
# IntelliJ
3+
######################
4+
.idea/
5+
*.iml
6+
*.iws
7+
*.ipr
8+
*.ids
9+
*.orig
10+
classes/
11+
out/
12+
######################
13+
114
src/config.local
15+
src/image/*.xz
216
src/image/*.zip
317
src/custompios_path
418
src/build.log
@@ -8,4 +22,4 @@ src/workspace/*
822
src/workspace*/*
923
src/variants/*
1024
!src/variants/no-acceleration
11-
/.idea/
25+
/docker/

src/config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export DIST_NAME=FullpageOS
2-
export DIST_VERSION=1.0.0
2+
export DIST_VERSION=1.0.1
33
export MODULES="base(raspicam, network, disable-services(gui(fullpageos), usage-statistics))"
44

55
# if set will enlarge root parition prior to build by provided size in MB

src/modules/fullpageos/config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
[ -n "$FULLPAGEOS_OVERRIDE_KBD_MODEL" ] || FULLPAGEOS_OVERRIDE_KBD_MODEL=default
1414
[ -n "$FULLPAGEOS_OVERRIDE_KBD_LAYOUT" ] || FULLPAGEOS_OVERRIDE_KBD_LAYOUT=default
1515

16+
#disable keyboard shortcuts like (CTRL+w,CTRL+N,CTRL+t) for Chromium
17+
[ -n "$FULLPAGEOS_DISABLE_CHROMIUM_KEYBOARD_SHORTCUTS" ] || FULLPAGEOS_DISABLE_CHROMIUM_KEYBOARD_SHORTCUTS=yes
18+
1619
#override password, otherwise use image default
1720
[ -n "$FULLPAGEOS_OVERRIDE_PASSWORD" ] || FULLPAGEOS_OVERRIDE_PASSWORD=default
1821

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
F11
2+
F12
3+
control + n
4+
control + w
5+
control + t
6+
control + j
7+
control + h
8+
control + o
9+
control + p
10+
control + s
11+
control + 2
12+
control + 3
13+
control + 4
14+
control + 5
15+
control + 6
16+
control + 7
17+
control + 8
18+
control + 9
19+
control + tab
20+
control + alt + x
21+
control + pagedown
22+
control + shift + tab
23+
control + pageup
24+
control + shift + t
25+
control+shift + N
26+
control+shift + n
27+
control + shift + i
28+
control + shift + j
29+
control + shift + c

src/modules/fullpageos/filesystem/opt/custompios/scripts/start_chromium_browser

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,45 @@
11
#!/bin/bash
22

3+
PACKAGE="xbindkeys"
4+
5+
# Starting xbindkeys if is installed
6+
if apt list --installed "$PACKAGE" | grep -q "[installed]"; then
7+
# Define the path to our custom config file (relative to the script)
8+
DISABLE_CONFIG_PATH="/boot/firmware/xbindkeys_disable.conf"
9+
CURRENT_USER=$(whoami)
10+
# Define the path to the user's xbindkeysrc file
11+
XBINDKEYS_RC="/home/$CURRENT_USER/.xbindkeysrc"
12+
13+
# Function to generate the xbindkeysrc file based on our config
14+
generate_xbindkeysrc() {
15+
local config_path=$1
16+
local output_path="$XBINDKEYS_RC"
17+
18+
# Create a temporary xbindkeys config file
19+
local temp_file="/tmp/xbindkeysrc.temp"
20+
> "$temp_file" # Clear the file
21+
22+
# Read each line from the config file and format it for xbindkeysrc
23+
while IFS= read -r combo; do
24+
# Skip empty or commented lines
25+
if [[ -z "$combo" || "$combo" =~ ^# ]]; then
26+
continue
27+
fi
28+
echo "\"echo\"" >> "$temp_file"
29+
echo " $combo" >> "$temp_file"
30+
echo >> "$temp_file"
31+
done < "$config_path"
32+
33+
# Copy the temporary file to the user's home directory
34+
cp "$temp_file" "$output_path"
35+
#chown "$user":"$user" "$output_path"
36+
rm "$temp_file"
37+
}
38+
echo "$PACKAGE is installed so starting the package!"
39+
generate_xbindkeysrc "$DISABLE_CONFIG_PATH"
40+
xbindkeys &
41+
fi
42+
343
flags=(
444
--kiosk
545
--touch-events=enabled

src/modules/fullpageos/start_chroot_script

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ then
2727
systemctl disable getty@tty1
2828
fi
2929

30+
#Disable keyboard shortcuts like (CTRL+w,CTRL+N,CTRL+t) for Chromium
31+
if [ "$FULLPAGEOS_DISABLE_CHROMIUM_KEYBOARD_SHORTCUTS" == "yes" ]
32+
then
33+
#Only install if not disabled by configuration
34+
echo "Disable keyboard shortcuts like (CTRL+w,CTRL+N,CTRL+t) for Chromium: $FULLPAGEOS_DISABLE_CHROMIUM_KEYBOARD_SHORTCUTS"
35+
apt-get install xbindkeys -y
36+
fi
37+
3038
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)
3139

3240
apt-get remove -y --purge $remove_extra

0 commit comments

Comments
 (0)