Talk:Logitech MX Master

From ArchWiki
Jump to navigation Jump to search

Getting the name of the device for logiops config

Probably, it's needed to be explained more accurately how to receive a device's name for logiops configuration. In my case when I run logid -v, I did not received any name in [INFO] strings of the output. But after I removed all paired devices from the unifying receiver (there were several mices and keyboards) via solaar, and then running logid -v again, it started to output detected devices normally:
[INFO] M720 Triathlon detected: device 4 on /dev/hidraw0
Also, I think you can get this name from solaar safely. But I am not sure.
Ashark (talk) 23:01, 17 March 2020 (UTC)


Wayland Horizontal Wheel

I was able to macro the horizontal mousewheel in Wayland and Wine(which wasn't working with xbindkeys) by repurposing this bash script: https://github.com/mathportillo/wayland-mouse-mapper

#!/usr/bin/bash

event_type=EV_KEY
action_type=POINTER_AXIS 
scrolled="horiz"

readarray -t devices <<<$(libinput list-devices | grep pointer -B3 | grep -o '/dev/input/event[1-9]*') 

# COMMANDS MAP
HWHEEL_UP=(KEY_VOLUMEUP)
HWHEEL_DOWN=(KEY_VOLUMEDOWN)

function pressKey(){
    device=$1; key=$2
    evemu-event /dev/input/${device} --sync --type ${event_type} --code ${key} --value 1;
    evemu-event /dev/input/${device} --sync --type ${event_type} --code ${key} --value 0;
}

function pressCommand(){
    device=$1; wheel=$2; movement=$3
    if [ ${wheel} = ${scrolled} ]; then
        if [ ${movement} -gt 0 ]; then
            pressKey ${device} ${HWHEEL_UP}
        else
            pressKey ${device} ${HWHEEL_DOWN}
        fi
    fi
}

function parseEventLine(){
    device=$1
    action=$2
    wheel=$6
    movement=${7%%.*}
    # compute only if right action
    if [ ${action} = ${action_type} ] && [ ${movement} -ne 0 ]; then
        pressCommand ${device} ${wheel} ${movement}
    fi
}

function mapDevice(){
    device=$1
    while read line; do
        parseEventLine ${line}
    done < <(stdbuf -oL libinput debug-events --device ${device} & )
}

for device in ${devices[@]}; do
    ( mapDevice ${device} ) &
done

wait

Figured it might help some people. It's kind of a hacked together solution, catered to only my specific needs(it's technically possible to macro any button like this but I only needed the volume), so I'm not sure it's of the quality to post it on the main page. But figured it could still help someone. Unsure if it'll work on X or not. —This unsigned comment is by Gdishun (talk) 05:12, 8 August 2020‎ (UTC). Please sign your posts with ~~~~!