irongit
hygoland/scripts/TouchPad.sh
32 lines984 BBourne Again Shell (bash)
1#!/bin/bash
2# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
3# For disabling touchpad.
4# Edit the Touchpad_Device on ~/.config/hypr/UserConfigs/Laptops.conf according to your system
5# use hyprctl devices to get your system touchpad device name
6# source https://github.com/hyprwm/Hyprland/discussions/4283?sort=new#discussioncomment-8648109
7
8notif="$HOME/.config/swaync/images/ja.png"
9
10export STATUS_FILE="$XDG_RUNTIME_DIR/touchpad.status"
11
12enable_touchpad() {
13 printf "true" >"$STATUS_FILE"
14 notify-send -u low -i $notif " Enabling" " touchpad"
15 hyprctl keyword '$TOUCHPAD_ENABLED' "true" -r
16}
17
18disable_touchpad() {
19 printf "false" >"$STATUS_FILE"
20 notify-send -u low -i $notif " Disabling" " touchpad"
21 hyprctl keyword '$TOUCHPAD_ENABLED' "false" -r
22}
23
24if ! [ -f "$STATUS_FILE" ]; then
25 enable_touchpad
26else
27 if [ $(cat "$STATUS_FILE") = "true" ]; then
28 disable_touchpad
29 elif [ $(cat "$STATUS_FILE") = "false" ]; then
30 enable_touchpad
31 fi
32fi