2012-06-03 00:27:14 +02:00
|
|
|
#!/bin/sh -e
|
2009-12-13 23:54:05 +01:00
|
|
|
# read list of scancodes, convert hex to decimal and
|
|
|
|
# append to the atkbd force_release sysfs attribute
|
|
|
|
# $1 sysfs devpath for serioX
|
|
|
|
# $2 file with scancode list (hex or dec)
|
|
|
|
|
|
|
|
case "$2" in
|
2012-01-10 01:34:15 +01:00
|
|
|
/*) scf="$2" ;;
|
2012-06-02 20:46:05 +02:00
|
|
|
*) scf="@udevlibexecdir@/keymaps/force-release/$2" ;;
|
2009-12-13 23:54:05 +01:00
|
|
|
esac
|
|
|
|
|
|
|
|
read attr <"/sys/$1/force_release"
|
|
|
|
while read scancode dummy; do
|
2012-01-10 01:34:15 +01:00
|
|
|
case "$scancode" in
|
|
|
|
\#*) ;;
|
|
|
|
*)
|
|
|
|
scancode=$(($scancode))
|
|
|
|
attr="$attr${attr:+,}$scancode"
|
|
|
|
;;
|
|
|
|
esac
|
2009-12-13 23:54:05 +01:00
|
|
|
done <"$scf"
|
|
|
|
echo "$attr" >"/sys/$1/force_release"
|