prasanthrangan / hyprdots

// Aesthetic, dynamic and minimal dots for Arch hyprland
GNU General Public License v3.0
6.46k stars 765 forks source link

[Feature Request]: Add tap-to-click on sddm for laptop users #1081

Open sandeng1440 opened 5 months ago

sandeng1440 commented 5 months ago

Feature Request

Description

Add tap-to-click on sddm for laptop users.

Use Case

Laptop touchpads

Proposed Solution

Add this file: /etc/X11/xorg.conf.d/20-touchpad.conf

With the following contents:

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

        Option "Tapping" "on"
        Option "NaturalScrolling" "on"
        Option "MiddleEmulation" "on"
        Option "DisableWhileTyping" "on"
EndSection

Alternatives

N/A

Additional Information

I'm a laptop user and I always have to add tap-to-click whenever I reinstall Hyprdots. It's a feature that should be on by default but sddm is yet to enable it by default so this would be nice for new users.

nicolkrit999 commented 5 months ago

Mine already does it, but I don't recall doing anything. If some of you know where could I check and write you what my config did or is I am happy to try and send you. I have a dell precision 5570

sandeng1440 commented 5 months ago

@nicolkrit999 Check if you have /etc/X11/xorg.conf.d/20-touchpad.conf

nicolkrit999 commented 5 months ago

It doesn't seem to be there

drwxr-xr-x - root 25 Oct 2023 . drwxr-xr-x - root 25 Oct 2023 .. .rw-r--r-- 404 root 25 Oct 2023 00-keyboard.conf.

This is the content of 00-keyboard.conf

written by systemd-localed(8), read by systemd-localed and Xorg. It's probably wise not to edit this file manually. Use localectl(1) to instruct systemd-localed to update it. Section "InputClass" Identifier "system-keyboard" MatchIsKeyboard "on" Option "XkbLayout" "us" Option "XkbModel" "pc105+inet" Option "XkbOptions" "terminate:ctrl_alt_bksp" EndSection

This is my input section under ~/.config/hypr/hyprland.conf

`input { kb_layout = us kb_variant = alt-intl follow_mouse = 1

touchpad {
    natural_scroll = no
}

sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
force_no_accel = 1

}

device:epic mouse V1 {

#sensitivity = -0.5

}

gestures { workspace_swipe = true workspace_swipe_fingers = 3 }`

sandeng1440 commented 5 months ago

@nicolkrit999 I'm not talking about tap-to-click on Hyprland. That is already on by default. I'm talking about sddm. Could you double check to see if you it's on? I appreciate your feedback.

nicolkrit999 commented 5 months ago

@sandeng1440 I apologize my english is not the best. I didn't had that functionality but I easily solved by installing "libinput" with yay version "1.25.0"

and adding to the directory you said before /etc/X11/xorg.conf.d/20-touchpad.conf

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

    Option "Tapping" "on"
    Option "NaturalScrolling" "on"
    Option "MiddleEmulation" "on"
    Option "DisableWhileTyping" "on"

EndSection`

I tried multiple logout and reboot and I confirm that it now work. If you more expert people are able to add this feature during the installer script it would be a good idea, even better the possibility to ask the user if this feature is desired or not

sandeng1440 commented 5 months ago

@nicolkrit999 Yes, that's what I meant. Thanks for confirming. That's what I'm asking to be done. I'm scared of bash so, I didn't want to dig into the scripts to try and make it a default behaviour for sddm.

nicolkrit999 commented 5 months ago

@sandeng1440 I never actually modified an already existing script but i did some scripts for myself.

In my opinion you take lot less time to just hit "enter" instead of taking the touchpad going over the login and tapping

Adding this in the right place (which should be after installing libinput and having that directory) should be enough

!/bin/bash

if [ ! -d /etc/X11/xorg.conf.d/ ]; then mkdir -p /etc/X11/xorg.conf.d/ fi

cat < /etc/X11/xorg.conf.d/20-touchpad.conf Section "InputClass" Identifier "libinput touchpad catchall" MatchIsTouchpad "on" MatchDevicePath "/dev/input/event*" Driver "libinput" Option "Tapping" "on" Option "NaturalScrolling" "on" Option "MiddleEmulation" "on" Option "DisableWhileTyping" "on" EndSection EOF

sandeng1440 commented 5 months ago

@nicolkrit999 Is it possible to add it to Hyprdots? That would be the best outcome of this issue.

nicolkrit999 commented 5 months ago

@sandeng1440 yes it's possible but I prefer to wait for someone else to ask for a merge with the update script. I am sure someone will read this thread and implement it

kRHYME7 commented 5 months ago

Okay,

I don't use sddm, but I'll try to configure this.

So the goal is adding the file right?
is libinput a dependency for this? or can we still add this without libinput?(What is the best way? )

sandeng1440 commented 5 months ago

@kRHYME7 Yes libinput is a dependency. And it's just that one file. Thanks for the help.

kRHYME7 commented 5 months ago

Found out that libinput should already be present upon hyprland installation and wlroots

Required By : hyprland-git libinput-gestures qt5-base qt6-base touchegg-git waybar-git weston wlroots wlroots0.16 xf86-input-libinput

Before I add a MR, Here's the snippet of the

# touchpad; tap-to-click feature https://github.com/prasanthrangan/hyprdots/issues/1081
    if libinput list-devices | grep -iq "touchpad" ; then

        xconf_dir="/etc/X11/xorg.conf.d"
        [[ ! -d ${xconf_dir} ]] && sudo mkdir -p "${xconf_dir}"

sudo tee "${xconf_dir}/20-touchpad.conf" << EOF > /dev/null
Section "InputClass"
Identifier "libinput touchpad catchall"
MatchIsTouchpad "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
Option "Tapping" "on"
Option "NaturalScrolling" "on"
Option "MiddleEmulation" "on"
Option "DisableWhileTyping" "on"
EndSection
EOF

    fi
sandeng1440 commented 5 months ago

@kRHYME7 It looks good. Thank you very much.