Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mousetweaks: init at 3.32.0 #60176

Merged
merged 4 commits into from Apr 28, 2019
Merged

Conversation

JohnAZoidberg
Copy link
Member

Motivation for this change

We should have more accessibility programs.

Runs fine but I haven't tested with Gnome so I don't know if it does the
right thing. So I guess it's WIP.
I'd be glad if somebody tried it on Gnome :)

Solves #39509

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@jtojnar
Copy link
Contributor

jtojnar commented Apr 24, 2019

This will not work on GNOME under Wayland. I heard something about it being rewritten as a part of Mutter (GNOME’s WM) but cannot find the reference now.

Edit: https://gitlab.gnome.org/GNOME/mutter/merge_requests/512 https://gitlab.gnome.org/GNOME/mutter/issues/42

@jtojnar jtojnar added 6.topic: accessibility 6.topic: GNOME GNOME desktop environment and its underlying platform labels Apr 24, 2019
@JohnAZoidberg
Copy link
Member Author

Hmmmm, I'll look into it.
Also I created the directory pkgs/applications/accessibility I think we should move some tools there to have them sorted better. (e.g. orca is in pkgs/misc)

@JohnAZoidberg
Copy link
Member Author

Maybe I should move this under the gnome3 attribute if it only works on Gnome.

@ofborg ofborg bot removed the 6.topic: GNOME GNOME desktop environment and its underlying platform label Apr 24, 2019
@jtojnar
Copy link
Contributor

jtojnar commented Apr 24, 2019

I tested mousetweaks --dwell in elementary and it still works so top-level attribute is fine. I am actually trying to get rid of gnome3 attribute set.

pkgs/applications/accessibility/mousetweaks/default.nix Outdated Show resolved Hide resolved
pkgs/applications/accessibility/mousetweaks/default.nix Outdated Show resolved Hide resolved
license = licenses.gpl2;
platforms = platforms.all;
maintainers = [ maintainers.johnazoidberg ];
repositories.git = https://gitlab.gnome.org/GNOME/mousetweaks;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think this does anything.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw it on some other derivations and thought it couldn't hurt.
I'm not sure it does anything either 🤷‍♂️

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

72 derivations have it so it's at least an unwritten convention. Doesn't seem to be used right now but might be useful in the future.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect it comes from update walker, an old update system nobody uses.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No reference to this in update walker. According to 452b25b it is used by some @Phreedom’s tool, possibly https://github.com/Phreedom/nixpkgs-monitor, which refers to it in its source code.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, yeah I understand Eelco's concern but since there are already a lot of packages with it I think we can continue for packages that the repository is neither the homepage nor the source.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I did not even notice the comments.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of GNOME's wiki pages have a mention of the git repository, and even in this case where it's an old
url https://git.gnome.org/browse/mousetweaks it still redirects to GitLab.

There's not a lot of references to this attribute and I don't even see it documented anywhere. I'd say it's safe to not
use it, though I do see a place for it being useful as you mentioned @JohnAZoidberg.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well it is kind of formal, it's been a part of the valid meta attributes for quite a while.
@copumpkin added it here: 1a4ca22#diff-3c8a88619c3ca3d61eb0ce8794d9bb74R228
He added the check probably after realizing that lots of people started to use it.

@worldofpeace
Copy link
Contributor

@jtojnar
Copy link
Contributor

jtojnar commented Apr 24, 2019

Yeah, https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/474 is the MR I had in mind.

I can confirm this works in GNOME Shell running on Xorg (In Control Center under Universal Access enable Click Assist).

We may want to patch https://gitlab.gnome.org/GNOME/gnome-settings-daemon/blob/725d1e53fd656e1039c8da02ba0dbfd3db93b3c1/plugins/mouse/gsd-mouse-manager.c#L119, as without mousekeys being on PATH, the Click assist just immediately switches itself off with the only error being logged in journal.

Given that this is useful for other Xorg based desktops (even though it might need to be controlled through CLI arguments), I would still like to merge this. It is not like we are removing Xorg anytime soon, and those relying on accessibility features still depend on it anyway.

@worldofpeace
Copy link
Contributor

I tested mousetweaks --dwell in elementary and it still works so top-level attribute is fine.

I can confirm this works in GNOME Shell running on Xorg

Hmm does jtojnar switch between these effortlessly 😁

We may want to patch https://gitlab.gnome.org/GNOME/gnome-settings-daemon/blob/725d1e53fd656e1039c8da02ba0dbfd3db93b3c1/plugins/mouse/gsd-mouse-manager.c#L119, as without mousekeys being on PATH, the typing access just immediately switches itself off with the only error being logged in journal.

Sure, we can eat the runtime dep.

Given that this is useful for other Xorg based desktops (even though it might need to be controlled through CLI arguments), I would still like to merge this. It is not like we are removing Xorg anytime soon, and those relying on accessibility features still depend on it anyway.

Right, surprised it wasn't packaged already anyway.

@jtojnar
Copy link
Contributor

jtojnar commented Apr 24, 2019

Hmm does jtojnar switch between these effortlessly 😁

I have elementary and some other VM definitions on hand, so I just run

nixos-rebuild build-vm -I nixpkgs=$HOME/Projects/nixpkgs -I nixos-config=../nix-playground/elementary.nix
env QEMU_NET_OPTS="hostfwd=tcp::2222-:22" ./result/bin/run-*-vm

and roll 🚶‍♂️

Right, surprised it wasn't packaged already anyway.

Yeah, I was lazy and it was not very high in my queue since I was not sure what it actually does.

@worldofpeace
Copy link
Contributor

I have elementary and some other VM definitions on hand, so I just run

nixos-rebuild build-vm -I nixpkgs=$HOME/Projects/nixpkgs -I nixos-config=../nix-playground/elementary.nix
env QEMU_NET_OPTS="hostfwd=tcp::2222-:22" ./result/bin/run-*-vm

huh, I tend to keep a repo of configurations and just use an alias to build them when it's in the working directory.

Also looks like they even ship this tool
https://github.com/elementary/metapackages/blob/f27df798111e207f056a7a3d63eaf495aa0d34a7/desktop-recommends-amd64#L133

Yeah, I was lazy and it was not very high in my queue since I was not sure what it actually does.

Same there, they shipped it so I almost packaged it. But didn't know what it was for.

@JohnAZoidberg
Copy link
Member Author

JohnAZoidberg commented Apr 24, 2019

Thanks for the feedback!
It doesn't look unmaintained, it's been getting a few commits until 4 weeks ago.
Seems that MR is the only one that mentions it's deprecated - but the replacement hasn't been merged yet.

We may want to patch gitlab.gnome.org/GNOME/gnome-settings-daemon/blob/725d1e53fd656e1039c8da02ba0dbfd3db93b3c1/plugins/mouse/gsd-mouse-manager.c#L119, as without mousekeys being on PATH, the typing access just immediately switches itself off with the only error being logged in journal.

But isn't mousekeys on the PATH? Or how did you install it for use with GNOME?

@jtojnar
Copy link
Contributor

jtojnar commented Apr 24, 2019

Looked into if onboard should depend on mousetweaks. First I was confused that it depends on the old settings schemas org.gnome.Mousetweaks but apparently, it is only used for determining whether mousekeys are installed:
https://bazaar.launchpad.net/~onboard/onboard/trunk/view/head:/Onboard/ClickSimulator.py?start_revid=2295#L443

I suggest adding it to buildInputs of onboard.

And we might want to patch https://bazaar.launchpad.net/~onboard/onboard/trunk/view/head:/Onboard/ClickSimulator.py?start_revid=2295#L482

@jtojnar
Copy link
Contributor

jtojnar commented Apr 24, 2019

Cannot find any code path where orca depends on mousetweaks.

@JohnAZoidberg
Copy link
Member Author

I patched both locations.
But I'm not happy with the sed solution. It just silently fails when the code changes - or might even screw with new code.

Is there a way to write a patch file that I can interpolate a nix-store path into? I remember seeing something with @@var@@.

@ofborg ofborg bot added the 6.topic: GNOME GNOME desktop environment and its underlying platform label Apr 24, 2019
@jtojnar
Copy link
Contributor

jtojnar commented Apr 24, 2019

You can use patch with substituteAll:

patches = [
(substituteAll {
src = ./paths.patch;
gcm = gnome-color-manager;
gnome_desktop = gnome-desktop;
inherit glibc libgnomekbd tzdata;
inherit cups networkmanagerapplet;
})
];

@JohnAZoidberg
Copy link
Member Author

Thanks! Now it's using that.

@worldofpeace
Copy link
Contributor

worldofpeace commented Apr 28, 2019

Things done in the force push

Copy link
Contributor

@worldofpeace worldofpeace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think it's ready for merge 👍

@worldofpeace worldofpeace dismissed jtojnar’s stale review April 28, 2019 18:21

Appears resolved by author from my discernment

@ofborg ofborg bot added the 6.topic: pantheon The Pantheon desktop environment label Apr 28, 2019
@worldofpeace
Copy link
Contributor

Thank you @JohnAZoidberg for your contribution and being so quick to respond to changes ✨

@ofborg ofborg bot requested a review from worldofpeace April 28, 2019 18:33
@JohnAZoidberg
Copy link
Member Author

Thanks for your thorough review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants