From b99ddaa27eea71c6b5a8afe69e9689fb64a60585 Mon Sep 17 00:00:00 2001 From: Luna Komorebi Date: Sun, 6 Jun 2021 19:17:59 +0200 Subject: [PATCH] post-laptop-install and touchpad.sh --- .local/scripts/touchpad.sh | 12 ++++++++++++ post-laptop-install.sh | 9 +++++++++ 2 files changed, 21 insertions(+) create mode 100755 .local/scripts/touchpad.sh create mode 100644 post-laptop-install.sh diff --git a/.local/scripts/touchpad.sh b/.local/scripts/touchpad.sh new file mode 100755 index 0000000..f9b3e3a --- /dev/null +++ b/.local/scripts/touchpad.sh @@ -0,0 +1,12 @@ +#!/bin/bash +fileName=/tmp/touchpad +id=$(xinput | grep TouchPad |grep -Poh '(?<=id\=)[0-9]+') +if [[ ! -f $fileName ]]; then + echo "$id" > $fileName + xinput --disable $id + notify-send "Touchpad disabled" -t 1000 -u low +else + xinput --enable $(cat $fileName) + rm $fileName + notify-send "Touchpad enabled" -t 1000 -u low +fi diff --git a/post-laptop-install.sh b/post-laptop-install.sh new file mode 100644 index 0000000..1318c95 --- /dev/null +++ b/post-laptop-install.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +scripts_path_prefix="./.local/.scripts" +laptop_scripts=("touchpad.sh") +for i in ${laptop_scripts[@]}; do + path="$scripts_path_prefix/$i" + if [ -f $path ]; then + cp -iv $path $HOME/$path + fi +done