Register
It is currently Sat Oct 25, 2014 8:57 pm

"find the mouse pointer" script - possible in bash?


All times are UTC - 6 hours


Post new topic Reply to topic  [ 6 posts ] 
Author Message
 PostPosted: Mon Apr 09, 2012 2:33 pm   

Joined: Mon Apr 09, 2012 1:45 pm
Posts: 3
The built in "find the mouse pointer" function in Ubuntu is totally inadequate. First of all, graphically the effect is way too low key and subtle. Some easy to miss ripple rings around the pointer. And the way you invoke it conflicts with the two most common ways to zoom a screen - neither control-+/- nor control-scroll will work if you have the "find the mouse pointer" feature turned on. It seems egregiously poorly thought out when you consider the people most likely to need either feature are the same ones likely to need the other. Some keyboard shortcuts can be reassigned in Ubuntu but there are some exceptions and this seems to be one. I know of ways to make other keys issue a "control" signal but I don't see how that would help as the conflict would still exist. And since the built in one is pretty near useless anyway I thought I'd investigate making a "find the mouse pointer" program from scratch, something I could assign a function key to as the hot key and that would shout out "Over here, four eyes!" with a bold graphic rather than whisper "here I am." with an anemic little ripple effect. An alternative, maybe even better, would be a script or program to which I could assign a function key as a hotkey, that would move the pointer to a standard location, ideally the center of the screen.

So can I do either of these in Bash or some similar scripting language like csh? If so can someone point me toward the commands I need to study? Or if not, can you point me toward what would probably be the easiest language to get up to speed on sufficiently to do this? I've pretty much exhausted all the man pages I can think of as being relevant, google/StartPage, and the ubuntu forums.

And speaking of that, Ubuntu and Gnome both seem to be headed away from making it easy for users to tinker with the UI and write scripts that will still work when the next version comes out. If anyone has thoughts on distros that are more traditionally committed to maintaining backwards compatibility as far as command line tools likely to be used in user written scripts and more committed to not making it hard for users to tinker under the hood I'd be interested in hearing them. Even Windows has done better in this department. Last time I checked all my batch files from the MS-DOS 3.2 era still work in Windows but if I had stuck with the default install of ubuntu Oneiric I'd have had to completely junk all my scripts and start over. Thanks to the Mate fork of Gnome 2 I've been able to salvage them with minimal editing but I'd still be interested if anyone has thoughts on distros more likely to be amateur-scripter-and-tinkerer friendly in the future. I'm planning on giving a BSD a try in the near future and was thinking about Debian and Slack. I've had some experience with Sabayon and a very small amount with Unix long ago.

Any thoughts on either subject, I'd appreciate.


Top
 Profile  
 PostPosted: Sun Apr 15, 2012 11:36 am   
User avatar

Joined: Sat Jul 02, 2011 10:43 am
Posts: 23
Location: Devon,UK
As an ex gnome2 user I found gnome3 to be all but unusable, if you like to "tinker" and do stuff yourself I would highly recommend Slackware+Xfce4.10, 'fraid I can't help with your mouse problem though as I dumped ubuntu about 5 years ago when I grew up and found a "real" distro!


Top
 Profile WWW  
 PostPosted: Mon Apr 16, 2012 1:10 am   

Joined: Mon Apr 09, 2012 1:45 pm
Posts: 3
Thanks, Keith. Trying Slack and a BSD have been next on my agenda for a while. Just waiting until I get another hard drive. Slack interests me because of it's rep for flexibility, because of LILO (I like the idea of being able to pick CD or HD boot without removing/inserting media or messing with the BIOS), and because of the prevalence of interest in csh amoung Slackers. I LIKE goto. I can't see that it is a sin in small scripts.

I have to agree that Gnome 3 and Unity are both insulting pieces of rubish. It's amazing to see the Canonical fanboys striking the faux sophisticate pose and lecturing people who express their displeasure that they need to embrace change and get with the hip new UI. It's all glitz and glamour eyecandy and UI novelty simply for the sake of novelty itself and impressing the gullible with how creative they are at the expense of useful function. I used to think the Sabayon crowd were a little over the top in speaking of "ubuntards" but I guess they saw where the trend of "pop it up and dumb it down" was heading. I realise now it's not really a good sign when a distro makes keeping the possibility of enabling the root account hidden as deeply as possible and forbids discussion of it in their forum. With people like Linus T. and Fragadelic of Remastersys fame expressing their misgivings it's amazing that some of the posers have the gall to pretend that anyone who doesn't like the direction of development must just not be technically sophisticated. LOL. If I can't get the bloody pointer to behave under a built-from-the-minimalist-mini-iso-up version of the soon to be released 12.04 LTS with the Mate environment without losing any other function it'll be the last time I waste with Ubuntu.


Top
 Profile  
 PostPosted: Tue May 01, 2012 12:13 pm   
User avatar

Joined: Wed Jun 08, 2011 8:27 am
Posts: 189
Location: outer Shpongolia
LewRockwellFAN wrote:
[...] something I could assign a function key to as the hot key and that would shout out "Over here, four eyes!"
with a bold graphic rather than whisper "here I am." with an anemic little ripple effect.


Using yad(1), a zenity(1)'s fork ; for example:
Code:
yad --text '<span font-family="Helvetica" color="gray"><b><big> Over here, four eyes! </big></b></span>' \
    --timeout 3 --no-buttons --mouse --on-top --undecorated --skip-taskbar

See: http://code.google.com/p/yad/



LewRockwellFAN wrote:
An alternative, maybe even better, would be a script or program to which I could assign a function key as a hotkey,
that would move the pointer to a standard location, ideally the center of the screen.


Using xrandr(1), xdotool(1), and awk(1).
Code:
xdotool mousemove $(awk -F '[ x]' '/*/ { print $4/2, $5/2 }' <(xrandr))


It also works with multiple screens.


Top
 Profile  
 PostPosted: Fri May 04, 2012 1:35 pm   
User avatar

Joined: Sat Jul 02, 2011 10:43 am
Posts: 23
Location: Devon,UK
just playing really but how about this:
Code:
#!/bin/bash -e

oldcursor=$(xfconf-query -nRt string -c xsettings -vp /Gtk/CursorThemeName)
olssize=$(xfconf-query -nRt int -c xsettings -vp /Gtk/CursorThemeSize)
for ((cnt=0;cnt<10;cnt++))
   do
      xfconf-query -nRt int -c xsettings -vp /Gtk/CursorThemeSize -s 128
      xfconf-query -nRt string -c xsettings -vp /Gtk/CursorThemeName -s Oxygen_Black_Big
      sleep 0.5
      xfconf-query -nRt int -c xsettings -vp /Gtk/CursorThemeSize -s $olssize
      xfconf-query -nRt string -c xsettings -vp /Gtk/CursorThemeName -s $oldcursor
      sleep 0.5
   done
bound to a key
Only works under xfce though


Top
 Profile WWW  
 PostPosted: Tue May 08, 2012 10:01 pm   
Site Admin
User avatar

Joined: Sun May 15, 2005 9:36 pm
Posts: 669
Location: Des Moines, Iowa
LewRockwellFAN wrote:
Thanks, Keith. Trying Slack and a BSD have been next on my agenda for a while. Just waiting until I get another hard drive. Slack interests me because of it's rep for flexibility, because of LILO (I like the idea of being able to pick CD or HD boot without removing/inserting media or messing with the BIOS), and because of the prevalence of interest in csh amoung Slackers. I LIKE goto. I can't see that it is a sin in small scripts.

I have to agree that Gnome 3 and Unity are both insulting pieces of rubish. It's amazing to see the Canonical fanboys striking the faux sophisticate pose and lecturing people who express their displeasure that they need to embrace change and get with the hip new UI. It's all glitz and glamour eyecandy and UI novelty simply for the sake of novelty itself and impressing the gullible with how creative they are at the expense of useful function. I used to think the Sabayon crowd were a little over the top in speaking of "ubuntards" but I guess they saw where the trend of "pop it up and dumb it down" was heading. I realise now it's not really a good sign when a distro makes keeping the possibility of enabling the root account hidden as deeply as possible and forbids discussion of it in their forum. With people like Linus T. and Fragadelic of Remastersys fame expressing their misgivings it's amazing that some of the posers have the gall to pretend that anyone who doesn't like the direction of development must just not be technically sophisticated. LOL. If I can't get the bloody pointer to behave under a built-from-the-minimalist-mini-iso-up version of the soon to be released 12.04 LTS with the Mate environment without losing any other function it'll be the last time I waste with Ubuntu.



I'll give you advice that took me way to long to take myself ... go install Arch Linux. ;)


Top
 Profile WWW  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP