Tiny Core Extensions > TCE News
AutoCursor extension submitted
Rich:
I recently came across this:
--- Quote from: pq5190362 on January 09, 2017, 03:14:07 PM --- ... On Ubuntu (on Unity desktop), you can even have a touchscreen and a mouse connected simultaneously and when moving the mouse, the cursor appears and when touching the touchscreen, the cursor disappears, and it reappears again when using the mouse (and so on), so the cursor is being dynamically hidden or shown depending on what kind of input device is currently in use.
That being said: Any idea how this could also be achieved in Tiny Core Linux?
--- End quote ---
That piqued my interest, so I decided to take a crack at it.
AutoCursor has been added to the TC10 x86 and x86_64 repositories. It's only dependency is libXfixes. Here's the .info file:
http://tinycorelinux.net/10.x/x86/tcz/AutoCursor.tcz.info
This is the usage message:
--- Code: ---tc@E310:~/C_Programs/AutoCursor$ ./AutoCursor
AutoCursor version 0.10 Jan 30 2021 22:13:00
Copyright Richard A. Rost Jan 25,2021
AutoCursor controls cursor visibility based on device
events, such as mouse, keyboard, touch screen, etc.
Usage: AutoCursor [-sN] [-hN] [-i] [-e] [-S file] [-L file]
-s N Show cursor when event N occurs.
-h N Hide cursor when event N occurs.
-i Initial state of cursor is hidden.
-e Display list of available events.
-S file Save event settings to file.
-L file Load event settings from file.
Example: AutoCursor -i -s5 -h1 -h3 -s2 -S ~/.cursor.conf
Starts with cursor hidden.
Shows cursor when events 5 or 2 occur.
Hides cursor when events 1 or 3 occur.
Saves the event settings (but not -i) to a file.
tc@E310:~/C_Programs/AutoCursor$
--- End code ---
The first thing to do is scan the /dev/input/ directory and get a list of events and their descriptions:
--- Code: ---tc@E310:~/C_Programs/AutoCursor$ sudo ./AutoCursor -e
Event# Input device name
0: "Power Button"
1: "Power Button"
2: "Logitech USB-PS/2 Optical Mouse"
3: "PC Speaker"
4: "DELL DELL USB Keyboard"
5: "HDA Intel Mic"
6: "HDA Intel Line"
7: "HDA Intel Line Out"
8: "HDA Intel Front Headphone"
tc@E310:~/C_Programs/AutoCursor$
--- End code ---
To hide the cursor when typing, show the cursor when using the mouse, and create a settings file:
--- Code: ---sudo ./AutoCursor -h4 -s2 -S ~/.cursor.conf &
--- End code ---
This is what the settings file looks like:
--- Code: ---tc@E310:~/C_Programs/AutoCursor$ cat ~/.cursor.conf
s:"Logitech USB-PS/2 Optical Mouse"
h:"DELL DELL USB Keyboard"
tc@E310:~/C_Programs/AutoCursor$
--- End code ---
Although I haven't tried it under TC11 or higher, I have no reason to believe it won't work. I did copy the 32 bit binary to
my TC4 machine and it ran without any issues.
jazzbiker:
Hi, Rich!
Your AutoCursor is just a tasty candy! May I take one more, please? :)
jazzbiker:
Hi, Rich!
AutoCursor is overwhelmingly convenient. I vote for updating Xorg-7.7.tcz.info and adding
--- Code: --- Recommended: AutoCursor.tcz
--- End code ---
line to the Comments section.
This bothering cursor made me avoid X, now I feel it's fun :)
Best regards!
PS
there is typo in http://tinycorelinux.net/10.x/x86/tcz/AutoCursor.tcz..info - doubled point, and You didn't mentioned in the info file, were we can obtain the sources. Isn't it GPLv2 ;) ?
Rich:
Hi jazzbiker
--- Quote from: jazzbiker on January 31, 2021, 09:00:43 AM --- ... AutoCursor is overwhelmingly convenient. ...
--- End quote ---
Glad you like it.
--- Quote --- ... there is typo in http://tinycorelinux.net/10.x/x86/tcz/AutoCursor.tcz..info - doubled point ...
--- End quote ---
Oops. :-[ Thanks, fixed. :)
--- Quote --- ... You didn't mentioned in the info file, were we can obtain the sources. ...
--- End quote ---
The source package can be found here:
http://tinycorelinux.net/10.x/x86/tcz/src/AutoCursor/
Rich:
If there are any Raspberry Pi users running a GUI who are interested in this, here are the build instructions:
--- Code: ---wget http://tinycorelinux.net/10.x/x86/tcz/src/AutoCursor/AutoCursor-source-v0.31.tar.gz
tar xf AutoCursor-source-v0.1.tar.gz
cd AutoCursor
./CompileAutoCursor
--- End code ---
The CompileAutoCursor script will download and install extensions that are required to build this package.
The CompileAutoCursor script will not alter your onboot.lst file.
When it completes, copy AutoCursor.tcz, AutoCursor.tcz.dep, and AutoCursor.tcz.md5.txt to your tce/optional directory. Then:
--- Code: ---tce-load -i AutoCursor
--- End code ---
You will also find an AutoCursor-armv.tar.gz.bfe or AutoCursor-aarch64.tar.gz.bfe file has been created. It contains
all the extension files and a source package.
Now you can submit it to the repository. Attach the AutoCursor file with the .bfe extension it to a brief email that says:
--- Quote ---Attached is AutoCursor for TC12.
AutoCursor-armv.tar.gz.bfe contains the extension and the source tarball.
--- End quote ---
Adjust the TC version and filename as required.
The instructions for emailing the extension are here:
http://wiki.tinycorelinux.net/doku.php?id=wiki:creating_extensions#submitting
Use the tcesubmit email address, not the picoresubmit address.
Navigation
[0] Message Index
[#] Next page
Go to full version