jbensmann / mouseless

A replacement for the mouse in Linux
MIT License
167 stars 16 forks source link

Share your config #25

Open brokenricefilms opened 1 year ago

brokenricefilms commented 1 year ago

vim, gnome user

# the keyboard devices it reads from, if no devices are specified, it reads from all
devices:
# - "/dev/input/by-id/SOME_KEYBOARD_REPLACE_ME-event-kbd"

# startCommand: "setxkbmap de"

baseMouseSpeed: 750.0
baseScrollSpeed: 20.0

mouseAccelerationTime: 200.0
mouseAccelerationCurve: 2.0

startMouseSpeed: 0.0

mouseDecelerationTime: 300.0
mouseDecelerationCurve: 3.0

layers:
  - name: initial
    bindings:
      a: tap-hold a ; toggle-layer mouse ; 300
      space: tap-hold space ; toggle-layer thuan_fly_keys ; 300

      # capslock kinda useless for me, so i map it to esc for vim
      capslock: esc

      # key `|\` at the bottom on msi laptop keyboard, why? they put the key in this position
      102nd: leftctrl

      #####################
      # External keyboard #
      #####################

      # key menu
      compose: leftctrl
      f1: mute
      f2: volumedown
      f3: volumeup
      # mic mute, `KEY_MICMUTE` ~ micmute doesn't work, debug show key press is `f20`
      f5: f20

  - name: mouse
    passThrough: true
    bindings:
      r: reload-config
      l: move  1  0
      h: move -1  0
      j: move  0  1
      k: move  0 -1
      p: scroll up
      semicolon: scroll down
      leftalt: speed 4.0
      space: speed 0.3
      f: button left
      d: button middle
      s: button right

  - name: thuan_fly_keys
    passThrough: true
    bindings:
      # function key kinda far, lazy to reach out
      k1: f1
      k2: f2
      k3: f3
      k4: f4
      k5: f5
      k6: f6
      k7: f7
      k8: f8
      k9: f9
      k0: f10
      minus: f11
      equal: f12

      ##################
      ## editing text ##
      ##################

      k: up
      h: left
      j: down
      l: right
      i: home
      o: end

      ###########
      ## Gnome ##
      ###########

      # switch to fav app on dash
      a: leftmeta+k1
      s: leftmeta+k2
      d: leftmeta+k3
      f: leftmeta+k4
      g: leftmeta+k5
      q: leftmeta+k6
      w: leftmeta+k7
      e: leftmeta+k8
      r: leftmeta+k9

      # resize windows
      c: rightalt+f8

      # pano clipboard extension
      v: leftmeta+leftshift+v

      # switch windows to monitor left
      comma: leftmeta+leftshift+left

      # switch windows to monitor right
      dot: leftmeta+leftshift+right

      # toggle maximize
      m: leftalt+f10

      # close window
      x: leftalt+f4

      # switch input
      semicolon: leftmeta+space

      #############
      ## browser ##
      #############

      # restore tab
      t: leftctrl+leftshift+t

      # next tab aka `ctrl + tab`
      p: leftctrl+pagedown

      # previous tab aka `ctrl + shift + tab`
      u: leftctrl+pageup

      # go back
      leftbrace: leftalt+left

      # go forward
      rightbrace: leftalt+right
benjaminbhollon commented 1 year ago

Here's mine: https://codeberg.org/benjaminhollon/.dotfiles/src/branch/main/.config/mouseless/config.yaml

Pretty complex, I know, but I'm using it to recreate a QMK config I have. :)

RusticCraftsman commented 1 year ago

serve yourself, my numpad config to replace the touchpad

# the keyboard devices it reads from, if no devices are specified, it reads from all
devices:

# this is executed when mouseless starts, e.g. useful for setting the keyboard layout
# startCommand: "setxkbmap de"

# the default speed for mouse movement and scrolling
baseMouseSpeed: 1500.0
baseScrollSpeed: 20.0

# the time it takes to accelerate to baseMouseSpeed (in ms), 0 to reach top speed immediately
mouseAccelerationTime: 100.0
# the shape of the acceleration curve, 1.0 is linear, higher values have more time at low speeds
mouseAccelerationCurve: 2.0
# speed of the mouse when it starts moving
startMouseSpeed: 0.0
# same for deceleration
mouseDecelerationTime: 10.0
mouseDecelerationCurve: 1.0

# the rest of the config defines the layers with their bindings
layers:
# the first layer is active at start
- name: initial
  bindings:
    numlock: multi numlock; layer numpad
    # the following keys make the system work because when numlock is on is when these keys can be detected, in which case we should be inside the numpad layer, we are correcting for initializing with numlock on
    kp1: layer numpad
    kp2: layer numpad
    kp3: layer numpad
    kp4: layer numpad
    kp5: layer numpad
    kp6: layer numpad
    kp7: layer numpad
    kp8: layer numpad
    kp9: layer numpad
# a layer for numpad
- name: numpad
  # when true, keys that are not mapped keep their original meaning
  passThrough: true
  bindings:
    numlock: multi numlock; layer initial
    # in my case the following keys are the ones that you would press if numlock is activated when started the app and pressed numlock respectively
    # these 4 are the only ones that get detected when pressing 4 5 6 and asterisk respectively, so these comes natural, so i press numlock to change the mode and make the system detect the numbers
    playpause: numlock 
    stopcd: numlock
    previoussong: numlock
    nextsong: numlock
    # the coordinates are as follows
    # move x y where x positive is right, x negative is left, y positive is down and y negative is up, and the numbers mean the speed

    # the order is from bottom left going right, when ending the row, go up a row to the extreme left value, and go right again, repeat
    kp0: kp0 #these keys calling themselves are only for organization porpouses
    kpdot: kpdot
    kpplus: speed 0.2 #
    kp1: move -1 1 #left down
    kp2: move 0 1 # down
    kp3: move 1 1 # right down
    kpminus: button right  # right click
    kp4: move -1 0  # left
    kp5: button middle # middle click
    kp6: move 1 0 # right 
    kpasterisk: scroll down 
    kp7: move -1 -1 # left up
    kp8: move 0 -1 # up
    kp9: move 1 -1 # right up 
    kpslash: scroll up

    #outside the numpad
    rightshift: button left # left click
    rightctrl: button left # left click
    leftalt: speed 2.0 # would like to also send leftalt as a multi but the speed stops working, dunno how to do it properly

    # Keys detected in my case when numlock is on
# ┌──────────┬────────┬──────────┬───────────────┐
# │  7||kp7  │ 8||kp8 │  9||kp9  │  /||kpslash   │
# ├──────────┼────────┼──────────┼───────────────┤
# │  4||kp4  │ 5||kp5 │  6||kp6  │ *||kpasterisk │
# ├──────────┼────────┼──────────┼───────────────┤
# │  1||kp1  │ 2||kp2 │  3||kp3  │  -||kpminus   │
# ├──────────┼────────┼──────────┼───────────────┤
# │ numlock ⏽│ 0||kp0 │ .||kpdot │   +||kpplus   │
# └──────────┴────────┴──────────┴───────────────┘

    # keys detected in my case when numlock is off
# ┌──────────────┬───────────┬─────────────────┬─────────────┐
# │              │           │                 │             │
# ├──────────────┼───────────┼─────────────────┼─────────────┤
# │ 4||playpause │ 5||stopcd │ 6||previoussong │ *||nextsong │
# ├──────────────┼───────────┼─────────────────┼─────────────┤
# │              │           │                 │             │
# ├──────────────┼───────────┼─────────────────┼─────────────┤
# │  numlock ⭘   │           │                 │             │
# └──────────────┴───────────┴─────────────────┴─────────────┘
brokenricefilms commented 1 year ago

update my config switching to pop shell

# the keyboard devices it reads from, if no devices are specified, it reads from all
devices:
# - "/dev/input/by-id/SOME_KEYBOARD_REPLACE_ME-event-kbd"

# startCommand: "setxkbmap de"

baseMouseSpeed: 750.0
baseScrollSpeed: 20.0

mouseAccelerationTime: 200.0
mouseAccelerationCurve: 2.0

startMouseSpeed: 0.0

mouseDecelerationTime: 300.0
mouseDecelerationCurve: 3.0

layers:
  - name: initial
    bindings:
      a: tap-hold a ; toggle-layer mouse ; 200
      space: tap-hold space ; toggle-layer thuan_fly_keys ; 200
      s: tap-hold s ; toggle-layer popshell ; 200

      # capslock kinda useless for me, so i map it to esc for vim
      capslock: esc

      # key `|\` at the bottom on msi laptop keyboard, why? they put the key in this position
      102nd: leftctrl

      #####################
      # External keyboard #
      #####################

      # key menu
      compose: leftctrl
      f1: mute
      f2: volumedown
      f3: volumeup
      # mic mute, `KEY_MICMUTE` ~ micmute doesn't work, debug show key press is `f20`
      f5: f20
      f8: leftctrl+leftshift+v

  - name: mouse
    passThrough: false
    bindings:
      a: layer initial
      i: layer mouse
      r: reload-config
      l: move  1  0
      h: move -1  0
      j: move  0  1
      k: move  0 -1
      p: scroll up
      semicolon: scroll down
      leftalt: speed 4.0
      space: speed 0.3
      f: button left
      d: button middle
      s: button right

  - name: thuan_fly_keys
    passThrough: true
    bindings:
      # function key kinda far, lazy to reach out
      k1: f1
      k2: f2
      k3: f3
      k4: f4
      k5: f5
      k6: f6
      k7: f7
      k8: f8
      k9: f9
      k0: f10
      minus: f11
      equal: f12

      # pop shell
      a: leftmeta+k1
      s: leftmeta+k2
      d: leftmeta+k3
      f: leftmeta+k4
      g: leftmeta+k5
      q: leftmeta+k6
      w: leftmeta+k7
      e: leftmeta+k8
      r: leftmeta+k9
      t: leftmeta+k0

      # editing text

      k: up
      h: left
      j: down
      l: right
      i: home
      o: end

      # Gnome

      # resize windows
      c: rightalt+f8

      # pano clipboard extension
      v: leftmeta+leftshift+v

      # switch windows to monitor left
      comma: leftmeta+leftshift+left

      # switch windows to monitor right
      dot: leftmeta+leftshift+right

      # popshell toggle maximize
      m: leftmeta+m

      # close window
      x: leftalt+f4

      # browser

      # next tab aka `ctrl + tab`
      p: leftctrl+pagedown

      # previous tab aka `ctrl + shift + tab`
      u: leftctrl+pageup

      # go back
      leftbrace: leftalt+left

      # go forward
      rightbrace: leftalt+right

  - name: popshell
    passThrough: false
    bindings:
      enter: leftmeta+enter
      h: leftmeta+h
      j: leftmeta+j
      k: leftmeta+k
      l: leftmeta+l
      u: leftmeta+leftshift+pageup
      p: leftmeta+leftshift+pagedown
      o: leftmeta+o
      i: leftmeta+s
      semicolon: leftmeta+g
remembertoremind commented 1 year ago

I'm a simple person who likes simple things. Like, I like when I can control the mouse with one hand, so this is my wsad-suggestion. the right/left mouse button on shift and tab makes sense when I have to drag and drop stuff. I rarely have to, but I'd rather be able to than not. Besides, I rarely use shift and tab when moving the mouse. I have been using this config for about 5 hours and it feels rather natural. Even the easy integration with my browser is a pretty amazing. mouseless is easy to set up and easy to use <3

# the default speed for mouse movement and scrolling
baseMouseSpeed: 750.0
baseScrollSpeed: 20.0

# the time it takes to accelerate to baseMouseSpeed (in ms), 0 to reach top speed immediately
mouseAccelerationTime: 200.0

# the shape of the acceleration curve, 1.0 is linear, higher values have more time at low speeds
mouseAccelerationCurve: 2.0

# speed of the mouse when it starts moving
startMouseSpeed: 0.0

# same for deceleration
mouseDecelerationTime: 300.0
mouseDecelerationCurve: 3.0

layers:
- name: initial
  bindings:
    leftalt: toggle-layer mouse

- name: mouse
  passThrough: false
  bindings:
    g: reload-config
    leftshift: button left
    capslock: button middle
    tab: button right
    d: move  1  0
    a: move -1  0
    s: move  0  1
    w: move  0 -1
    r: scroll up
    f: scroll down

# Qutebrowser   
    q: leftshift+h
    e: leftshift+l
    2: leftshift+k
    3: d
    4: u
    5: leftshift+j

# ncspot-remote
    z: "exec ncspot-remote previous"
    x: "exec ncspot-remote playpause"
    c: "exec ncspot-remote next"
benjaminbhollon commented 1 year ago

Ooh nice qutebrowser integration; I may steal that.

remembertoremind commented 1 year ago

Ooh nice qutebrowser integration; I may steal that.

It works really well :) Do note that I've opened an issue with the numbers being +1. So, 4 is actually 5 in the config.

benjaminbhollon commented 1 year ago

Pretty sure you're supposed to use k2, k3, k4, k5, etc? That's what's in the example config and what I use in mine.

remembertoremind commented 1 year ago

You're right! I totally missed that.

brokenricefilms commented 1 year ago

home row mods: https://precondition.github.io/home-row-mods

32

# the keyboard devices it reads from, if no devices are specified, it reads from all
devices:
# - "/dev/input/by-id/SOME_KEYBOARD_REPLACE_ME-event-kbd"

# startCommand: "setxkbmap de"

baseMouseSpeed: 750.0
baseScrollSpeed: 20.0

mouseAccelerationTime: 200.0
mouseAccelerationCurve: 2.0

startMouseSpeed: 0.0

mouseDecelerationTime: 300.0
mouseDecelerationCurve: 3.0

layers:
  - name: initial
    bindings:
      space: tap-hold space ; toggle-layer thuan_fly_keys ; 185
      q: tap-hold q ; toggle-layer mouse ; 185
      a: tap-hold-next-release a ; leftmeta ; 185
      s: tap-hold-next-release s ; leftalt ; 185
      d: tap-hold-next-release d ; leftshift ; 185
      f: tap-hold-next-release f ; leftctrl ; 185
      j: tap-hold-next-release j ; rightctrl ; 185
      k: tap-hold-next-release k ; rightshift ; 185
      l: tap-hold-next-release l ; rightalt ; 185
      semicolon: tap-hold-next-release semicolon ; rightmeta ; 185

      # capslock kinda useless for me, so i map it to esc for vim
      capslock: esc

      # key `|\` at the bottom on msi laptop keyboard, why? they put the key in this position
      102nd: leftctrl

      #####################
      # External keyboard #
      #####################

      # key menu
      compose: leftctrl
      f1: mute
      f2: volumedown
      f3: volumeup
      # mic mute, `KEY_MICMUTE` ~ micmute doesn't work, debug show key press is `f20`
      f5: f20
      f8: leftctrl+leftshift+v

  - name: mouse
    passThrough: false
    bindings:
      a: layer initial
      i: layer mouse
      l: move  1  0
      h: move -1  0
      j: move  0  1
      k: move  0 -1
      p: scroll up
      semicolon: scroll down
      leftalt: speed 4.0
      space: speed 0.3
      r: button left
      e: button middle
      w: button right

  - name: thuan_fly_keys
    passThrough: true
    bindings:
      z: reload-config

      # function key kinda far, lazy to reach out
      k1: f1
      k2: f2
      k3: f3
      k4: f4
      k5: f5
      k6: f6
      k7: f7
      k8: f8
      k9: f9
      k0: f10
      minus: f11
      equal: f12

      # gnome favorite app on dash
      a: leftmeta+k1
      s: leftmeta+k2
      d: leftmeta+k3
      f: leftmeta+k4
      g: leftmeta+k5
      q: leftmeta+k6
      w: leftmeta+k7
      e: leftmeta+k8
      r: leftmeta+k9

      # editing text

      k: up
      h: left
      j: down
      l: right
      i: home
      o: end

      # Gnome

      # resize windows
      c: rightalt+f8

      # pano clipboard extension
      v: leftmeta+leftshift+v

      # switch windows to monitor left
      comma: leftmeta+leftshift+left

      # switch windows to monitor right
      dot: leftmeta+leftshift+right

      # popshell toggle maximize
      m: leftalt+f10

      # close window
      x: leftalt+f4

      # browser

      # next tab aka `ctrl + tab`
      p: leftctrl+pagedown

      # previous tab aka `ctrl + shift + tab`
      u: leftctrl+pageup

      # go back
      leftbrace: leftalt+left

      # go forward
      rightbrace: leftalt+right
1270011 commented 10 months ago

mouseless + shinglify (tiling/floating hybrid) + xfce. So my configuration is quite simple, used for mouse control only, as all other tasks are already managed externally:

# the keyboard devices it reads from, if no devices are specified, it reads from all
devices:
# - "/dev/input/by-id/SOME_KEYBOARD_REPLACE_ME-event-kbd"

# this is executed when mouseless starts, e.g. useful for setting the keyboard layout
# startCommand: "setxkbmap de"

# the default speed for mouse movement and scrolling
baseMouseSpeed: 1750.0  # default 750.0
baseScrollSpeed: 30.0

# the time it takes to accelerate to baseMouseSpeed (in ms), 0 to reach top speed immediately
mouseAccelerationTime: 10.0  # default 200.0
# the shape of the acceleration curve, 1.0 is linear, higher values have more time at low speeds
mouseAccelerationCurve: 2.0  # default 2.0
# speed of the mouse when it starts moving
startMouseSpeed: 0.0
# same for deceleration
mouseDecelerationTime: 300.0
mouseDecelerationCurve: 3.0

# the rest of the config defines the layers with their bindings
layers:
- name: initial
  # when true, keys that are not mapped keep their original meaning
  passThrough: true
  bindings:
    # layers for window manager excluded
    leftmeta: tap-hold-next leftmeta ; toggle-layer movewin ; 100  # window manage
    leftctrl: tap-hold-next leftctrl ; toggle-layer movework1 ; 100  # workplace manage
    leftalt: tap-hold-next leftalt ; toggle-layer movework2 ; 100  # workplace manage
    # movement
    up: move  0 -1
    right: move  1  0
    down: move  0  1
    left: move -1  0
    # speed
    f4: speed 4.0
    f5: speed 0.3
    f6: speed 0.1
    # scroll
    rightshift: scroll up
    kp0: scroll down
    # buttons
    a: button left
    102nd: button middle
    z: button right

# another layer for window management
- name: movewin
  passThrough: true
  bindings:
    # _ is the wildcard key, which matches any key that is not mapped
    _: leftmeta+_

# another layer for window management
- name: movework1
  passThrough: true
  bindings:
    _: leftctrl+_

# another layer for window management
- name: movework2
  passThrough: true
  bindings:
    _: leftalt+_
junaruga commented 8 months ago

My mouseless config is here. The layout is affected by my 34 keys layout on the keyboard called Moonlander.

I am executing the mouseless in my Sway window manager config file for autostarting like this. I wanted to autorun it on only my user, because it may have trouble with inappropriate mouseless config file.

# Run always mouseless when reloading the sway config file.
exec_always pkill mouseless || :; sleep 1; ~/.go/bin/mouseless

Edited: Now I am auto-running mouseless at startup by the systemd user service mouseless.service with a login user privileges (without root privileges). You can check how to do on https://github.com/jbensmann/mouseless/pull/41.