diff --git a/hosts/default/home/kde.nix b/hosts/default/home/kde.nix index ebd6fb0..2fa978f 100644 --- a/hosts/default/home/kde.nix +++ b/hosts/default/home/kde.nix @@ -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;