summarylogtreecommitdiffstats
path: root/g13.install
blob: 2a27f2d0adf06b7e0caccbad8a50c3ad107cc762 (plain)
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
post_install() {
  echo "(Re)creating group and user ..."
  getent passwd g13 > /dev/null 2>&1 || useradd -c 'Logitech G13 daemon' -G wheel -d /run/g13d -s /usr/bin/nologin -r g13
  passwd -l g13 > /dev/null
  echo "Adding user to input group"
  gpasswd -a g13 input
  echo "(Re)creating tmpfiles ..."
  systemd-tmpfiles --create /usr/lib/tmpfiles.d/g13.conf
  echo "NOTE: Uncomment lines in /usr/lib/udev/rules.d/91-g13.rules to start g13 systemd service when G13 is connected"
  echo "      and add commands to /etc/g13/default.bind for initial configuration (see /usr/share/doc/g13-git/examples)"
  echo "      Location of g13d input fifo has moved from /tmp/g13-0 to /run/g13d/g13-0"
}

post_upgrade() {
  post_install
}

pre_remove() {
  echo "Removing tmpfiles ..."
  systemd-tmpfiles --remove /usr/lib/tmpfiles.d/g13.conf
}

post_remove() {
  echo "Making sure the g13d service is not running ..."
  systemctl stop g13
  echo "Removing user from input group ..."
  gpasswd -d g13 input
  echo "Removing user and group ..."
  getent passwd g13 > /dev/null 2>&1 && userdel g13
}