Skip to content

Instantly share code, notes, and snippets.

@ramingar
Created December 29, 2024 13:03
Show Gist options
  • Save ramingar/8045a719ddd816d6aef737fa34672fb8 to your computer and use it in GitHub Desktop.
Save ramingar/8045a719ddd816d6aef737fa34672fb8 to your computer and use it in GitHub Desktop.
Assign some device as a touchscreen using gsettings on Ubuntu 24.04 Gnome Wayland #ubuntu #24.04 #gsettings #gnome #wayland
  • gsetting assigning a device as a touchscreen
gsettings set org.gnome.desktop.peripherals.touchscreen:/org/gnome/desktop/peripherals/touchscreens/:ID/ output "[':VENDOR', ':PRODUCT', ':SERIAL']"

# example:
gsettings set org.gnome.desktop.peripherals.touchscreen:/org/gnome/desktop/peripherals/touchscreens/0457:0819/ output "['CMN', '0x1626', '0x00000000']"
  • how to get :ID
$ lsusb

# output:
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 0457:0819 Silicon Integrated Systems Corp. SiS HID Touch Controller  # <--- 0457:0819
Bus 001 Device 003: ID 0c45:6366 Microdia Webcam Vitade AF
Bus 001 Device 004: ID 0457:0819 Silicon Integrated Systems Corp. SiS HID Touch Controller
Bus 001 Device 005: ID 145f:01ad Trust Trust GXT mouse
Bus 001 Device 006: ID 0bda:c821 Realtek Semiconductor Corp. Bluetooth Radio 
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
  • how to know the "[':VENDOR', ':PRODUCT', ':SERIAL']"
$ cat ~/.config/monitors.xml

# output:
<monitors version="2">
  <configuration>
    <layoutmode>logical</layoutmode>
    <logicalmonitor>
      <x>0</x>
      <y>0</y>
      <scale>1</scale>
      <monitor>
        <monitorspec>
          <connector>eDP-1</connector>
          <vendor>CMN</vendor>          <---------- :VENDOR
          <product>0x1626</product>     <---------- :PRODUCT
          <serial>0x00000000</serial>   <---------- :SERIAL
        </monitorspec>
        <mode>
          <width>1920</width>
          <height>1200</height>
          <rate>60.003</rate>
        </mode>
      </monitor>
    </logicalmonitor>
    .......................
  </configuration>
</monitors>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment