diff --git a/etc/systemd/system/backup-wd2tb.service b/etc/systemd/system/backup-wd2tb.service new file mode 100644 index 0000000..c452876 --- /dev/null +++ b/etc/systemd/system/backup-wd2tb.service @@ -0,0 +1,10 @@ +[Unit] +Description=My auto backup to WD Passport +Requires=media-wdpassport2tb.mount +After=media-wdpassport2tb.mount + +[Service] +ExecStart=/home/fschl/dotfiles/scripts/show_local_backup.sh + +[Install] +WantedBy=media-wdpassport2tb.mount \ No newline at end of file diff --git a/etc/systemd/system/syncthing-resume.service b/etc/systemd/system/syncthing-resume.service new file mode 100644 index 0000000..8881e7a --- /dev/null +++ b/etc/systemd/system/syncthing-resume.service @@ -0,0 +1,11 @@ +[Unit] +Description=Restart Syncthing after resume +Documentation=man:syncthing(1) +After=sleep.target + +[Service] +Type=oneshot +ExecStart=-/usr/bin/pkill -HUP -x syncthing + +[Install] +WantedBy=sleep.target diff --git a/etc/systemd/system/syncthing@.service b/etc/systemd/system/syncthing@.service new file mode 100644 index 0000000..b76b0d2 --- /dev/null +++ b/etc/systemd/system/syncthing@.service @@ -0,0 +1,24 @@ +[Unit] +Description=Syncthing - Open Source Continuous File Synchronization for %I +Documentation=man:syncthing(1) +After=network.target +StartLimitIntervalSec=60 +StartLimitBurst=4 + +[Service] +User=%i +ExecStart=/usr/bin/syncthing serve --no-browser --no-restart --logflags=0 +Restart=on-failure +RestartSec=1 +SuccessExitStatus=3 4 +RestartForceExitStatus=3 4 + +# Hardening +ProtectSystem=full +PrivateTmp=true +SystemCallArchitectures=native +MemoryDenyWriteExecute=true +NoNewPrivileges=true + +[Install] +WantedBy=multi-user.target diff --git a/scripts/install.sh b/scripts/install.sh index 4e7d28d..4574048 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -262,6 +262,12 @@ install_i3() { Exec=/usr/lib/notification-daemon/notification-daemon EOF + echo "... setting capslock to control" + sed -i "s/^XKBOPTIONS=.*/XKBOPTIONS=\"ctrl:nocaps\"/" /etc/default/keyboard + +} + +install_syncthing() { # install Syncthing via https://apt.syncthing.net/ # Add the release PGP keys: curl -s https://syncthing.net/release-key.txt | sudo apt-key add - @@ -280,16 +286,14 @@ EOF apt autoclean apt clean - TARGET="/home/$USERNAME/.emacs.d" - git clone https://github.com/syl20bnr/spacemacs "${TARGET}" -# rm -rf "${TARGET}"/private/snippets -# git clone https://github.com/AndreaCrotti/yasnippet-snippets "${TARGET}"/private/yas-snippets -# ln -s "${TARGET}"/private/yas-snips/snippets "${TARGET}"/private/snippets/ + echo "enable and start the syncthing per-user service for ${USERNAME}" + cp ../etc/systemd/system/syncth* /etc/systemd/system/ + user=${USERNAME} + sudo systemctl daemon-reload + sudo systemctl enable syncthing@${USERNAME} + sudo systemctl start syncthing@${USERNAME}.service + systemctl status syncthing@${USERNAME}.service - no_suspend - - echo "... setting capslock to control" - sed -i "s/^XKBOPTIONS=.*/XKBOPTIONS=\"ctrl:nocaps\"/" /etc/default/keyboard } install_vscodium() {