# xinput not surviving reboots



## Whattteva (Oct 6, 2022)

I'm sure this is so trivial, but I can't figure it out for the life of me. I've googled and searched the forums and the one topic that seemed close to my issue never really got it resolved.

I have a Synaptics touchpad and it mostly works great. I just need to change a couple of defaults that are kinda' annoying me, which are tap to click and natural scrolling. I've successfully done these by executing the following commands.

```
xinput --set-int-prop 10 "libinput Tapping Enabled" 8 1
xinput --set-int-prop 10 "libinput Natural Scrolling Enabled" 8 1
```

These 2 commands do exactly what I want, with 1 caveat; they don't survive reboots. I've tried adding the following to /etc/xorg.conf and /usr/local/etc/X11/xorg.conf.d/40-libinput.conf (what's with the systemd naming convention?) and neither of them do the trick. I currently do NOT run moused, but I did try enabling it anyway to see if that'd do the trick to no avail. Also `hw.psm.synaptics_support` is `1`.

```
Section "InputClass"
        Identifier "libinput touchpad catchall"
        MatchIsTouchpad "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"

        Option "Tapping Enabled"                    "1"
        Option "Tapping Enabled Default"            "1"
        Option "Natural Scrolling Enabled"          "1"
        Option "Natural Scrolling Enabled Default"  "1"
EndSection
```

Currently I have a work-around in a shell script that I just run after X starts, but I'd like to do this in a less hacky way if possible. Any help is appreciated!


----------



## sidetone (Oct 6, 2022)

Add those commands to .xsession or .xinitrc to have them when your desktop starts. If you needed them for the display manager, you could also add those commands to XDM's configuration files. I've run a few commands, especially xrandr to set my monitor display through both of those before. Not all commands are suitable from running from xdm, however.

If they were for terminal, you would use crontab with the @reboot setting.


----------



## Whattteva (Oct 6, 2022)

Thanks, I forgot about .xinitrc and that works beautifully. But is there a way to do this through the proper config file? I'm thinking maybe I'm just not naming the config file correctly or maybe some other syntax I forgot?


----------



## Andriy (Oct 7, 2022)

Whattteva I vaguely recall some problem with a config like that. It could be that the actual xorg driver claiming the touchpad is synaptics rather than libinput.
You can check Xorg.0.log file.


----------



## eternal_noob (Oct 8, 2022)

Whattteva said:


> But is there a way to do this through the proper config file?


.xinitrc IS a proper config file.


----------



## cy@ (Oct 8, 2022)

eternal_noob said:


> .xinitrc IS a proper config file.


It's .xinitrc if you use startx(1) or .xsession if you log in using xdm. It's .dtprofile if you use CDE's dtlogin, though you can save your session by clicking on CDE's Style Manager instead.


----------



## Whattteva (Oct 8, 2022)

Andriy said:


> Whattteva I vaguely recall some problem with a config like that. It could be that the actual xorg driver claiming the touchpad is synaptics rather than libinput.
> You can check Xorg.0.log file.




```
[   299.590] (II) Using input driver 'libinput' for 'SynPS/2 Synaptics TouchPad'
```
This is what I see on the log file. I'm pretty sure it's also using libinput because xinput with those libinput options work.


----------



## Whattteva (Oct 8, 2022)

eternal_noob said:


> .xinitrc IS a proper config file.


Well, I noticed that there seems to be actual config syntax like the ones I put in my OP, I can't help but think that manually executing an active startup script feels like a work-around instead of the program reading passive configurations from a dedicated config file like how most other startup processes do.


----------



## shkhln (Oct 8, 2022)

Is "Natural Scrolling Enabled Default" actually a legal option name? 



Spoiler



Type `man 4 libinput` to find out.


----------



## Whattteva (Oct 8, 2022)

shkhln said:


> Is "Natural Scrolling Enabled Default" actually a legal option name?
> 
> 
> 
> ...


It is an actual legal option name and I know that because I have already tried it in the terminal before I made that config file. Though I'm not actually sure if it actually does anything. The one that matters is really the one without the Default in its name.


----------



## shkhln (Oct 8, 2022)

Well, your choice.


----------



## Whattteva (Oct 10, 2022)

shkhln said:


> Well, your choice.


It's also listed by `xinput --list-props 10` 10 being the touchpad id. So I didn't come up with the name. It's one of the options listed by xinput.


----------



## Andriy (Oct 11, 2022)

Whattteva I've just looked at my config for a laptop that I used to use.
And here's my touchpad section from it:

```
Section "InputClass"
        Identifier      "Motile touchpad"
        MatchDriver     "libinput"
        MatchIsTouchpad "on"
        MatchProduct    "UNIW0001"

        Option          "Tapping" "on"
        Option          "TappingDrag" "on"
        Option          "TappingDragLock" "on"
        Option          "ClickMethod" "clickfinger"
        Option          "ScrollMethod" "twofinger"
        Option          "NaturalScrolling" "off"
        Option          "DisableWhileTyping" "on"
EndSection
```
Looks like X option names are slightly different from what you got from xinput output.


----------



## Whattteva (Oct 11, 2022)

Andriy said:


> Whattteva I've just looked at my config for a laptop that I used to use.
> And here's my touchpad section from it:
> 
> ```
> ...


You're absolutely right, this worked! Kinda' weird that xinput's output doesn't match what it actually takes in. But this works and I can now remove the redundant commands from my .xinitrc


----------

