mirror of
https://github.com/karl0ss/AnotterKiosk.git
synced 2025-06-05 19:55:06 +01:00
Compare commits
No commits in common. "main" and "v1.0.1" have entirely different histories.
6
.github/workflows/main.yml
vendored
6
.github/workflows/main.yml
vendored
@ -39,7 +39,7 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
raspberrypi:
|
||||
runs-on: [self-hosted]
|
||||
runs-on: [self-hosted, hetzner-cax21]
|
||||
|
||||
outputs:
|
||||
pkgfile: ${{ steps.pkgname.outputs.pkgfile }}
|
||||
@ -55,7 +55,7 @@ jobs:
|
||||
|
||||
- name: Build firmware
|
||||
run: |
|
||||
sudo ./build_raspberry_pi.sh
|
||||
./build_raspberry_pi.sh
|
||||
|
||||
- name: Release build artifacts
|
||||
uses: softprops/action-gh-release@v1
|
||||
@ -66,4 +66,4 @@ jobs:
|
||||
files: |
|
||||
./anotterkiosk-*
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
11
README.md
11
README.md
@ -1,13 +1,6 @@
|
||||
N-AnotterKiosk (Not-AnotterKiosk)
|
||||
AnotterKiosk
|
||||
=============================
|
||||
|
||||
### I have hacked this about alot from the main branch, mainly Raspberry Pi changes
|
||||
- Removed the RO filesystem
|
||||
- Added scheduled screen on/off
|
||||
- Added scheduled chrome page refresh
|
||||
- Rpi3 Overclock settings
|
||||
- Disabled KMS driver for HW screen rotation (screen rotated portrait by default)
|
||||
|
||||
### Overview
|
||||
Another kiosk browser OS? Yes, this one is a little bit opinionated :)
|
||||
|
||||
@ -76,4 +69,4 @@ Whenever the heartbeat stops (for whatever reason), the device will first restar
|
||||
|
||||
### Inspiration / Other Kiosk-OSes:
|
||||
- https://github.com/jareware/chilipie-kiosk/
|
||||
- https://github.com/guysoft/FullPageOS
|
||||
- https://github.com/guysoft/FullPageOS
|
@ -17,8 +17,6 @@ reboot_time = 04:00
|
||||
; configure screen to power on/off as specific time of day (time format in 24 hours)
|
||||
;screen_off_time=23:00
|
||||
;screen_on_time=07:00
|
||||
; configure chrome to refresh the page every x minutes
|
||||
;refresh_screen_every_x_min=15
|
||||
|
||||
[wifi]
|
||||
; If you need more complex WiFi settings (like WPA2-Enterprise, hidden SSIDs, etc.)
|
||||
|
@ -80,7 +80,6 @@ systemctl enable nginx
|
||||
systemctl enable ssh
|
||||
systemctl enable kiosk-sechedule-screen.service
|
||||
systemctl enable schedule-reboot.service
|
||||
systemctl enable setup-refresh-timer.service
|
||||
|
||||
|
||||
# generate a version info/build info file
|
||||
|
@ -1,11 +0,0 @@
|
||||
[Unit]
|
||||
Description=Initial screen refresh timer setup
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/bin/setup-refresh-timer
|
||||
RemainAfterExit=true
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -1,4 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
export DISPLAY=:0
|
||||
/usr/bin/xdotool key F5
|
15
kiosk_skeleton/usr/bin/schedule-reboot
Executable file → Normal file
15
kiosk_skeleton/usr/bin/schedule-reboot
Executable file → Normal file
@ -1,16 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
INI_FILE="/boot/kioskbrowser.ini"
|
||||
|
||||
remount_root() {
|
||||
local mode=$1
|
||||
echo "Remounting root filesystem as $mode..."
|
||||
mount -o remount,"$mode" / || {
|
||||
echo "Failed to remount root as $mode"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
REBOOT_ENABLED=$(awk -F '=' '/^\[reboot\]/ { in_reboot=1; next }
|
||||
in_reboot && /^\[/ { in_reboot=0 }
|
||||
in_reboot && $1 ~ /enabled/ { gsub(/ /, "", $2); print $2 }' "$INI_FILE")
|
||||
@ -22,8 +12,6 @@ REBOOT_TIME=$(awk -F '=' '/^\[reboot\]/ { in_reboot=1; next }
|
||||
if [[ "$REBOOT_ENABLED" -eq 1 ]] && [[ "$REBOOT_TIME" =~ ^[0-2][0-9]:[0-5][0-9]$ ]]; then
|
||||
echo "Scheduling reboot for $REBOOT_TIME..."
|
||||
|
||||
remount_root rw
|
||||
|
||||
TARGET_TIME=$(date -d "$REBOOT_TIME" +%s)
|
||||
NOW=$(date +%s)
|
||||
|
||||
@ -46,6 +34,7 @@ Persistent=false
|
||||
WantedBy=timers.target
|
||||
EOF
|
||||
|
||||
# Create the associated service
|
||||
cat <<EOF > /etc/systemd/system/reboot-at.service
|
||||
[Unit]
|
||||
Description=Scheduled Reboot
|
||||
@ -57,8 +46,6 @@ EOF
|
||||
|
||||
systemctl daemon-reload
|
||||
systemctl enable --now reboot-at.timer
|
||||
|
||||
remount_root ro
|
||||
else
|
||||
echo "Reboot not scheduled (disabled or invalid time)"
|
||||
fi
|
||||
|
32
kiosk_skeleton/usr/bin/schedule-screen-timers
Executable file → Normal file
32
kiosk_skeleton/usr/bin/schedule-screen-timers
Executable file → Normal file
@ -3,18 +3,6 @@
|
||||
INI_FILE="/boot/kioskbrowser.ini"
|
||||
SYSTEMD_DIR="/etc/systemd/system"
|
||||
|
||||
|
||||
# Function to safely remount root FS
|
||||
remount_root() {
|
||||
local mode=$1
|
||||
echo "Remounting root filesystem as $mode..."
|
||||
mount -o remount,"$mode" / || {
|
||||
echo "Failed to remount root as $mode"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
get_ini_value() {
|
||||
local section=$1 key=$2
|
||||
awk -F '=' -v sec="$section" -v k="$key" '
|
||||
@ -29,17 +17,6 @@ get_ini_value() {
|
||||
create_recurring_timer() {
|
||||
local action=$1
|
||||
local time=$2
|
||||
local value
|
||||
|
||||
if [[ "$action" == "on" ]]; then
|
||||
value=1
|
||||
elif [[ "$action" == "off" ]]; then
|
||||
value=0
|
||||
else
|
||||
echo "Invalid action: $action"
|
||||
return 1
|
||||
fi
|
||||
|
||||
local name="screen-${action}"
|
||||
|
||||
echo "Setting daily screen ${action} at ${time}"
|
||||
@ -62,15 +39,14 @@ Description=Turn screen ${action}
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/bin/vcgencmd display_power ${value}
|
||||
User=pi
|
||||
Environment=DISPLAY=:0
|
||||
ExecStart=/usr/bin/xset dpms force ${action}
|
||||
EOF
|
||||
|
||||
systemctl daemon-reload
|
||||
systemctl enable --now "${name}.timer"
|
||||
}
|
||||
|
||||
|
||||
cleanup_screen_timers() {
|
||||
for action in on off; do
|
||||
systemctl disable --now screen-${action}.timer 2>/dev/null
|
||||
@ -79,8 +55,6 @@ cleanup_screen_timers() {
|
||||
systemctl daemon-reload
|
||||
}
|
||||
|
||||
remount_root rw
|
||||
|
||||
# === MAIN ===
|
||||
SCREEN_ON=$(get_ini_value screen screen_on_time)
|
||||
SCREEN_OFF=$(get_ini_value screen screen_off_time)
|
||||
@ -89,5 +63,3 @@ cleanup_screen_timers
|
||||
|
||||
[[ "$SCREEN_ON" =~ ^[0-2][0-9]:[0-5][0-9]$ ]] && create_recurring_timer on "$SCREEN_ON"
|
||||
[[ "$SCREEN_OFF" =~ ^[0-2][0-9]:[0-5][0-9]$ ]] && create_recurring_timer off "$SCREEN_OFF"
|
||||
|
||||
remount_root ro
|
||||
|
@ -1,65 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
INI_FILE="/boot/kioskbrowser.ini"
|
||||
REFRESH_INTERVAL=$(awk -F '=' '/^\[screen\]/ { in_screen=1; next }
|
||||
in_screen && /^\[/ { in_screen=0 }
|
||||
in_screen && $1 ~ /refresh_screen_every_x_min/ { gsub(/ /, "", $2); print $2 }' "$INI_FILE")
|
||||
|
||||
# Function to safely remount root FS
|
||||
remount_root() {
|
||||
local mode=$1
|
||||
echo "Remounting root filesystem as $mode..."
|
||||
mount -o remount,"$mode" / || {
|
||||
echo "Failed to remount root as $mode"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
# Safely check if REFRESH_INTERVAL is a positive integer
|
||||
if [[ "$REFRESH_INTERVAL" =~ ^[0-9]+$ ]] && (( REFRESH_INTERVAL > 0 )); then
|
||||
echo "Setting up screen refresh every $REFRESH_INTERVAL minutes..."
|
||||
|
||||
SERVICE_UNIT="/etc/systemd/system/screen-refresh.service"
|
||||
TIMER_UNIT="/etc/systemd/system/screen-refresh.timer"
|
||||
|
||||
# Remount as read-write
|
||||
remount_root rw
|
||||
|
||||
# Write unit files
|
||||
cat <<EOF | tee "$SERVICE_UNIT" > /dev/null
|
||||
[Unit]
|
||||
Description=Refresh Screen
|
||||
After=graphical.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
User=pi
|
||||
Environment=DISPLAY=:0
|
||||
Environment=XAUTHORITY=/home/pi/.Xauthority
|
||||
ExecStart=/usr/bin/refresh-screen
|
||||
EOF
|
||||
|
||||
cat <<EOF | tee "$TIMER_UNIT" > /dev/null
|
||||
[Unit]
|
||||
Description=Run screen refresh every $REFRESH_INTERVAL minutes
|
||||
|
||||
[Timer]
|
||||
OnBootSec=1min
|
||||
OnUnitActiveSec=${REFRESH_INTERVAL}min
|
||||
Persistent=false
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
EOF
|
||||
|
||||
# Reload and enable timer
|
||||
systemctl daemon-reload
|
||||
systemctl enable --now screen-refresh.timer
|
||||
|
||||
# Remount as read-only
|
||||
remount_root ro
|
||||
|
||||
echo "Screen refresh timer setup complete."
|
||||
else
|
||||
echo "Invalid or missing refresh interval"
|
||||
fi
|
@ -28,14 +28,11 @@
|
||||
enable_uart=1
|
||||
disable_splash=1
|
||||
dtparam=audio=on
|
||||
gpu_mem=256
|
||||
gpu_mem=128
|
||||
|
||||
# Enable DRM VC4 V3D driver
|
||||
#dtoverlay=vc4-kms-v3d
|
||||
#max_framebuffers=2
|
||||
|
||||
# Rotate the screen
|
||||
display_hdmi_rotate=1
|
||||
dtoverlay=vc4-kms-v3d
|
||||
max_framebuffers=2
|
||||
|
||||
# Run in 64-bit mode
|
||||
arm_64bit=1
|
||||
@ -49,15 +46,10 @@ disable_overscan=1
|
||||
# (e.g. for USB device mode) or if USB support is not required.
|
||||
otg_mode=1
|
||||
|
||||
[pi3]
|
||||
arm_freq=1350
|
||||
core_freq=500
|
||||
gpu_freq=500
|
||||
over_voltage=4
|
||||
[all]
|
||||
|
||||
[pi4]
|
||||
# Run as fast as firmware / board allows
|
||||
arm_boost=1
|
||||
|
||||
[all]
|
||||
avoid_warnings=1
|
Loading…
x
Reference in New Issue
Block a user