From bf1d184ae9a660010ef05126a9bc308c89c38d1b Mon Sep 17 00:00:00 2001 From: Federico Terzi Date: Sat, 11 Dec 2021 11:36:16 +0100 Subject: [PATCH] feat(core): stop espanso when removing snap. #464 --- snap/hooks/remove | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 snap/hooks/remove diff --git a/snap/hooks/remove b/snap/hooks/remove new file mode 100755 index 0000000..5f85fec --- /dev/null +++ b/snap/hooks/remove @@ -0,0 +1,12 @@ +#!/bin/sh + +echo "Stopping Espanso..." +killall espanso + +# Here I've also tried to unregister the Systemd service, but couldn't manage to. +# The remove hook is run as Root, but the systemd service is registered as a user. +# I couldn't find any (working) way to unregister a user systemd service as root. +# I've also tried these solutions: https://unix.stackexchange.com/questions/552922/stop-systemd-user-services-as-root-user +# but none seemed to work in this case. +# If you manage to find a way to do so, feel free to open an issue so that +# we can improve the hook! Thanks \ No newline at end of file