-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtouchpad-toggle.en
More file actions
123 lines (109 loc) · 5.74 KB
/
Copy pathtouchpad-toggle.en
File metadata and controls
123 lines (109 loc) · 5.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# ──────────────────────────────────────────────────────────────────────
#
# Your Laptop's Touchpad Toggle
#
# ──────────────────────────────────────────────────────────────────────
#
# Purpose Toggle touchpad enable/disable on GNOME/Wayland systems.
# Includes CLI management for status checks and installation.
# See help for overview and documentation for details.
#
# Author Copyright (c) 2026 RML Tec Dev
# Contributions and feedback are welcome via rmltecdev@pm.me
#
# License Licensed under the MIT License
#
# ──────────────────────────────────────────────────────────────────────
#
# Localization:
# [EN] English, generic (fallback)
# Ensure language files are in same directory as script.
#
# ──────────────────────────────────────────────────────────────────────
# man-page style help
read -r -d '' MSG_HELP_TEXT <<EOF
NAME
Your Laptop's Touchpad Toggle
DESCRIPTION
Enable/disable touchpad to prevent accidental pointer movement,
causing unintended highlighting and removal of text passages.
ENVIRONMENT
Linux with GNOME Desktop Environment and Wayland Display Server.
REQUIREMENTS
Audio player (ALSA, PipeWire, PulseAudio) auto-detected at runtime.
Touchpad enable and disable system sounds.
CONFIGURATION
Default key binding ${KEY_BINDING}
USAGE
${SCRIPT_NAME} [OPTION]
OPTIONS
(none/invalid) Show current status of touchpad and keyboard shortcut
--assign Assign permanent keyboard shortcut
--help Show this help
--reset Hard reset input drivers; elevated privileges
required
--toggle Toggle touchpad enable/disable
--unassign Remove permanent keyboard shortcut
--version Show version metadata
--watch Watch ${SCRIPT_NAME}; updated every ${WATCH_INTERVAL} seconds;
quit with Ctrl+C
AUTHOR
Copyright (c) 2026 RML Tec Dev
Contributions and feedback are welcome via rmltecdev@pm.me
DISCLAIMER
This script is provided “as is”; there is NO WARRANTY at all. Use at
your own risk.
Test thoroughly; your laptop's touchpad may stop responding
unexpectedly.
LICENSE
Licensed under the MIT License.
EOF
# Mathematically inflate padding to align with longest string
INFO_PAD="%-15s"
# Associative array to map keys to localized strings
MSG[assign_abort_msg]=" A keyboard shortcut has already been assigned to toggle touchpad\n enable/disable. Invoke script without option to see details."
MSG[assign_abort_title]="Assigning keyboard shortcut aborted."
MSG[assign_instructions]=" If the keyboard shortcut does not disable and re-enable the touchpad\n on first attempt, the keyboard shortcut might have been already assigned\n to another application. Please choose a different key combination."
MSG[assign_preparing]="Assigning keyboard shortcut..."
MSG[assign_success]="Keyboard shortcut successfully assigned to"
MSG[check_assign]="Assigned"
MSG[check_invoke_hint]="Invoke ${SCRIPT_NAME} with option --assign to assign a permanent keyboard shortcut."
MSG[check_not_detected]="Not detected"
MSG[check_status_label]="Shortcut status"
MSG[error_no_audio]="No audio system detected."
MSG[error_tool]="Required system component is not installed:"
MSG[help_close]="Help closed."
MSG[help_open]="Opening help..."
MSG[help_text]="$MSG_HELP_TEXT"
MSG[info_build_date]="Build date"
MSG[info_desc_assign]="Assign permanent keyboard shortcut; default:"
MSG[info_desc_help]="Show description, usage and license"
MSG[info_desc_remove]="Remove permanent keyboard shortcut"
MSG[info_desc_reset]="Hard reset input sub-system; elevated privileges required"
MSG[info_desc_toggle]="Toggle touchpad enable/disable"
MSG[info_desc_version]="Show version information"
MSG[info_disabled]="Disabled"
MSG[info_enabled]="Enabled"
MSG[info_opt_watch]="Watch ${SCRIPT_NAME}; updated every ${WATCH_INTERVAL} seconds, quit with Ctrl+C"
MSG[info_path]="Script path"
MSG[info_status_label]="Touchpad status"
MSG[info_invoke]="Invoke ${SCRIPT_NAME} with one of these options:"
MSG[info_version]="Version"
MSG[install_hint]="Install it, or the package providing it,\n with \033[1msudo apt-get install"
MSG[keyb_manager]="Keyboard Shortcut Manager"
MSG[rem_found]="Found shortcut to remove:"
MSG[rem_not_found]="No shortcut found."
MSG[rem_nothing]="Nothing to remove."
MSG[rem_preparing]="Removing keyboard shortcut..."
MSG[rem_success]="Shortcut successfully removed."
MSG[reset_aborted]="Reset operation aborted by ${USER^}."
MSG[reset_confirm_prompt]="Continue? [y/N]: "
MSG[reset_confirm_warning]="This operation will reset ALL input devices (keyboard, mouse, touchpad, etc.)"
MSG[reset_fail]="Resetting input subsystem failed."
MSG[reset_preparing]="Resetting input subsystem (Hard Reset)..."
MSG[reset_success]="Input subsystem successfully reset."
MSG[sudo_required]="Elevated privileges (sudo) are required for this operation."
MSG[warn_no_sound]="No system sounds detected."
MSG[warn_no_sound_hint]="Sound feedback unavailable; toggle functionality unaffected.\nYou may configure custom sound paths in the script variables."
MSG[watch_start]="Watching ${SCRIPT_PATH} with interval of ${WATCH_INTERVAL} seconds...\n"
MSG[watch_stop]="Watching ended.\n\n"