From e5414cbadf77b04de5822b75dad2e879a1335b6e Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Mon, 21 Sep 2020 09:07:38 +0200 Subject: [PATCH] services: Fix flashfocus startup Flashfocus did not start up correctly since it was not required for the `default.target` which is the only (?) valid target when systemd operates in user-mode. Instead of overwriting just part of the flashfocus service file, and subsequently having it enabled for default.target and a non-existent graphical.target user environment, we overwrite the whole file and set it to `default.target`. Additionally, the service should be restarted when it fails and slow down on its restart attempts (I kept 5 seconds for this one, since it is not as time critical as others -- no one cares if windows only flash 5 seconds after starting the machine.) Added (wishful) After components to many service units, in case I figure out one day how to make a useful target for the systemd user mode. --- .../user/default.target.wants/flashfocus.service | 1 + .../.config/systemd/user/dropdown-terminal.service | 1 + services/.config/systemd/user/dropdown-todo.service | 1 + services/.config/systemd/user/flashfocus.service | 12 ++++++++++++ .../systemd/user/flashfocus.service.d/override.conf | 2 -- .../flashfocus.service | 2 +- services/.config/systemd/user/uni-notes-sync.service | 1 + 7 files changed, 17 insertions(+), 3 deletions(-) create mode 120000 services/.config/systemd/user/default.target.wants/flashfocus.service create mode 100644 services/.config/systemd/user/flashfocus.service delete mode 100644 services/.config/systemd/user/flashfocus.service.d/override.conf diff --git a/services/.config/systemd/user/default.target.wants/flashfocus.service b/services/.config/systemd/user/default.target.wants/flashfocus.service new file mode 120000 index 0000000..2305e41 --- /dev/null +++ b/services/.config/systemd/user/default.target.wants/flashfocus.service @@ -0,0 +1 @@ +../flashfocus.service \ No newline at end of file diff --git a/services/.config/systemd/user/dropdown-terminal.service b/services/.config/systemd/user/dropdown-terminal.service index fc46816..8a02ffa 100644 --- a/services/.config/systemd/user/dropdown-terminal.service +++ b/services/.config/systemd/user/dropdown-terminal.service @@ -1,5 +1,6 @@ [Unit] Description=Alacritty window hidden on i3 scratchpad +After=display-manager.service [Service] Type=simple diff --git a/services/.config/systemd/user/dropdown-todo.service b/services/.config/systemd/user/dropdown-todo.service index 7cb9299..8bea35c 100644 --- a/services/.config/systemd/user/dropdown-todo.service +++ b/services/.config/systemd/user/dropdown-todo.service @@ -1,5 +1,6 @@ [Unit] Description=Todo.md floating vim instance +After=display-manager.service [Service] Type=simple diff --git a/services/.config/systemd/user/flashfocus.service b/services/.config/systemd/user/flashfocus.service new file mode 100644 index 0000000..c407aff --- /dev/null +++ b/services/.config/systemd/user/flashfocus.service @@ -0,0 +1,12 @@ +[Unit] +Description=Perform windows animations on focus +PartOf=graphical-session.target +After=graphical-session.target + +[Service] +ExecStart=/usr/bin/flashfocus +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=default.target diff --git a/services/.config/systemd/user/flashfocus.service.d/override.conf b/services/.config/systemd/user/flashfocus.service.d/override.conf deleted file mode 100644 index b7063fd..0000000 --- a/services/.config/systemd/user/flashfocus.service.d/override.conf +++ /dev/null @@ -1,2 +0,0 @@ -[Service] -RestartSec=5 diff --git a/services/.config/systemd/user/graphical-session.target.wants/flashfocus.service b/services/.config/systemd/user/graphical-session.target.wants/flashfocus.service index e9696ac..0916e81 120000 --- a/services/.config/systemd/user/graphical-session.target.wants/flashfocus.service +++ b/services/.config/systemd/user/graphical-session.target.wants/flashfocus.service @@ -1 +1 @@ -/usr/lib/systemd/user/flashfocus.service \ No newline at end of file +/home/marty/.config/systemd/user/flashfocus.service \ No newline at end of file diff --git a/services/.config/systemd/user/uni-notes-sync.service b/services/.config/systemd/user/uni-notes-sync.service index 114ad50..88e00ca 100644 --- a/services/.config/systemd/user/uni-notes-sync.service +++ b/services/.config/systemd/user/uni-notes-sync.service @@ -1,5 +1,6 @@ [Unit] Description=Automatically commit notes in university directory +After=display-manager.service [Service] Type=simple