I tend to use an external monitor with my laptop on a stand, taking the laptop with me to classes and such. Because of this, it’d be really cool to have the touchpad and keyboard on the laptop only control that one screen and do it separately from my normal inputs with an external mouse and keyboard. Obviously, this would require some configuration and would need to be opt-in, but I think it’d be useful for use with your “discord monitor”, or one filling a similar role. What do y’all think about this idea and how would you like it to be/think it would have to be implemented?

  • Admiral Patrick
    link
    fedilink
    English
    223 days ago

    You can use xinput to restrict input devices to certain displays. I’ve got a touchscreen that, by default, think the touch area is the combined desktop span instead of just the external one. So I just lock the touch input devices to that.

    Use xinput list and find the device IDs (id=XXX) for the mouse/keyboard you want to map to your secondary display.

    Then use xrandr --query to list the monitor names (eDP-1, DP-1, HDMI-1, etc)

    Finally, map the devices to that output as such: xinput map-to-output {ID} {DISPLAY}

    e.g. if my keyboard input id is 9, and my mouse id is 10, and I want them to go to my external display witch is DP-1:

    xinput map-to-output 9 DP-1 and xinput map-to-output 10 DP-1

    The devices IDs are dynamic, and these are not persistent, so you’d probably want to script it to find them and automatically do the mapping.