## Copyright (C) 2021 - 2025 ENCRYPTED SUPPORT LLC <adrelanos@whonix.org>
## See the file COPYING for copying conditions.

## https://gitlab.gnome.org/GNOME/orca/-/issues/188

[Unit]
Description=sends signal sigterm to the orca screenreader at shutdown
Documentation=https://www.kicksecure.com/wiki/orca
ConditionPathExists=/usr/bin/orca

[Service]
Type=oneshot
RemainAfterExit=yes

## Proper shutdown. Give orca chance to say notification "screenreader off".
ExecStop=/bin/bash -c 'killall -s SIGTERM orca'

## In case of issues.
## https://gitlab.gnome.org/GNOME/orca/-/issues/188
## https://gitlab.gnome.org/GNOME/orca/-/issues/190
ExecStop=/bin/bash -c 'sleep 5 && killall -s KILL orca'

## killall -s KILL orca ; echo $?
## orca: no process found
## 1
SuccessExitStatus=1

[Install]
WantedBy=multi-user.target
