-
-
Save Elliria/53eff83be4ec37a9c27e680581cc0dc5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # Stop on error: | |
| set -e | |
| # User-detection with fallbacks: | |
| user=$(logname 2>/dev/null) || user=${SUDO_USER:-root} | |
| case "$1" in | |
| remove|deconfigure) | |
| if [ "$user" != "root" ]; then | |
| # Remove the user from the input group: | |
| if [ -e /dev/uinput ]; then | |
| usermod -r -G "input" "$user" || true | |
| fi | |
| # Remove the GNOME Shell Extension if present: | |
| if command -v gnome-extensions >/dev/null 2>&1; then | |
| su -c 'gnome-extensions uninstall "autokey-gnome-extension@autokey"' "$user" || true | |
| rm -fr "/home/$user/.local/share/gnome-shell/extensions/autokey-gnome-extension@autokey" || true | |
| fi | |
| fi | |
| # Remove non-root write access to udev rules: | |
| if [ -e /dev/uinput ]; then | |
| rm -f '/etc/udev/rules.d/10-autokey.rules' | |
| udevadm control --reload-rules > /dev/null 2>&1 || true | |
| #udevadm trigger > /dev/null 2>&1 || true | |
| udevadm trigger --sysname-match='/devices/virtual/misc/uinput' > /dev/null 2>&1 || true | |
| fi | |
| ;; | |
| esac | |
| #DEBHELPER# | |
| exit 0 |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Caution
When copying this file to overwrite it at your end, it should have a blank line at the end. To get the true contents, use the Raw link and copy them from there.