mylinuxforwork / dotfiles

The ML4W Dotfiles for Hyprland - An advanced and full-featured configuration for the dynamic tiling window manager Hyprland including an easy to use installation script for Arch based Linux distributions.
GNU General Public License v3.0
498 stars 51 forks source link

[FEATURE] Touchpad/touchscreen scrolling on rofi. #47

Open mylinuxforwork opened 1 month ago

mylinuxforwork commented 1 month ago

Is your feature request related to a problem? Please describe. Currently it's not possible to scroll on a laptop touchpad or touchscreen through a rofi menu. Only the scrollbar or the arrow keys are working on a laptop. On a desktop PC, I can use the scrollwheel.

mylinuxforwork commented 1 month ago

Original from https://gitlab.com/makoridylan

Yes, it's possible to enable touchpad or touchscreen scrolling on Rofi.Rofi itself doesn't directly handle input devices, but you can enable scrolling by configuring it to work with the windowing system and input device settings. Here is how i can go about setting it up:

Step 1: Ensure Your Touchpad/Touchscreen is Working

First, make sure your touchpad or touchscreen is working properly and recognized by your system. You can use tools like xinput to list input devices and verify their functionality.

Step 2: Configure Rofi for Scrolling

Rofi supports mouse wheel scrolling out of the box, but to make sure it's enabled, you might need to tweak its configuration. You can create or edit the Rofi configuration file.

Creating/Editing Rofi Configuration File

  1. Locate or create the configuration file:

    • The Rofi configuration file can be found or created at ~/.config/rofi/config.rasi.
  2. Add scrolling settings:

    • Add the following lines to enable mouse scrolling:

      configuration {
       scroll-method: 1;  // This enables the scrolling for the mouse wheel
      }

Step 3: Configure Touchpad/Touchscreen Settings

For touchpad or touchscreen scrolling, you need to ensure that your system’s input device settings are correctly configured.

For Touchpads:

  1. Check if libinput is installed:

    • Most modern Linux distributions use libinput for handling input devices. Ensure it’s installed.
  2. Configure libinput:

    • Create or edit the libinput configuration file typically found at /etc/X11/xorg.conf.d/40-libinput.conf. Add or edit the section for touchpads:

      Section "InputClass"
       Identifier "libinput touchpad catchall"
       MatchIsTouchpad "on"
       MatchDevicePath "/dev/input/event*"
       Driver "libinput"
       Option "Tapping" "on"
       Option "NaturalScrolling" "true"
      EndSection

For Touchscreens:

  1. Use xinput for configuration:

    • Run xinput to list input devices and find your touchscreen.

      xinput list
    • Enable natural scrolling for the touchscreen (replace id with the ID of your touchscreen device):

      xinput set-prop <id> "libinput Natural Scrolling Enabled" 1

    Test and Adjust After making these changes, restart your X session or reboot your system to apply the new settings. Open Rofi and test the scrolling functionality with your touchpad or touchscreen.

Hope this helps :smile: