Showing posts with label bash. Show all posts
Showing posts with label bash. Show all posts

Wednesday, 31 May 2023

Slow speed using Evoluent mouse with linux mint 21.1

Recently i installed a fresh copy of linux mint 21.1

I've got a nice new 4K monitor that someone donated to me, which then hooked up to another donated PC fitted with a Nvidia 1060 6GB GPU nicely. 

While that's not impressive, it is for me. I always get the hand-me-downs, which is why i like running linux so much as these machines are always fast, they just out perform windows even when being old. 

Anyhow, i also have a nice Evoluent Vertical 4 Mouse, This mouse is great if you have some OOS (occupational over use syndrome). Stemming from my Cad days this mouse really saved my wrist from horrible all day pains

So with my 4K monitor, i scaled the 4K image up 200%, so both monitors were approx the same resolution. However the mouse point was slow. 

Even with the speed sliders at full, it was a real slog to try and get the pointer from one screen to another.

I thought it was something to do with the scaling that i had done with the driver, but when i tried another mouse, i didn't see the same effect, therefor leading me to assume that it was something special with this mouse. 

I found a great post in the end about increasing the mouse sensitivity. trying this out proved to be the fix that i needed. 

To see the current settings, use:

xinput --list-props "HOLTEK Evoluent VerticalMouse 4" | grep -i 158

Then to try new settings use: 

xinput --set-prop 8 158 2.000000 0.000000 0.000000 0.000000 2.000000 0.000000 0.000000 0.000000 1.000000

According to the post, the values you want to be tweaking are the two "2.00000" from the above command. These are the X and Y axis respectively 

Once i found mine, as suggested, i popped this into my ~/.bashrc, so that everytime the computer reboots, it will set the values i want.

Now.. where is my coffee....

Monday, 4 May 2020

Functions in aliases for bash



Thought i'd share a little nugget.

So i do a few commands in linux that are repetitive in nature, so i often alias them out so i'm lazy and don't have to type as much.
For instance, one of my repetitive commands is `git grep`, which is a great tool for going through your git repo to search those reg expressions.
So in my ~/.bashrc, i have
alias ggrep="git grep"
Now, all i do is ggrep <my search>

Something i learn't today however, is passing an argument to an alias.
My work has a lot of test boxes scattered around connected to different gear, so i ssh a lot to these. since the are all nicely formatted to tb<something a rather>, i decided i would now like to replace ssh tb0933 with tb 0933.
To do this is easy enough, but unlike a standard bash shell, we can't pass in the variable and just access like $x. Instead what we have to do is to create a function, and then call it.
So in the very simple case of the above my command equates to
alias tb='function ssh_tb=() { ssh tb$@; }; ssh_tb'
So expanding on this, we define the function ssh_tb() which when called, will execute the command ssh tb$@, and then at the end of this, we call it.

Easy!