trying to disable touchpad in ~/.profile

Tom H tomh0665 at gmail.com
Thu Sep 28 13:17:30 UTC 2017


On Thu, Sep 28, 2017 at 4:18 AM, Adam Funk <a24061 at ducksburg.com> wrote:
> On 2017-09-25, Tom H wrote:
>> On Mon, Sep 25, 2017 at 7:39 AM, Adam Funk <a24061 at ducksburg.com> wrote:
>>>
>>> I'm running a current Ubuntu-MATE system. This command
>>>
>>> xinput --set-prop 13 'Device Enabled' 0
>>>
>>> works from the terminal to disable the touchpad, but it doesn't do
>>> anything when I put it in ~/.profile, which I expected to be run while
>>> logging in. Where do I need to put that command for that to happen?
>>
>> Use "$HOME/.xsessionrc" (not ".xsession" or ".Xsession").
>
> It's not quite working.  I added some debugging lines so my
> .xsessionrc currently looks like this:
>
> # AF 2017-09-25: disable touchpad
> xinput --set-prop 13 'Device Enabled' 0
>
> TIMESTAMP=`date +%Y%m%d-%H%M`
> touch "${HOME}/Desktop/${TIMESTAMP}.xsessionrc.txt"
>
> and it created the empty file on my desktop when I logged in, but the
> touchpad was still on. Maybe the xinput command is getting executed
> too early in the GUI login process - should I try calling a script in
> the background that sleeps a few seconds then does the xinput command?

Sorry. Given that ".xsessionrc" runs just before the gnome-session is
started, it must be too early for your command :(

Two suggestions

1) An xdg autostart file (you may need to set more properties than below)

$ cat $HOME/.config/autostart/disable_touchpad.desktop
[Desktop Entry]
Name=Disable touchpad
Comment=Disable touchpad
Exec=xinput --set-prop 13 'Device Enabled' 0

2) A dconf edit

Launch "dconf-editor" (if it's not installed, the package has the same
as the executable), search for touchpad, and disable it.




More information about the ubuntu-users mailing list