LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 02-14-2019, 10:47 AM   #1
pisti
Member
 
Registered: Jul 2006
Distribution: slackware
Posts: 123

Rep: Reputation: 4
mouse pointer size - growing through shaking and/or moving fast


is there an option in X to increase the mouse pointer size temporarily - either by shaking or (preferred) while taking up speed over large screen distances ? like an accelerometer.

ideally this functionality, while active, should work irrespective of the software window the pointer hoovers over.

i am frequently simply lost, i can't locate this hair-fine mouse pointer on large 4K screens, it can be very annoying at times...
 
Old 02-14-2019, 01:11 PM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 11,027
Blog Entries: 7

Rep: Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777
fairly simple to script with a few utilities.
I bet there's several approaches, but here's I can think of:

1. a script that does:
- get current pointer position with xdotool
- use osd_cat (part of xosd) to draw a large O around that position

2. a daemon of sorts that detects certain mouse movemements (could be with xdotool again?) and triggers 1.
- or just use a hotkey to show the pointer.
 
1 members found this post helpful.
Old 02-14-2019, 08:45 PM   #3
pisti
Member
 
Registered: Jul 2006
Distribution: slackware
Posts: 123

Original Poster
Rep: Reputation: 4
good idea, ondoho, i will look into that, thanks !

but i am not sure yet how to set the coordinates (x,y) with osd_cat, though to get those numbers i use this here :
Code:
xdotool getmouselocation
i will write a short script associated with a #2 mouse button press (my Kensington trackball has 4 buttons), and that should do it.

just how to input the object coordinates - a red letter 'o' for example ?
 
Old 02-15-2019, 01:51 PM   #4
pisti
Member
 
Registered: Jul 2006
Distribution: slackware
Posts: 123

Original Poster
Rep: Reputation: 4
ok, ondoho, stuff started to work nicely for my *local* screen, thank you for your advice !

Code:
cat ~/.xbindkeysrc
"/bin/sh $MYPATH/center_mouse_pointer.sh"
    Control + grave
and here the corresponding shell script invoked by xbindkeys :

Code:
cat $MYPATH/center_mouse_pointer.sh
#!/bin/sh
#
# puts mouse pointer to screen center
#
# needs : xbindkeys xwininfo xdotool xosd
#
# uses : ~/.xbindkeysrc
#   "/bin/sh $PATH/center_mouse_pointer.sh"
#       Control + grave

myXY=`/usr/bin/xwininfo -root | grep geometry | tr -s " " | cut -d " " -f 3 | cut -d + -f 1`
myX=`echo $myXY | cut -d x -f 1`
myX=`echo $(( myX / 2))`
myY=`echo $myXY | cut -d x -f 2`
myY=`echo $(( myY / 2))`
/usr/bin/xdotool mousemove $myX $myY
echo o | osd_cat -A center -p middle -d 1 -A center -o -84 -O 3 -u yellow -c red -f '-*-helvetica-bold-r-*-*-34-240-*-100-p-182-*-*'
now, my next question is then how to make this setup also work on a *remote* screen such as in a tigerVNC window that i usually run in fullscreen mode ? i know that executing the script remotely makes xdotool and osd_cat work fine but that's of course channeled via ssh tunnel. so, i am not sure if it's a problem of xbindkeys or the other programs in the script that my remote scenario doesn't work ?
 
Old 02-15-2019, 02:32 PM   #5
pisti
Member
 
Registered: Jul 2006
Distribution: slackware
Posts: 123

Original Poster
Rep: Reputation: 4
it boils down to a problem with xdotool - i don't know how to make xdotool to move the mouse cursor on the remote tigerVNC screen which i display fullscreen locally...

does anybody how to tell xdotool on which screen:X or win:X to act on the mouse pointer position ?
 
Old 02-16-2019, 06:45 AM   #6
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 11,027
Blog Entries: 7

Rep: Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777
i don't know how tigerVNC works; I just tested in a fev virtualbox machines, and it does not work because the machines grab mouse & keyboard - the hotkey isn't even defined inside a vm, that's not a problem with xdotool.
if i press the right Ctrl key (configured to toggle keyboard & mouse grabbing), then press the hotkey, it works as expected.

btw i conceived a simpler script yesterday:
Code:
#!/bin/sh
eval $(xdotool getmouselocation --shell)
printf "██████████\n██      ██\n██      ██\n██      ██\n██████████" | osd_cat -o$((Y-18)) -i$((X-32)) -d1
 
Old 02-16-2019, 07:55 AM   #7
pisti
Member
 
Registered: Jul 2006
Distribution: slackware
Posts: 123

Original Poster
Rep: Reputation: 4
thank you, ondoho, for your elegant one-liner.

now, the problem with xdotools is that if executed as shell command in an xterm window it works on the local screen but not anymore in the virtual screen of tigerVNC. although(!) interestingly it switches window focus to the window at the screen center as long as i don't touch the mouse - but the slighted movement brings the pointer back to the former window, re-activates it and makes the mouse pointer appear again at its old position !

Code:
xdotool mousemove 1000 1000
so, either i use xdotools the wrong way, or xdotools is not fully compatible with tigerVNC...?
 
Old 02-16-2019, 08:13 AM   #8
pisti
Member
 
Registered: Jul 2006
Distribution: slackware
Posts: 123

Original Poster
Rep: Reputation: 4
actually, ondoho, you solved my original problem which was to highlight the mouse pointer position !

wow, i was a bit too fast with my previous reply. so, your solution is perfect. i was just not aware of the -i and -o options although i had looked at osd_cat's manual earlier.

i am just wondering what is inside your printf expression ? whatever editor i use, it only shows, literally, fat black box characters between the \n signs. also the Y-18 and X-32 formula puzzle me a bit...

can you explain ? i am curious to learn !
 
Old 02-16-2019, 08:29 AM   #9
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 11,027
Blog Entries: 7

Rep: Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777
the magic is in evaluating the xdotool command with the --shell switch.
read
Code:
man xdotool
 
Old 02-16-2019, 10:23 AM   #10
pisti
Member
 
Registered: Jul 2006
Distribution: slackware
Posts: 123

Original Poster
Rep: Reputation: 4
all fine - i found out about the black 'tiles' and about the 'formula' business. RTFM, right ?

the nice thing about printf & the utf black tiles is that we circumvent the font problem, no playing with font settings, it just works.

thanks again for your input ! with that i am closing here this thread...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
When growing raid: "mdadm: component size must be larger than chunk size." - but it is... Paul.C Linux - Server 7 01-18-2019 12:58 AM
MySQL ibdata1 growing and growing and growing and... jnojr Linux - Software 1 07-20-2009 07:11 PM
mouse pointer shaking/bouncing when using laptop trackpad r00tb33r Linux - Hardware 6 04-08-2009 04:34 PM
X utilaziion is growing and growing amirb Linux - Desktop 2 05-28-2007 03:55 AM
Monitor Screen Shaking a Lot. rvijay Linux - Newbie 18 09-16-2003 06:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 02:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration