13
How would I rebind my mouse buttons with a Razor Naga?
(sh.itjust.works)
Whether you're a seasoned pro or the noobiest of noobs, you've found the right place for Linux support and information. With a dedication to supporting free and open source software, this community aims to ensure Linux fits your needs and works for you. From troubleshooting to tutorials, practical tips, news and more, all aspects of Linux are warmly welcomed. Join a community of like-minded enthusiasts and professionals driving Linux's ongoing evolution.
I haven't used it, but it looks like you can change DPI with the
razor-cli
command.https://github.com/lolei/razer-cli
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.
Looks like you can also set the LED color, if you want to have it indicate the DPI or something.
If you can't figure out the script but can paste the exact output from the command printing the current DPI, I can probably help you with the script.
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.
https://man.archlinux.org/man/sway.5.en
You don't say what desktop environment you're using. If you're using Gnome or KDE, I expect that there's some similar utility, probably built into the desktop environment, to bind mouse buttons to invoke commands.
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
Okay. Something like this should work:
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, andchmod +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.Okay. I haven't used any GNOME stuff in ages, but it sounds like Cinnamon's 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.