For years, I've used a Razor Naga with DPI switching on one of the side buttons, and for years before that, it was a Logitech G600. I've just installed Linux for the first time in a while only to realize Razor doesn't offer support, and Polychromatic doesn't offer button remapping.

Is there any way to rebind my mouse, or will I have to go back to Windows to keep using my mouse?

1Edit: plz send help fast. I am typing "1" into every window I open. I need rebind this before I break something.1

Edit21: Is there a way to bind a sensitivity toggle to the mouse button event more directly?

Edit 3: I've run out of time to work on this, so I'll need to install Windows for the time being. I might come back to it if I ever get a weekend free.

you are viewing a single comment's thread
view the rest of the comments
[–] [S] 1 point 1 year ago (1 child)

1>Says it can also print the current DPI, so I imagine that it’d be pretty straightforward to do a shell script of maybe three lines or so that cycles resolution through your favored resolutions when invoked. Doesn’t show an example of the exact output of the command, though, so I can’t tell you exactly what to run.

I installed it. The output from razer-cli --dpi print is just my dpi (1400).

11>I use Sway, and Sway can be configured to invoke commands when a button or key or whatever is pressed, so you’d just have it run said script.1

1I'm using Cinnamon, on Linux Mint

  • source
  • parent
  • hideshow 1 child comment
  • [–] 1 point 1 year ago* (last edited 1 year ago)

    The output from razer-cli --dpi print is just my dpi (1400).

    Okay. Something like this should work:

    #!/bin/bash
    dpi=$(razer-cli --dpi print)
    case $dpi in
      1400)
        razer-cli --dpi 20000
        ;;
      20000)
        razer-cli --dpi 1400
        ;;
    esac
    

    If the resolutions you want are 1400 and 20000 dpi.

    save it as cycle.sh or something like that in a directory in your PATH, and chmod +x it to make it executable. Every time it runs, it'll cycle though resolutions. Can add more resolutions or fiddle with the colors or whatever there too.

    Cinnamon

    Okay. I haven't used any GNOME stuff in ages, but it sounds like Cinnamon's keyboard applet only does keyboard bindings, so can't bind a mouse button to a command.

    https://github.com/linuxmint/cinnamon/issues/12840

    I don't know what the best route to run a command on mouse click is under Cinnamon is.

  • source
  • parent