The Trackp Deployment Script automates the installation, configuration, and management of a custom TrackPoint acceleration setting for Linux systems. The script:
- Ensures Root Access: Verifies that the script is run as root.
- Installs the Trackp Script: Copies itself to
/usr/local/bin/trackp
so it can be run as a command. - Creates a Systemd Service Unit: Sets up a one-shot service to run the TrackPoint acceleration adjustment using
xinput
.- The unit is configured to run after the graphical target (ensuring that X11 is available).
- It explicitly sets the
DISPLAY
andXAUTHORITY
environment variables.
- Numeric Value Conversion: Accepts an integer value from 1 to 10 and converts it to a decimal between 0.1 and 1.0 for the
libinput Accel Speed
property. - Bash Autocompletion: Installs a Bash completion file to /etc/bash_completion.d/trackp so that autocompletion is available by default.
- Command-Line Options: Provides built-in options:
-help
: Displays usage instructions.-uninstall
: Removes the installed script, its systemd service, and the Bash autocompletion file.
-
Download the Script:
Save the deployment script (e.g., as/home/$USER/Downloads/Trackp.sh
). -
Make It Executable:
sudo chmod +x /home/$USER/Downloads/Trackp.sh
-
Run the Script as Root:
From its original location, install the script by running:sudo /home/$USER/Downloads/Trackp.sh
This action will:
- Copy the script to
/usr/local/bin/trackp
- Create and enable a systemd service that applies a default acceleration value of
0.5
- Install a Bash autocompletion file in /etc/bash_completion.d/trackp
- Copy the script to
-
Verify Installation:
Open a new terminal (or source the Bash completion file withsource /etc/bash_completion.d/trackp
) and type:trackp [TAB]
to see available completions. You can then update the TrackPoint acceleration by running:
sudo trackp <value>
where
<value>
is an integer between 1 and 10 (e.g.,sudo trackp 6
sets the acceleration to0.6
).
-
Update Acceleration Value:
sudo trackp <acceleration_value>
Example:
sudo trackp 6
This converts the input to
0.6
and updates the systemd service accordingly. -
Help:
sudo trackp -help
Displays the usage information.
-
Uninstall:
sudo trackp -uninstall
Uninstalls the Trackp script, stops and disables the systemd service, and removes the Bash autocompletion file.
-
Systemd Service:
The service unit is defined to run after the graphical session is up. It sets the following environment variables:DISPLAY=:0
XAUTHORITY=/home/vex/.Xauthority
It then runs the command:
xinput set-prop "pointer:TPPS/2 IBM TrackPoint" "libinput Accel Speed" <value>
where
<value>
is a floating‑point number (0.1–1.0). -
Numeric Conversion:
The script accepts an integer (1–10) from the user, converts it by dividing by 10 (using a forced locale so that the decimal separator is a dot), and updates the ExecStart command in the service unit. -
Bash Autocompletion:
A completion file is installed in /etc/bash_completion.d/trackp, which provides suggestions for options (-help
,-uninstall
) and numbers (1–10) when using thetrackp
command.
To remove all installed components, run:
sudo trackp -uninstall
This command will:
- Stop and disable the
trackp.service
- Remove the service file and its symlink
- Delete the installed script from
/usr/local/bin/trackp
- Remove the Bash autocompletion file from /etc/bash_completion.d/trackp
- Linux Mint (or compatible Linux distribution) with Cinnamon on X11.
- xinput: Ensure this utility is installed.
- Root Privileges: The script and its components require root access.
The script provides output to the console. For troubleshooting systemd-related issues, consult the logs using:
journalctl -xeu trackp.service
This project is licensed under the MIT License.
Bruno Bellizzi Grande
Last updated: March 13, 2025