aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/scripts/TouchPad.sh
blob: 1fcb3249e54068646ec2a82254f4e0c05877d8cc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash

HYPRLAND_DEVICE="asue1209:00-04f3:319f-touchpad"
notif="$HOME/.config/swaync/images/bell.png"

XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR:-/run/user/$(id -u)}
STATUS_FILE="$XDG_RUNTIME_DIR/touchpad.status"

toggle_touchpad() {
  if [ ! -f "$STATUS_FILE" ] || [ "$(cat "$STATUS_FILE")" = "false" ]; then
    echo "true" > "$STATUS_FILE"
    action="enabled"
  else
    echo "false" > "$STATUS_FILE"
    action="disabled"
  fi

  notify-send -u low -i "$notif" "Touchpad $action"
  hyprctl keyword "device:$HYPRLAND_DEVICE:enabled" "$(cat "$STATUS_FILE")"
}

toggle_touchpad
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage