1

feat: helper script to toggle touchpad input

This commit is contained in:
Himadri Bhattacharjee
2026-04-13 09:02:20 +05:30
parent d559e797b8
commit 97c762ba5b

View File

@@ -20,6 +20,20 @@
esac
${pkgs.kdePackages.libkscreen}/bin/kscreen-doctor output.eDP-1.rotation.$direction
'')
(pkgs.writeShellScriptBin "toggle-touchpad" ''
touchpad=$(awk '$0 ~ /touchpad/I { split(FILENAME, path, "/") } END { print path[5] }' /sys/class/input/event*/device/name)
device=/org/kde/KWin/InputDevice/$touchpad
get_property=org.freedesktop.DBus.Properties.Get
interface=org.kde.KWin.InputDevice
if test $(qdbus org.kde.KWin $device $get_property $interface enabled) = true; then
toggle=false
else
toggle=true
fi
qdbus org.kde.KWin $device $interface.enabled $toggle
'')
];
home.file.".config/kglobalshortcutsrc".source = ./sources/kglobalshortcutsrc;
home.file.".config/kwinrc".source = ./sources/kwinrc;