Code Monkey home page Code Monkey logo

unclutter-xfixes's Introduction

Issues Forks Stars

unclutter-xfixes

About

This is a rewrite of the popular tool unclutter, but using the x11-xfixes extension. This means that this rewrite doesn't use fake windows or pointer grabbing and hence causes less problems with window managers and/or applications.

Installation

Arch / Manjaro

pacman -S unclutter

unclutter-xfixes is also available in the AUR as unclutter-xfixes-git.

Debian / Ubuntu

apt install unclutter-xfixes

Fedora

dnf install unclutter-xfixes

FreeBSD

unclutter-xfixes is available in the FreeBSD Ports Collection as misc/unclutter-xfixes.

Manual

Make sure to install the missing dependencies first:

  • libev-devel
  • libX11-devel
  • libXi-devel
  • asciidoc

You can then clone the git repository, compile and install it using like this:

git clone https://github.com/Airblader/unclutter-xfixes
cd unclutter-xfixes
make
sudo make install

Usage

See man unclutter after installation.

unclutter-xfixes's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

unclutter-xfixes's Issues

trying to compile in raspberry pi 3

Hello my friend , i have trying to compile in raspberry pi , the compilation was successfuly , but unclutter dont regonize the option --ignore-scrolling

any thoughs?

thanks!

Does not work well with multiple pointers

When having multiple pointers (e.g. via xinput create-master), moving either pointer causes both to become visible. This seems to be a limitation of XFixesHideCursor, so it's possible that it can't be fixed.

[Feature Suggestion] custom jitter for window match

First of all, I'd like to thank you all for this amazing program!
I really enjoy it.
:)

I was wondering if it would be possible to add a feature that permits to set a custom jitter to a specific set of windows rather than only setting jitter globally with the --jitter option

Something similar to what --not already does, but rather than hide the mouse totally, it would set a different jitter for that window.

For example, I'm glad with --jitter=50 for most apps, but when reading pdfs and highlighting them I find this number a bit too big and end opting for something like --jitter=1.
What I would like to have is an option like --jitter-window=<jitter_value> <window_name that enables me to more accurately fine tune the program.

It's just an idea, and I'd be happy to help (though I recognize I'm not already a great C programmer).

I was reading the source code but did'n find how to do it immediately...

Thanks in advance for your attention!

Readme and manual page should be rewritten

Current description of unclutter doesn't say what this application does but instead describes what it replaced.

I have put it once in my i3 startup script and forgot what was this about. Looking at the manual page was a dead-end.

How does it works?

Can you please tell me how unclutter hides the mouse cursor.
I use Ubuntu and I want do hide the cursor for the touchscreen I use.
while booting you can see the cursor in the loading screen if you touch the monitor
after the boot the cursor is hiden, because i have put unclutter -idle 0 in the starting programms
but if i touch the screen the cursor apears for one or even two seconds
and unclutter seems to have no might over that
i have to wait until the standard hide from ubuntu takes over.
do you eventualy hapen to kow how the standard hide of ubuntu works and if it is cofigurable?

please forgive me for my bad englisch.

Unclutter not working (X230 Tablet)

Hi, so I'm trying to have unclutter hide my cursor on touch in Manjaro Gnome. I tried unclutter --hide-on-touch but that didn't work. I shortly realized that unclutter -idle 0.01 -root doesn't work to just hide the cursor altogether. I tried on the other package in the community repository, but that doesn't work either. How can I fix this problem?

Have you measured memory usage during the time?

After running for about 4-5 days it grew from

%CPU %MEM    VSZ   RSS
0.0  0.0  27424  1400

to

0.0  3.4 270300 243640

i haven't did more precise measurements, but imho that's enough already for reporting.

Move to longopt

  • -v -> --version
  • -h-> -h / --help
  • -b -> --fork
  • -t -> --timeout

Disable timeout while retaining hide-on-touch functionality

Been using unclutter-xfixes for a while now and it works really well. However, I only use this tool to hide the cursor on touch input and have no interest in hiding it when using a mouse. Would it be possible to disable the timeout entirely rather than entering an absurd cursor timeout?

Cursor gets spurious waken up.

I'm experiencing cursor blinking slowly after running unclutter. I suspect the trackpoint's auto calibration may be to blame, or something else. How can I debug this?


command: unclutter --timeout 1.5
unclutter version : heads/makepkg-0-g17a95a8
WM: i3
OS : ArchLinux
Laptop: Thinkpad t450s

--ignore-scrolling does not work with gentoo

On gentoo the flag --ignore-scrolling apparently does not make a difference, i tried compiling from the repo and got the same problem. I'm using a trackpoint, scrolling with the middle button, but the same setup was working in arch just fine.

asciidoc needed?

I try to compile unclutter-xfixes on my debian 8 and installed some libs needed, now i have:
make: a2x: Command not found
Seem necessary to install asciidoc package to compile fine... but i must install 750MB of packages :-)
Is really necessary this?
Thank you

make of release tarball cannot set proper version

Hey, found your tool via i3/i3#3506 and want to package it for Arch Linux, eventually in [community]. I noticed that when I run make all on the release tarball, I get these errors:

==> Starting build()...
rm -f unclutter obj/extensions.o obj/unclutter.o obj/cursor.o obj/event.o obj/util.o
make: git: Command not found
rm -f man/*.1 man/*.xml
make: git: Command not found
gcc -D_FORTIFY_SOURCE=2 -D'__VERSION=""' "-Iinclude" -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -std=gnu99 -Wall -Wundef -Wshadow -Wformat-security -o "obj/extensions.o" -c "src/extensions.c"
make: git: Command not found
make: git: Command not found
...

But even if I add git to makedepends, I get this:

rm -f unclutter obj/extensions.o obj/unclutter.o obj/cursor.o obj/event.o obj/util.o
fatal: not a git repository (or any of the parent directories): .git
rm -f man/*.1 man/*.xml
fatal: not a git repository (or any of the parent directories): .git
gcc -D_FORTIFY_SOURCE=2 -D'__VERSION=""' "-Iinclude" -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -std=gnu99 -Wall -Wundef -Wshadow -Wformat-security -o "obj/extensions.o" -c "src/extensions.c"
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
...

Ideally I'd run it as make version=1.3 all or VERSION=1.3 make all to be able to set the version, but I think it won't be possible today.

Agree? Could you adapt the Makefile please? 🙂

Compatible command syntax with original unclutter

Given that unclutter-xfixes seems to aim at replacing the original unclutter (even using the same executable name), I think it would be good idea to have it accept as many of the original unclutter's command option names as possible to help make drop-in replacement go more smoothly. For instance, the option ‘-idle’ becomes ‘-timeout’ in unclutter-xfixes, requiring users to edit scripts/remember to use the new syntax/etc.. when migrating; it would be nice if unclutter-xfixes simply accepted the option ‘-idle’ as an alias for ‘-timeout’. Options which no longer apply like ‘-grab’, ‘-noevents’, etc., could perhaps be accepted but ignored for compatibility.

Doesn't always hide the cursor (touchscreen)

On Sxmo the cursor is always hidden, it is meant for touchscreen devices.
It uses this app to do it (on the x version).

But it doesn't work on Debian this is the service that is used:

[Unit]
Description=Hides mouse pointer while not in use

[Service]
Type=simple
Restart=always
ExecStart=/usr/bin/unclutter-xfixes --hide-on-touch --start-hidden

It stated that those two are unrecognized options, that I don't see on the man page indeed.

--ignore-scrolling does not work without jitter and on first scrolling

Info

unclutter-xfixes version: 1.5
OS: Arch Linux
Window Manager: dwm 6.2

Problem

unclutter --ignore-scrolling doesn't ignore scrolling. It only works if the --jitter option is also enabled, ex. unclutter --ignore-scrolling --jitter 20. Additionally, it doesn't ignore scrolling on the very first scrolling if the mouse wasn't moved since unclutter started.

Reproduce

Without jitter

  1. Execute unclutter --ignore-scrolling
  2. Wait until cursor is hidden
  3. Scroll without moving the mouse
  4. See that the mouse is visible now

With jitter

  1. Execute unclutter --ignore-scrolling --jitter 20
  2. DO NOT move the mouse and wait until the cursor is hidden
  3. Scroll without moving the mouse
  4. See that the mouse is visible now
  5. Wait again until the mouse is hidden
  6. Scroll again without moving the mouse and see that the mouse is now still hidden as expected

Question regarding XFixesHideCursor

Is it okay if I ask a question regarding XFixesHideCursor here? I figured you guys are the experts on this subject..

I wrote this function to hide the mouse pointer. It works when I call it with hide_or_show_cursor_X11(true). The pointer disappears entirely. However, the cursor won't come back on when I call it with hide_or_show_cursor_X11(false). Any idea what I am doing wrong?

Thanks a lot!

Feature-14

I've cloned this repo, feature-14 branch and had a go at it, based on the original unclutter.

This version of unclutter doesn't work well if one has multiple screens, and I had to fix it as I work on systems with 4 or 2 screens all the time. Re-implemented --onescreen to limit to one screen as well, though I won't need it.

Implemented --not, slightly differently from the original, the strings provided are case insensitive compared to both the window name and the class name (treat as regexps later?).

I could do a pull request against the feature-14 branch, if there is interest. I'd like for this to make it into Fedora, as the old one in there, interferes badly with xfreerpd.

Autostart via Xsession does not work under Wayland

I am running Ubuntu 22.04, which evidently uses Wayland rather than X. While unclutter still works when started manually, the autostart feature using Xsession does not. I've asked about it here on askubuntu. I'm sure there's some way to configure unclutter to autostart under Wayland, though I've yet to discover how. It would be great to have such configuration built into the unclutter distribution package. I'll report back if I'm able to figure it out on my own.

apt installs just version 1.5

apt install unclutter-xfixes

Using Linux Mint 20.3, this just installs version 1.5-3. Manually providing version number 1.6 just reports that it does not exist.

--timeout option not respected (i3wm)

Version

$ unclutter --version
unclutter-xfixes version 1.6
$ which unclutter
/usr/bin/unclutter

Installed with git clone + manual installation.

System

Distribution: Ubuntu 18.04
Window manager: i3wm (version 4.17.1)

Problem

In my i3wm config file I have this line

exec --no-startup-id /usr/bin/unclutter --ignore-scrolling --timeout 5

to execute unclutter at system start.

Unclutter is indeed executed but the timeout is 1 second long instead of the 5 seconds specified.

By executing htop and filtering by unclutter keyword, I get the following:

 PID   ...    TIME+   Command
2535   ---   0:00.00 ├─ /bin/sh -c /usr/bin/unclutter --ignore-scrolling --timeout 5
2538   ---   0:05.13 │  └─ /usr/bin/unclutter --ignore-scrolling --timeout 5
2514   ---   0:05.98 │  │  │  │  └+ /usr/bin/unclutter -idle 1 -root

So it seems that somehow a second unclutter instance is executed, with timeout set to 1 second.

If i kill the second instance, kill 2514 in this case, i get the actual 5 seconds as specified.

I am aware this is likely due to something else than unclutter itself, but at the moment I cannot identify the source of the problem.

errx format not a string literal and no format arguments UBUNTU

I'm trying to compile this project but haven't had any luck so far. I've managed to install all the dependencies but coming up with an error now.

Distribution: Ubuntu 15.10 (64bit)
gcc version: gcc (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010
compile error: src/util.c: In function ‘bail’: src/util.c:6:5: warning: format not a string literal and no format arguments [-Wformat-security] errx(EXIT_FAILURE, message);

full output:
`rm -f unclutter obj/extensions.o obj/unclutter.o obj/cursor.o obj/event.o obj/util.o
rm -f man/.1 man/.xml

gcc -D'__VERSION="heads/master-0-g17a95a8"' -Iinclude -std=gnu99 -Wall -Wundef -Wshadow -o obj/extensions.o -c src/extensions.c
gcc -D'__VERSION="heads/master-0-g17a95a8"' -Iinclude -std=gnu99 -Wall -Wundef -Wshadow -o obj/unclutter.o -c src/unclutter.c
gcc -D'__VERSION="heads/master-0-g17a95a8"' -Iinclude -std=gnu99 -Wall -Wundef -Wshadow -o obj/cursor.o -c src/cursor.c
gcc -D'__VERSION="heads/master-0-g17a95a8"' -Iinclude -std=gnu99 -Wall -Wundef -Wshadow -o obj/event.o -c src/event.c
gcc -D'__VERSION="heads/master-0-g17a95a8"' -Iinclude -std=gnu99 -Wall -Wundef -Wshadow -o obj/util.o -c src/util.c
src/util.c: In function ‘bail’:
src/util.c:6:5: warning: format not a string literal and no format arguments [-Wformat-security]
errx(EXIT_FAILURE, message);
^
gcc -Iinclude -std=gnu99 -Wall -Wundef -Wshadow -o unclutter obj/extensions.o obj/unclutter.o obj/cursor.o obj/event.o obj/util.o -lX11 -lXi -lXfixes -lev
a2x -f manpage man/unclutter-xfixes.man`

expected: compile safely without warnings

note: I'm not a C programmer, from what I've googled ubuntu gcc adds the flag -Wformat-security by default which brings up the warning.
Is it possible to fix this without removing the flag?
I would really like to use this project as I'm having problems with i3 and intellij and hoping this project will fix it.

Wayland support

I just switched to Wayland and the one thing I miss a lot is Unclutter. It would be great if you could somehow support Wayland. :)

REQUEST: cursor stays hidden while scrolling

I mainly use two-finger-scroll on my laptop so the cursor doesn't move but scrolling still makes the cursor visible.

Original unclutter keeps the cursor hidden while scrolling but that seems to have an effect on scroll speed (slower) on applications such as spotify, soundnode and franz.

If there's a way to have a hidden cursor and normal, fast scroll speed i'd very much appreciate it if it was implemented. Thanks!

Add option to move cursor position when hidden

I use unclutter with a tiling window manager (i3) since most of the time I don't use the mouse.
However, the hidden cursor still interacts with the underlying elements, and this is particularly annoying when browsing the web because it will trigger the onmouseover event of all elements it goes above.

Would it be possible to add an option so that the cursor would be moved at a chosen location when it's hidden? It would come back at the previous location when unhiding the mouse by moving it.

Thank you for this awesome tool.

Switch mouse off when inactive.

There are situations the UI responds to the current cursor's position, such as viewing code on github and browsing in Intellij with ideavim when pressing Ctrl-d/u. Can we just temporarily switch off mouse or move it to some alien space that it never bothers current UI?

hide-on-touch not working

If I am right, that option should hide the cursor when touching the screen, right? But this is not working in my system.

In openbox autostart I have the following:

@unclutter -timeout 0.01 --hide-on-touch

Dependencies to build from source are undocumented

The header files required to build unclutter-xfixes from source are not listed anywhere. I just uninstalled unclutter with my package manager and then tried to make unclutter-xfixes but I encountered a bunch of missing header file errors. Here are all the missing header files as well as the packages that you'd have to install on a Fedora system:

  • ev.h -> libev-devel
  • Xlib.h -> libX11-devel
  • XInput2.h -> libXi-devel

These were the ones that I had to install in order to install successfully. In a Debian/Ubuntu box just remove all the -devels and you should be good, I guess.

Cursor does not move after suspend

Very recently, as I only noticed tonight, the trackpad on my laptop will not work on waking from suspend. However, libinput detects my mouse perfectly fine when I run debug-events, and it immediately resumes proper functionality by running killall unclutter in terminal

OS: Arch Linux 5.16.5

ignore-scrolling + jitter unhides cursor on first scrolling

unclutter-xfixes version: 1.5

Problem

unclutter --ignore-scrolling --jitter 1 unhides the cursor on the very first scrolling. After that unclutter ignores scrolling and keeps the cursor hidden as expected.

Reproduce

  1. Execute unclutter --ignore-scrolling --jitter 1
  2. DO NOT move the mouse and wait until the cursor is hidden
  3. Scroll without moving the mouse
  4. See that the mouse is visible now
  5. Wait again until the mouse is hidden
  6. Scroll again without moving the mouse and see that the mouse is now hidden as expected

--ignore-buttons does not work with remapped buttons

Discussion continued from #40. To summarize, --ignore-buttons does not consider remappings (e.g. made with xinput --set-button-map). If I set a button that is initially 1 to be anything other than 1, --ignore-buttons <new number> does not work. Only --ignore-button <original number> works.

I checked to confirm and the event's evtype is XI_RawButtonPress and the event's detail is always the original button number (e.g. 1). I'm not sure if this means it's impossible to do anything about it. Let me know if there's any other specific information I can provide.

External mouse cursor freezes

Sorry for the title, I couldn't think up anything better.

I have a thinkpad with the nub being recognized as internal mouse and recently purchased an external mouse. If unclutter runs, the mouse cursor is shown for a bit, then hidden. Moving the nub stops it from hiding the cursor, however if I move the external mouse, it is kept hidden and its position never moves. The only thing that makes the cursor reappear is clicking with the external mouse, that allows moving it again until the next freeze.

Could you please add an option that allows movement of any pointer device to stop hiding the cursor?

Add Travis

We can at least make sure the build succeeds.

Screenshotting part of the screen using imagemagick's import is hard

Ubuntu 21.10
i3 4.19.1-non-git
ImageMagick 6.9.11-60 Q16 x86_64 2021-01-25

Reproduce:

  • Run import test-screenshot.png - Either from dmenu or gnome-terminal

What happens:

  • Cursor disappears, even though I'm moving it
  • (Drawing a rectangle, and saving a screenshot still works)

What should happen:

  • Cursor should not disappear (and instead turn into the normal crosshair)

Didn't find "screenshot" in the man-pages for unclutter or unclutter-xfixes

Cursor still displayed when screen sharing

Even if the cursor disappears for me, it is still visible when screen sharing in Discord. I'm not sure if this is a missing feature for this program or Discord (or if it's intended).

Ignore all clicks or specific buttons

I have buttons that I am using as keys, and it would be nice to be able to either have clicks not unhide the cursor or to be able to ignore clicks for specific buttons (not just buttons 4 and 5).

make fails on Ubuntu 18.04

$ make
rm -f unclutter obj/extensions.o obj/unclutter.o obj/cursor.o obj/event.o obj/util.o
rm -f man/*.1 man/*.xml
gcc -D'__VERSION="1.6"' "-Iinclude" -std=gnu99 -Wall -Wundef -Wshadow -Wformat-security -o "obj/extensions.o" -c "src/extensions.c"
gcc -D'__VERSION="1.6"' "-Iinclude" -std=gnu99 -Wall -Wundef -Wshadow -Wformat-security -o "obj/unclutter.o" -c "src/unclutter.c"
gcc -D'__VERSION="1.6"' "-Iinclude" -std=gnu99 -Wall -Wundef -Wshadow -Wformat-security -o "obj/cursor.o" -c "src/cursor.c"
gcc -D'__VERSION="1.6"' "-Iinclude" -std=gnu99 -Wall -Wundef -Wshadow -Wformat-security -o "obj/event.o" -c "src/event.c"
gcc -D'__VERSION="1.6"' "-Iinclude" -std=gnu99 -Wall -Wundef -Wshadow -Wformat-security -o "obj/util.o" -c "src/util.c"
gcc obj/extensions.o obj/unclutter.o obj/cursor.o obj/event.o obj/util.o -lX11 -lXi -lXfixes -lev -o "unclutter"
a2x --no-xmllint -f manpage "man/unclutter-xfixes.man"
a2x: ERROR: "xsltproc"  --stringparam callout.graphics 0 --stringparam navig.graphics 0 --stringparam admon.textlabel 1 --stringparam admon.graphics 0  "/etc/asciidoc/docbook-xsl/manpage.xsl" "/home/alex/unclutter-xfixes/man/unclutter-xfixes.xml" returned non-zero exit status 127
Makefile:61: recipe for target 'man/unclutter-xfixes.1' failed
make: *** [man/unclutter-xfixes.1] Error 1

Any ideas?

GCC strict aliasing warnings

The following warning messages come up when I compile unclutter. You can add -fno-strict-aliasing to the compiler flags to hide this. Otherwise, it should probably be checked out.

I am using GCC 6.1.1 to compile.

2016-05-19-102651_799x304_scrot

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.