diff --git a/scripts/Unix/Config/KDE/input.sh b/scripts/Unix/Config/KDE/input.sh new file mode 100644 index 00000000..c74c1335 --- /dev/null +++ b/scripts/Unix/Config/KDE/input.sh @@ -0,0 +1,26 @@ +#!/bin/bash +function addInputConfig() { + local configFile=/etc/xdg/kcminputrc; + local id1="$1"; + local id2="$2"; + local deviceName="$3"; + local statements="${@:4}"; + + if [ -z "$statements" ] + then + statements="$(cat)"; + fi; + + if ! { cat "$configFile" | grep "\\[$deviceName\\]"; } > /dev/null 2>&1 + then + { + if [ -f "$configFile" ] && [ -n "$(cat "$configFile")" ] + then + echo ""; + fi; + + echo "[Libinput][$id1][$id2][$deviceName]"; + echo "$statements"; + } | sudo tee "$configFile" > /dev/null; + fi; +} diff --git a/scripts/Unix/Devices/Surface Book 2/install.sh b/scripts/Unix/Devices/Surface Book 2/install.sh new file mode 100644 index 00000000..0064f68d --- /dev/null +++ b/scripts/Unix/Devices/Surface Book 2/install.sh @@ -0,0 +1,5 @@ +#!/bin/bash +pushd "${BASH_SOURCE%/*}" > /dev/null; +. "../../Config/KDE/input.sh"; +addInputConfig "1118" "2338" "Microsoft Surface Keyboard Touchpad" "NaturalScroll=true"; +popd > /dev/null;