Skip to content

Commit

Permalink
Set up the room
Browse files Browse the repository at this point in the history
Fixes #9
  • Loading branch information
strugee committed Oct 13, 2024
1 parent a2e0e69 commit be1b3b5
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
1 change: 1 addition & 0 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ ADD https://extensions.gnome.org/extension-data/grand-theft-focuszalckos.github.
COPY bin/* /usr/bin/
COPY sbin/* /usr/sbin/
COPY systemd/* /usr/lib/systemd/system/
COPY launchers/* /usr/share/applications/
COPY misc/seagl-state-dir.conf /usr/lib/tmpfiles.d/
COPY icon/seagl-logo-icon.svg /usr/share/icons/hicolor/scalable/places/

Expand Down
10 changes: 10 additions & 0 deletions launchers/room-setup.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Desktop Entry]

Type=Application
Version=1.0
Name=Setup SeaGL Room
# Used as a tooltip
Comment=Normally, this should be run automatically
Exec=sudo /usr/sbin/seagl-setup-room
Terminal=true
Categories=Utilities;ConsoleOnly;
29 changes: 29 additions & 0 deletions sbin/seagl-setup-room
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash

set -euo pipefail

if [ -e /var/lib/seagl/room-setup-complete ]; then
exit 0
fi

if ! [ $(id -u) == 0 ]; then
echo must be run as root 1>&2
exit 1
fi

mkdir -p /var/lib/seagl
zenity --list --text='Which room is this?' --column=Room Lyceum 332 334 340 > /var/lib/seagl/room-id

hostnamectl location "$(sed -E 's/([[:digit:]])/Room \1/' < /var/lib/seagl/room-id)"

if zenity --question --text='Should this laptop be provisioned for streaming? Choose no if it will only be used for presentations.'; then
echo streaming > /var/lib/seagl/laptop-type
else
echo presentations > /var/lib/seagl/laptop-type
fi

hostnamectl hostname seagl-$(tr '[:upper:]' '[:lower:]' < /var/lib/seagl/room-id)-$(cat /var/lib/seagl/laptop-type)

# TODO retrieve config, etc.

touch /var/lib/seagl/room-setup-complete

0 comments on commit be1b3b5

Please sign in to comment.