forked from autokey/autokey
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathautokey-common.postinst
More file actions
35 lines (31 loc) · 1.67 KB
/
Copy pathautokey-common.postinst
File metadata and controls
35 lines (31 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/sh
set -e
# Change group ownership on /dev/uinput to permit non-root write access
if [ -e /dev/uinput ]; then
cp /usr/share/autokey/uinput-udev-rule/* '/etc/udev/rules.d/'
/usr/bin/udevadm control --reload
/usr/bin/udevadm trigger --sysname-match='/devices/virtual/misc/uinput'
fi
if [ "$USER" = "root" ] && [ "$(logname)" != "root" ]; then
# Add the user to the "input" group
if [ -e /dev/uinput ]; then
usermod -a -G "input" "$(logname)"
fi
# If Gnome is present, install the Gnome Shell extension
gnome-extensions &>/dev/null
if [ $? -ne 127 ]; then
su -c 'gnome-extensions install --force /usr/share/autokey/gnome-shell-extension/autokey-gnome-extension@autokey.shell-extension.zip' $(logname)
fi
else
echo "*******************************************************************************"
echo "* If you plan to run AutoKey on a Wayland desktop, please enter the *"
echo "* following commands to configure your userid to run AutoKey: *"
echo "* *"
echo "sudo usermod -a -G input \$(id -u -n)"
echo "gnome-extension install --force /usr/share/autokey/gnome-shell-extension/autokey-gnome-extension@autokey.shell-extension.zip"
echo "* *"
echo "* You will need to log off and log back on so that these changes take *"
echo "* effect before trying to run AutoKey. *"
echo "*******************************************************************************"
fi
#DEBHELPER#