How to make the root mouse pointer hidden? [SOLVED]

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Message
Author
User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

How to make the root mouse pointer hidden? [SOLVED]

#1 Post by Argolance »

Hello,
All is in the title: does any command exist to hide the pointer of the mouse during a special process and to show it again when finished?
Thank you.

Cordilalement.
Last edited by Argolance on Wed 08 Aug 2012, 08:39, edited 2 times in total.

User avatar
ETP
Posts: 1193
Joined: Tue 19 Oct 2010, 19:55
Location: UK

Re: How to make the mouse pointer hidden?

#2 Post by ETP »

Argolance wrote:Hello,
All is in the title: does any command exist to hide the pointer of the mouse during a special process and to show it again when finished?
Thank you.

Cordilalement.
Two possibilities:
Unclutter (already in many pups) [url]file:///usr/share/doc/unclutter.htm[/url]

Xdotool http://www.semicomplete.com/projects/xd ... e_commands

Pet in this thread: http://www.murga-linux.com/puppy/viewtopic.php?t=79263
Regards ETP
[url=http://tinyurl.com/pxzq8o9][img]https://s17.postimg.cc/tl19y14y7/You_Tube_signature80px.png[/img][/url]
[url=http://tinyurl.com/kennels2/]Kennels[/url]

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#3 Post by Argolance »

Hello,
Thank you!
Looking inside /root/.xinitrc, I already noticed that it was possible to hide the pointer when not moving using "unclutter":
#v2.01 hide cursor when not moving... (setup in /usr/sbin/input-wizard)
if [ -f /etc/mousehide ];then
IDLETIME="`cat /etc/mousehide | cut -f 1 -d ','`"
[ ! "$IDLETIME" = "0" ] && unclutter -idle $IDLETIME &
fi
But this is not exactly what I need: At startup, I would like the pointer to be hidden while a welcome screen is displayed, then shown only when the desktop appears...

Cordialement.

User avatar
Dave_G
Posts: 453
Joined: Thu 21 Jul 2011, 13:53

#4 Post by Dave_G »

Hi Image

A very interesting question.
Are you referring to the X mouse cursor while Xwin is starting up or
the actual arrow once it's completely loaded?

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#5 Post by Argolance »

Hello Image
I think I am...
... referring to the X mouse cursor while Xwin is starting up
I guess I am not sure at all and don't really see what you mean:
the actual arrow once it's completely loaded
Cordialement.

User avatar
Dave_G
Posts: 453
Joined: Thu 21 Jul 2011, 13:53

#6 Post by Dave_G »

I've never had reason not to show it but now that you mention it,
it's an interesting exercise which I will try.

Will experiment a bit later on and report back.

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#7 Post by Argolance »

OK! thank you...

User avatar
Dave_G
Posts: 453
Joined: Thu 21 Jul 2011, 13:53

#8 Post by Dave_G »

OK, after a bit of research on my Puppy4.3.1 running jwm:

The big X we see on a black background whilst the window manager (jwm) is loading, which is what I assume
you don't want is actually being generated by the X_server and is
displayed until a Windows Manager takes over which then displays
the background, task bar, default mouse cursor and so on.
In my case the Windows Manager is JWM.

To see what I mean, log out of X then once on the CLI type:

Code: Select all

cd /usr/X11R7/bin
then type:

Code: Select all

Xorg
What you will see is a black screen (or a funny cross-hatch pattern)
depending on your screen resolution and the big X cursor.
It will stay like that waiting for a Windows Manager to start
which of course it never will.
To "exit" press

Code: Select all

 CONTROL+ALT+F1 
then

Code: Select all

 CONTROL+C 
followed by

Code: Select all

xwin 
to return to normal.

So unless someone can think of something else, I don't see how this can
be overcome.

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#9 Post by technosaurus »

Actually I have shown that you can boot to X with jwm in ~1s. It would be useful to change the mouse cursor to a blank while the "console" stuff loads in rxvt. Though mine is an extreme example, it is common for a whole set of apps to load after the wm is up. Iirc xcb had an example that changes the cursor, but it used the numeric reference to the glyph... makes the example hard to find even when you have found it. It toggled between a hand pointing and an arrow cursor, so you may just need to replace it with a blank glyph(and eliminate the other example code)
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#10 Post by Argolance »

Hello,
Thank you.
@technosaurus
Actually I have shown
Sorry but may I please have a bit more? (Where did you show this?) :oops:
that you can boot to X with jwm in ~1s
"in ~1s" :shock: ???

@Dave_G
To see what I mean, log out of X then once on the CLI type:
I did it... and I think this is what I mean too!
This is my boot process:
  • - First Xlock is displayed (no cursor) to protect the session (with a password)
    - then a welcome screen is displayed (I get a cursor)
    - then jwm is launched (the cursor above is changed to an other one that is customizable by the user).
I just would like the cursor shown during the welcome screen to be hidden.

Cordialement.

User avatar
Dave_G
Posts: 453
Joined: Thu 21 Jul 2011, 13:53

#11 Post by Dave_G »

Argolance wrote: - then a welcome screen is displayed (I get a cursor)
What Puppy are you using?
With my 4.3.1, it goes from black screen with the X cursor straight
to the desktop once JWM is loaded.
Argolance wrote: I just would like the cursor shown during the welcome screen to be hidden.
My Puppy does not have a welcome screen, or perhaps I haven't set one.

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#12 Post by Argolance »

Hello Dave_G,
I am actually working on the next "Desktop Environment" of Toutou LINUX, the French version of Puppy 5.3 that will soon be ready: This welcome screen comes with it!

Cordialement.

User avatar
Dave_G
Posts: 453
Joined: Thu 21 Jul 2011, 13:53

#13 Post by Dave_G »

Hi Argolance

Ok, why not have a look to see exactly what is generating the welcome screen?
Is it a picture or a combination of picture and text?
If it's part of the Windows Manager, perhaps there are scripting options
in a file to manipulate the welcome screen.

Failing that, depending on the sequence of events, you could try and
make a new "empty" mouse cursor, there are tools available such as
xcursorgen
You could also have a look at Pcursor although I'm not sure if it's compatible
with your Puppy Version.

I will look further as time permits.

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#14 Post by Argolance »

Hello Dave_G,
Is it a picture or a combination of picture and text?
Is it just a gtkdialog script that shows a combination of pictures and texts and that is launched before jwm. Screen and window (without borders) backgrounds are both of the same color...
I will try to have a look for xcursorgen and Pcursor...
Thank you!

Cordialement.

User avatar
Dave_G
Posts: 453
Joined: Thu 21 Jul 2011, 13:53

#15 Post by Dave_G »

Hi Argolance

If it's just a gtkdialog script showing picture/s and text, then why don't you
use the pgm called unclutter which hides the mouse cursor after a certain
time of inactivity which you can make very short with the -idle switch

Just remember to load unclutter before the welcome screen and to kill it
after or it will keep on hiding your mouse cursor.

To kill unclutter, I think this will suffice:

Code: Select all

ThePID=`pidof unclutter`
kill -9 $ThePID
Hope this helps.

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#16 Post by technosaurus »

Argolance wrote:Hello,
Thank you.
@technosaurus
Actually I have shown
Sorry but may I please have a bit more? (Where did you show this?) :oops:
that you can boot to X with jwm in ~1s
"in ~1s" :shock: ???
Cordialement.
it was just a proof of concept, but:http://murga-linux.com/puppy/viewtopic. ... 822#590822
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#17 Post by Argolance »

Hello,
@Dave_G
if it's just a gtkdialog script showing picture/s and text, then why don't you
use the pgm called unclutter which hides the mouse cursor after a certain
time of inactivity which you can make very short with the -idle switch
I already tried this, following ETP post (above) but did not get what I am expecting for.

But I found something interesting: :wink:
Using xsetroot:
# xsetroot -v
usage: xsetroot [options]
where options are:
-display <display> or -d <display>
-fg <color> or -foreground <color>
-bg <color> or -background <color>
-rv or -reverse
-help
-def or -default
-name <string>
-cursor <cursor file> <mask file>
-cursor_name <cursor-font name>

-xcf <ARGB cursor file> <cursor size>
-solid <color>
-gray or -grey
-bitmap <filename>
-mod <x> <y>
... and following this (cursor_name <cursor-font name> option that lets user change the pointer cursor to one of the standard cursors from the cursor font):
Image
Examples:
xsetroot -cursor_name question_arrow
xsetroot -cursor_name watch
I can at least change the cursor (top left arrow) to another one.

I didn't have a look to the possibilities given by the "cursor <cursor file> <mask file>" option yet (lets user change the pointer cursor to whatever he wants when the pointer cursor is outside of any window. Cursor and mask files are bitmaps - little pictures - and can be made with any bitmap program. He probably wants the mask file to be all black until he gets used to the way masks work). I will soon have a look though this seems a bit strange: cursor file? mask file?

@technosaurus
Thank you for answering!
Damn hard for me! :oops:

Cordialement!

User avatar
Dave_G
Posts: 453
Joined: Thu 21 Jul 2011, 13:53

#18 Post by Dave_G »

Hi Argolance

Nice find with xsetroot.
I especially like the -bitmap option.

By the way, keep in mind that some apps use their own mouse cursors
so it may over-ride your setting.
If I'm not mistaken, FireFox is one of those with it's own cursors.

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#19 Post by seaside »

Argolance,

You can do this with xsetroot to blank the pointer-

Make a file named none.xbm

Code: Select all

#define none_width 1
#define none_height 1
#define none_x_hot 0
#define none_y_hot 0
static unsigned char none_bits[] = {
    0x00
};
then

Code: Select all

 xsetroot -cursor none.xbm none.xbm
Cheers,
s

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#20 Post by Argolance »

Hello Dave_G,
By the way, keep in mind that some apps use their own mouse cursors
It is not a problem for my case because I use this configuration only at start up of the system. Later, as jwm is launched, the mouse cursor is the one which is defined by default or the user defined himself.
Thank you!

Cordialement.

Post Reply