summarylogtreecommitdiffstats
path: root/imod.install
blob: 9c8b0c9ffa1f32a4c9e8ec98aaf19e605073b12e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
post_install() {
  INSEXTRAFAIL=0
  { udevadm control --reload-rules && udevadm trigger; } || INSEXTRAFAIL=1
  sleep 1
  modprobe uinput || INSEXTRAFAIL=1
  if [ -e /dev/uinput ]
    then chmod 660 /dev/uinput || INSEXTRAFAIL=1
         chown root:input /dev/uinput || INSEXTRAFAIL=1
         touch /dev/uinput
         sleep 0.25
         UISTAT=$(stat -c %a /dev/uinput)
         if [ $UISTAT == "600" ]
           then INSEXTRAFAIL=1
         fi
    else INSEXTRAFAIL=1
  fi
  echo "add yourself to the input group in order to be able to use the program:"
  echo "sudo usermod -a -G input <username>"

  if [ $INSEXTRAFAIL -eq 1 ]
    then echo "additionally, you may have to reboot... :("
  fi
}