Add script for configuring Surface Book touchpad

This commit is contained in:
Manuel Thalmann 2024-03-27 09:24:04 +01:00
parent 7930880ac1
commit ab9141cbdf
2 changed files with 31 additions and 0 deletions

View file

@ -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;
}

View file

@ -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;