jbensmann / mouseless

A replacement for the mouse in Linux
MIT License
184 stars 17 forks source link

Fail to install mouseless #5

Closed Bastien-mva closed 2 years ago

Bastien-mva commented 2 years ago

Hello,

Thanks for the repo. I was before using xmouseless, but with the upgrade of ubuntu to the 22.04 version, I had to rebuilt xmouseless but it did not worked anymore, so I am trying to make mouseless work.

I am quite a novice, and I am trying to figure out how to make mouseless working. I have found my keyboard in "/dev/input/by-path/platform-i8042-serio-0-event-kbd so that I replace this on the third line of the config.yaml file given in the configuration (only the third line has changed) :

devices:
# change this to a keyboard device
- "/dev/input/by-path/platform-i8042-serio-0-event-kbd"
# this is executed when mouseless starts
# startCommand: ""
# the default speed for mouse movement
baseMouseSpeed: 750.0
# the default speed for scrolling
baseScrollSpeed: 20.0
layers:
# the first layer is active at start
- name: initial
  bindings:
    # when tab is held and another key pressed, activate mouse layer
    tab: tap-hold-next tab ; toggle-layer mouse ; 500
    # when a is held for 300ms, activate mouse layer
    a: tap-hold a ; toggle-layer mouse ; 300
    # right alt key toggles arrows layer
    rightalt: toggle-layer arrows
    # switch escape with capslock
    esc: capslock
    capslock: esc
# a layer for mouse movement
- name: mouse
  # when true, keys that are not mapped keep their original meaning
  passThrough: true
  bindings:
    # quit mouse layer
    q: layer initial
    # keep the mouse layer active
    space: layer mouse
    r: reload-config
    l: move  1  0
    j: move -1  0
    k: move  0  1
    i: move  0 -1
    p: scroll up
    n: scroll down
    leftalt: speed 4.0
    e: speed 0.3
    capslock: speed 0.1
    f: button left
    d: button middle
    s: button right
    # move to the top left corner
    k0: "exec xdotool mousemove 0 0"
# another layer for arrows and some other keys
- name: arrows
  passThrough: true
  bindings:
    e: up
    s: left
    d: down
    f: right
    q: esc
    w: backspace
    r: delete
    v: enter

It is located in ~/.config/mouseless.

Since sudo mouseless --config ~/.config/mouseless/config.yaml is returning mouseless: command not found, I am guessing I have to install mouseless before, so that I ran ./mouseless when I am on the dist directory downloaded previsouly, but it is giving me the following error:

ERRO[0000] Failed to init the virtual mouse: could not create relative axis input device: could not open device file Can anyone help me ?

Thanks for your help.

Bastien-mva commented 2 years ago

I think it does not find my keyboard since when I am replacing /dev/input/by-path/platform-i8042-serio-0-event-kbd with nothing, i am getting the same issue.

I tried to build it from source but I am getting the following error:

image

without any mouseless files popping

jbensmann commented 2 years ago

Hi, the problem is that mouseless cannot create the virtual mouse, probably due to missing permission, have you also run the second command with sudo like this: sudo ./mouseless ... ?

You can install the program by copying it to a location where Linux searches for binaries, e.g. ~/.local/bin or /usr/local/bin, then you can call it directly with sudo mouseless ....

Bastien-mva commented 2 years ago

I tried but it gives me a blank line for 5 minutes:

bastien@bastien:~/.local/bin$ ls
mouseless  pkginfo  twine  wheel
bastien@bastien:~/.local/bin$ sudo ./mouseless --config ~/.config/mouseless/config.yaml

and it does not work and j is actually writing when I press it, so that it does not work.

I tried to put it in ~/.local/bin and then running

mouseless  pkginfo  twine  wheel
bastien@bastien:~/.local/bin$ sudo mouseless --config ~/.config/mouseless/config.yaml
sudo: mouseless: command not found
bastien@bastien:~/.local/bin$ 

, giving me an error.

I also tried on /usr/local/bin:

bastien@bastien:/usr/local/bin$ ls
mouseless  nsys  nsys-ui  nvtop  pyright  pyright-langserver  xmouseless
bastien@bastien:/usr/local/bin$ sudo mouseless --config ~/.config/mouseless/config.yaml

giving me a blank line and j is actually writing when I press it.

jbensmann commented 2 years ago

mouseless works a little different than xmouseless, it keeps running all the time and the mouse bindings are activated only when one switches to the mouse layer. With the default config, this is e.g. achieved by holding down the tab key, then the mouse bindings are activated until tab is released again. Or one can press tab+space to switch to the mouse layer, and go back with q again.

You can also use the --debug flag to see if mouseless is doing something.

Bastien-mva commented 2 years ago

OK I see, Thanks for the explanation, it works very fine now.

Thanks )