Add workaround for old ubuntu systemd

This commit is contained in:
2021-01-27 16:38:00 +01:00
parent 18833de76b
commit 956e7abf0d
8 changed files with 19 additions and 8 deletions

View File

@@ -2,7 +2,7 @@
BindsTo=autostart.target
After=windowmanager.target
ConditionEnvironment=MACHINE_HAS_DISCORD=true
ConditionPathExists=%h/.var/run/features/discord
[Service]
ExecStart=/usr/bin/env discord

View File

@@ -1,7 +1,7 @@
[Unit]
BindsTo=autostart.target
After=windowmanager.target
ConditionEnvironment=MACHINE_HAS_KEEPASSX=true
ConditionPathExists=%h/.var/run/features/keepassx
[Service]
ExecStart=/usr/bin/env keepassx --keyfile %h/.secret/main.key %h/.secret/main.kdbx

View File

@@ -1,8 +1,7 @@
[Unit]
BindsTo=autostart.target
After=windowmanager.target
ConditionEnvironment=MACHINE_TYPE=laptop
ConditionPathExists=%h/.var/run/features/machine_is_laptop
[Service]
ExecStart=/usr/bin/env bash -c 'grep "^${ACPI_LID_NAME}.*enabled" /proc/acpi/wakeup && echo " ${ACPI_LID_NAME}" | sudo tee /proc/acpi/wakeup'

View File

@@ -3,7 +3,7 @@ BindsTo=autostart.target
After=windowmanager.target
After=gnome-keyring.service
ConditionEnvironment=MACHINE_HAS_NEXTCLOUD=true
ConditionPathExists=%h/.var/run/features/nextcloud
[Service]
ExecStart=/usr/bin/env nextcloud --background

View File

@@ -1,5 +1,5 @@
[Unit]
ConditionEnvironment=MACHINE_HAS_RESTIC_BACKUP=true
ConditionPathExists=%h/.var/run/features/restic_backup
[Service]
Type=oneshot

View File

@@ -3,7 +3,7 @@ BindsTo=autostart.target
After=windowmanager.target
After=i3.service
ConditionEnvironment=MACHINE_HAS_STEAM=true
ConditionPathExists=%h/.var/run/features/steam
[Service]
ExecStart=/usr/bin/env steam

View File

@@ -1,7 +1,7 @@
[Unit]
BindsTo=autostart.target
After=windowmanager.target
ConditionEnvironment=MACHINE_TYPE=laptop
ConditionPathExists=%h/.var/run/features/machine_is_laptop
[Service]
Type=oneshot

View File

@@ -54,6 +54,18 @@ umask 0022
export {{ k }}="{{ v }}"
{% endfor %}
export FEATURE_DIR="${RUNDIR}/features/"
rm -rf "${FEATURE_DIR}"/
mkdir -p "${FEATURE_DIR}"
[[ $MACHINE_HAS_NEXTCLOUD == "true" ]] && touch "${FEATURE_DIR}"/nextcloud
[[ $MACHINE_HAS_KEEPASSX == "true" ]] && touch "${FEATURE_DIR}"/keepassx
[[ $MACHINE_HAS_STEAM == "true" ]] && touch "${FEATURE_DIR}"/steam
[[ $MACHINE_HAS_DISCORD == "true" ]] && touch "${FEATURE_DIR}"/discord
[[ $MACHINE_HAS_RESTIC_BACKUP == "true" ]] && touch "${FEATURE_DIR}"/restic_backup
[[ $MACHINE_TYPE == "laptop" ]] && touch "${FEATURE_DIR}"/matchine_is_laptop
# Make all environment variables also usable in the systemd user instancee
systemctl --user import-environment