Compare commits

..

10 Commits

Author SHA1 Message Date
Dustin ad37463416 photoframe: Start photo slide show on idle
dustin/photoframe2/pipeline/pr-main This commit looks good Details
The `photoframe` script was based on the one used by the original
Buildroot-based photo frame system.  I've split it into two processes,
though: one to listen to the URL stream and download new photos as
instructed by the server, and another to actually display the photos.
Getting `feh` and Firefox to both be fullscreen at the same time was
difficult, and only works if they are on separate Sway workspaces. Thus,
"activating" the slide show means switching to the workspace where `feh`
is and "deactivating" it means switching back to Firefox's workspace.
2025-01-04 07:30:23 -06:00
Dustin e24a49a627 network: Use MAC address as DHCP client ID
_systemd-networkd_ uses a randomly-generated ID as the DHCP client
identifier by default.  On Aimee OS, it is not able to persist this ID
between boots; I think it may derive the value from the machine ID.  To
avoid getting a new IP address every boot, we can configure it to use
the MAC address of the device as the DHCP client ID.
2025-01-04 07:30:23 -06:00
Dustin fa8c0aec6e Update Aimee OS 2025-01-04 07:30:23 -06:00
Dustin 953db28cfd prepare: Never sync Portage repos
To minimize unexpected changes between builds, I'm going to schedule a
separate task to sync the Portage repositories.  This way, we know that
two runs in a row from the same source will have the same packages,
unless we have specifically updated Portage.
2025-01-04 07:30:23 -06:00
Dustin 413e76128a overlay: Add authorized SSH keys for root
Adding my personal keys so I can manage the system remotely.
2025-01-04 07:30:23 -06:00
Dustin 4b586b70ad kernel: Enable user namespaces for Firefox
Firefox complains about "security features" not working if this is not
enabled.
2025-01-04 07:30:23 -06:00
Dustin e21df5effe exclude: Omit systemd-ssh-generator
This thing is pointless.

Unfortunately, we cannot use Portage's `INSTALL_MASK` feature as it
doesn't work for symbolic links. Since _systemd_ installs symlinks in
`/etc/ssh` that point to files we would mask, those symlinks would point
to nothing, which would cause `sshd` to fail to start as it is unable to
open those files.  Thus, we have to omit these files by excluding them
from the squashfs image.
2025-01-04 07:30:23 -06:00
Dustin 10b7901d5d kernel: Enable BPF firewall for systemd
_systemd_ complains if this is not enabled, as it prevents certain
sandbox features from working.
2025-01-04 07:30:23 -06:00
Dustin 001c471567 kernel/firmware: Support RPi GPU, touchscreen
Getting the Raspberry Pi 4 GPU and 7-inch Touch Display 2 working was
quite challenging.  Several kernel drivers are needed, beyond the
obvious VC4 and V3D, like voltage regulators and backlight controls.
Even with all the drivers enabled, I still had trouble getting
`/dev/dri/card1` (the display device, as opposed to `/dev/dri/card0`,
the 3D rendering device) to appear until I explicitly enabled the
`vc4-kms-dsi-ili9881-7inch` device tree overlay.  I am not entirely sure
why this is necessary, since `display_auto_detect` supposedly should
have added this overlay automatically.  I am also not sure how it would
work if I wanted to use an HDMI monitor instead of the DSI panel, but
fortunately, for this project, that's not necessary.
2025-01-04 07:30:23 -06:00
Dustin b08263688b Begin implementing kiosk browser
This commit introduces the _kiosk.service_ unit, which launches `sway`
to start a Wayland session, which in turn launches Firefox.  The
`policies.json` file configures Firefox in a sort of kiosk mode,
disabling most features and blocking all but the desginated sites.
Unfortunately, running `firefox --kiosk` doesn't actually work: Firefox
apparently runs, but doesn't draw anything on the screen.

Note that we have to launch Firefox by its "real" path, since
`/usr/bin/firefox` is a Bash script, and Bash is not installed.
Fortunately, the wrapper script doesn't do anything we really care
about, so bypassing it is fine.
2025-01-04 07:30:23 -06:00
5 changed files with 65 additions and 6 deletions

View File

@ -1,3 +1,6 @@
gui-apps/swayidle
gui-wm/sway
net-wireless/wpa_supplicant
media-gfx/feh
media-video/pipewire
net-misc/curl
net-wireless/wpa_supplicant

View File

@ -23,7 +23,7 @@
},
"DontCheckDefaultBrowser": true,
"Homepage": {
"URL": "https://homeassistant.pyrocufflink.blue/dashboard-rosalina",
"URL": "https://homeassistant.pyrocufflink.blue/",
"Locked": true,
"StartPage": "homepage-locked"
},
@ -37,7 +37,7 @@
"browser.sessionstore.resume_from_crash": {
"Value": false
},
"browser.startup.couldRestoreSession.cound": {
"browser.startup.couldRestoreSession.count": {
"Value": -1
},
"datareporting.policy.dataSubmissionPolicyBypassNotification": {

View File

@ -6,9 +6,14 @@ input * {
map_to_output DSI-1
}
exec gsettings set org.gnome.desktop.interface gtk-theme Adwaita-dark
exec gsettings set org.gnome.desktop.interface color-scheme prefer-dark
exec /usr/lib64/firefox/firefox
exec /usr/bin/photoframe stream
exec swayidle -w \
timeout 120 'photoframe show' resume 'photoframe hide'
for_window [title="Mozilla Firefox"] fullscreen
for_window [class="photoframe"] fullscreen
assign [title="Mozilla Firefox"] 1
assign [class="photoframe"] 2

46
overlay/usr/bin/photoframe Executable file
View File

@ -0,0 +1,46 @@
#!/bin/sh
photoframe_hide() {
swaymsg 'workspace 1'
}
photoframe_show() {
# Run on a separate workspace so Firefox can stay fullscreen, too
swaymsg 'workspace 2'
if [ -f /tmp/photoframe.pid ]; then
# feh is already running
return 0
fi
if [ ! -f /tmp/photoframe-current ]; then
cp /usr/share/feh/images/feh.png /tmp/photoframe-current
fi
feh -FZ --draw-exif --class photoframe /tmp/photoframe-current &
# Wait for the feh window to actually appear ...
swaymsg -t subscribe '["window"]'
# Sometimes, Sway's `for_window ... fullscreen` doesn't work?
swaymsg fullscreen
echo $! > /tmp/photoframe.pid
}
photoframe_stream() {
while :; do
curl -NsS https://photos.pyrocufflink.blue/stream |
while read url; do
curl -fsL -o /tmp/photoframe-next "${url}" || continue
mv /tmp/photoframe-next /tmp/photoframe-current
done
sleep 30
done
}
case $1 in
show)
photoframe_show
;;
hide)
photoframe_hide
;;
stream)
photoframe_stream
;;
esac

View File

@ -0,0 +1,5 @@
gui-apps/swayidle -systemd
gui-libs/wlroots X
gui-wm/sway X
media-gfx/feh exif inotify
net-misc/curl -alt-svc -ftp -hsts -http3 -imap -pop3 -progress-meter -psl -quic -smtp -tftp -websockets -adns -http2 CURL_QUIC: -*