mirror of
https://github.com/mkuf/prind.git
synced 2025-11-01 02:45:55 +01:00
script: add provisional x11 setup script
This commit is contained in:
committed by
Markus Küffner
parent
e85751b34f
commit
7043f46756
43
scripts/setup-X11.sh
Normal file
43
scripts/setup-X11.sh
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
## This script installs X11 and sets up a xinit service
|
||||||
|
## xterm is running in foreground until the klipperscreen
|
||||||
|
## container connects to the xserver
|
||||||
|
|
||||||
|
#!/bin/bash -xe
|
||||||
|
|
||||||
|
## Name of the new user
|
||||||
|
USER=screen
|
||||||
|
|
||||||
|
## Create User
|
||||||
|
adduser --system --disabled-password --no-create-home ${USER}
|
||||||
|
|
||||||
|
## Install Packages
|
||||||
|
apt update
|
||||||
|
apt install -y
|
||||||
|
xterm
|
||||||
|
xinit
|
||||||
|
xinput
|
||||||
|
xserver-xorg
|
||||||
|
x11-xserver-utils
|
||||||
|
xserver-xorg-video-fbdev
|
||||||
|
|
||||||
|
## Allow any User to start X
|
||||||
|
sed -i 's/allowed_users=console/allowed_users=anybody/g' /etc/X11/Xwrapper.config || true
|
||||||
|
|
||||||
|
## Create the xinit systemd service
|
||||||
|
cat <<EOF > /etc/systemd/system/xinit.service
|
||||||
|
[Unit]
|
||||||
|
Description=Autologin to X
|
||||||
|
After=systemd-user-sessions.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=${USER}
|
||||||
|
ExecStart=/usr/bin/xinit /usr/bin/xterm -maximized
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
EOF
|
||||||
|
|
||||||
|
## Reload, enable and start the xinit service
|
||||||
|
systemctl daemon-reload
|
||||||
|
systemctl enable xinit.service
|
||||||
|
systemctl start xinit
|
||||||
Reference in New Issue
Block a user