feat: support unattended setup for flatpak (#835)

* feat: support unattended setup for flatpak

* fix: typo

* chore: add doc
This commit is contained in:
Ilya Zlobintsev
2026-01-05 10:01:19 +02:00
committed by GitHub
parent fc9203040a
commit 804b24b471
2 changed files with 16 additions and 6 deletions
+2
View File
@@ -17,6 +17,8 @@ It is also possible to skip the service setup if you want to use LACT only for i
> Note: the setup script requires Polkit to be functional.
If you wish to set up the service automatically in a script (without graphical prompts), you can run the Flatpak with the `LACT_UNATTENDED_SETUP=true` environment variable.
## Service permissions
The setup script will automatically configure the daemon in such a way that the user who ran the setup has access to it.
+14 -6
View File
@@ -13,17 +13,23 @@ if [ ! -e "${DAEMON_SOCKET}" ]; then
set +e
YAD_OUTPUT=$(yad --title="LACT Flatpak Setup" \
--text="The LACT system service could not be found.
if [ "${LACT_UNATTENDED_SETUP}" == "true" ]; then
YAD_OUTPUT="TRUE|"
EXIT_CODE=0
else
YAD_OUTPUT=$(yad --title="LACT Flatpak Setup" \
--text="The LACT system service could not be found.
In order to edit GPU settings, LACT requires a service to be running as root.
This setup will install <u><tt>lactd.service</tt></u> outside of the Flatpak sandbox.
It is possible to skip this step if you wish to use LACT only for information and monitoring.
Do you wish to install the service?" \
--form \
--field "Autostart service at boot":CHK "TRUE")
EXIT_CODE=$?
--form \
--field "Autostart service at boot":CHK "TRUE")
EXIT_CODE=$?
fi
set -e
@@ -70,7 +76,9 @@ WantedBy=multi-user.target\
flatpak-spawn --host $ROOT_WRAPPER sh -c "systemctl daemon-reload && systemctl start lactd.service"
fi
yad --text 'The service has been started. Please run LACT again.' --button=OK:0
if [ "${LACT_UNATTENDED_SETUP}" != "true" ]; then
yad --text 'The service has been started. Please run LACT again.' --button=OK:0
fi
exit 0
else
echo "Service setup rejected, skipping"