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

Can't assign any keys to shortcuts #1215

Open
MagnusLupus opened this issue Dec 2, 2021 · 29 comments
Open

Can't assign any keys to shortcuts #1215

MagnusLupus opened this issue Dec 2, 2021 · 29 comments
Labels
bug An issue that is confirmed as a bug help wanted An issue that needs contributors

Comments

@MagnusLupus
Copy link

Describe the bug

When I try to assign a shortcut key to any actions (i.e. Clipboard pull) the app says "key combination here is already being used." and selected keys don't get assigned.

Steps To Reproduce:

  1. Go to 'Keyboard Shortcuts'
  2. Click on 'any action'
  3. Pick a key combination
  4. See error

Expected behavior

I expected the application to assign a key combination for an action.

Screenshots

Screenshot from 2021-12-02 12-43-59

Support Log

Please generate a support log (Instructions) and paste any messages related to this issue between the two ``` lines below.


GSConnect: 48 (system)
GJS:       17000
Session:   x11
OS:        Manjaro Linux
--------------------------------------------------------------------------------
-- Journal begins at Wed 2021-12-01 19:59:07 EET, ends at Thu 2021-12-02 12:46:45 EET. --
dets  02 12:46:00 touchegg.desktop[107344]: Error connecting to Touchégg daemon: Could not connect: Connection refused
dets  02 12:46:00 touchegg.desktop[107344]: Reconnecting in 5 seconds...
dets  02 12:46:04 gnome-shell[107022]: Can't update stage views actor <unnamed>[<MetaWindowGroup>:0x55e6e5184350] is on because it needs an allocation.
dets  02 12:46:04 gnome-shell[107022]: Can't update stage views actor <unnamed>[<MetaWindowActorX11>:0x55e6e7092b50] is on because it needs an allocation.
dets  02 12:46:04 gnome-shell[107022]: Can't update stage views actor <unnamed>[<MetaSurfaceActorX11>:0x55e6e7094a20] is on because it needs an allocation.
dets  02 12:46:05 touchegg.desktop[107344]: Error connecting to Touchégg daemon: Could not connect: Connection refused
dets  02 12:46:05 touchegg.desktop[107344]: Reconnecting in 5 seconds...
dets  02 12:46:06 /usr/lib/gdm-x-session[106953]: (EE) client bug: timer event22 debounce short: scheduled expiry is in the past (-12ms), your system is too slow
dets  02 12:46:10 touchegg.desktop[107344]: Error connecting to Touchégg daemon: Could not connect: Connection refused
dets  02 12:46:10 touchegg.desktop[107344]: Reconnecting in 5 seconds...
dets  02 12:46:15 touchegg.desktop[107344]: Error connecting to Touchégg daemon: Could not connect: Connection refused
dets  02 12:46:15 touchegg.desktop[107344]: Reconnecting in 5 seconds...
dets  02 12:46:20 touchegg.desktop[107344]: Error connecting to Touchégg daemon: Could not connect: Connection refused
dets  02 12:46:20 touchegg.desktop[107344]: Reconnecting in 5 seconds...
dets  02 12:46:25 touchegg.desktop[107344]: Error connecting to Touchégg daemon: Could not connect: Connection refused
dets  02 12:46:25 touchegg.desktop[107344]: Reconnecting in 5 seconds...
dets  02 12:46:28 /usr/lib/gdm-x-session[106953]: (EE) client bug: timer event22 debounce short: scheduled expiry is in the past (-11ms), your system is too slow
dets  02 12:46:30 touchegg.desktop[107344]: Error connecting to Touchégg daemon: Could not connect: Connection refused
dets  02 12:46:30 touchegg.desktop[107344]: Reconnecting in 5 seconds...
dets  02 12:46:32 /usr/lib/gdm-x-session[106953]: (EE) client bug: timer event22 debounce: scheduled expiry is in the past (-11ms), your system is too slow
dets  02 12:46:32 /usr/lib/gdm-x-session[106953]: (EE) client bug: timer event22 debounce short: scheduled expiry is in the past (-24ms), your system is too slow
dets  02 12:46:35 touchegg.desktop[107344]: Error connecting to Touchégg daemon: Could not connect: Connection refused
dets  02 12:46:35 touchegg.desktop[107344]: Reconnecting in 5 seconds...
dets  02 12:46:39 gjs[108182]: JS ERROR: Gio.DBusError: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: GrabAccelerator is not allowed
                               checkAccelerator/action</<@/usr/share/gnome-shell/extensions/[email protected]/preferences/keybindings.js:226:42
                               @/usr/share/gnome-shell/extensions/[email protected]/gsconnect-preferences:114:21
dets  02 12:46:39 gjs[108182]: gtk_widget_event: assertion 'WIDGET_REALIZED_FOR_EVENT (widget, event)' failed
dets  02 12:46:39 gjs[108182]: gtk_widget_event: assertion 'WIDGET_REALIZED_FOR_EVENT (widget, event)' failed
dets  02 12:46:39 gjs[108182]: gtk_widget_event: assertion 'WIDGET_REALIZED_FOR_EVENT (widget, event)' failed
dets  02 12:46:39 gjs[108182]: gtk_widget_event: assertion 'WIDGET_REALIZED_FOR_EVENT (widget, event)' failed
dets  02 12:46:40 touchegg.desktop[107344]: Error connecting to Touchégg daemon: Could not connect: Connection refused
dets  02 12:46:40 touchegg.desktop[107344]: Reconnecting in 5 seconds...
dets  02 12:46:45 touchegg.desktop[107344]: Error connecting to Touchégg daemon: Could not connect: Connection refused
dets  02 12:46:45 touchegg.desktop[107344]: Reconnecting in 5 seconds...

System Details (please complete the following information):

  • GSConnect version: 48
    • Installed from: Pamac package manager (official repository)
  • GNOME/Shell version: 41.1
  • Distro/Release: Manjaro Linux

GSConnect environment (if applicable):

  • Paired Device(s): Galaxy Note 9
  • KDE Connect app version: 1.18.0
  • Plugin(s): [if the issue only occurs when using certain plugin(s)]

Additional Notes:

I made sure that the key combination I tried wasn't used by anything else. In addition to that, I tried something bizzare like Ctrl+Shift+Super+Alt+C and it still complained about it being used. I saw similar issue reported back in 2019 and it was supposedly fixed here de44f41

@andyholmes andyholmes added bug An issue that is confirmed as a bug help wanted An issue that needs contributors labels Dec 2, 2021
@andyholmes
Copy link
Collaborator

Thanks for reporting with thorough logs!

This is probably caused by GNOME Shell locking down external access to its DBus interface. There's probably not a good way to work around this, other than to export another DBus interface from the Shell extension and restrict access to the org.gnome.Shell.Extensions.GSconnect.Preferences name-owner, similar to what is done for the clipboard proxy we export.

@MagnusLupus
Copy link
Author

Thanks for replying! Can I provide any other useful information? I am not a programmer though, so my knowledge here is limited.

@andyholmes
Copy link
Collaborator

Thanks for replying! Can I provide any other useful information?

Nope, your report describes the problem perfectly! This is just new change in GNOME Shell that will have to be worked around.

@axelsimon
Copy link

Sorry to be that person, but any progress on this?
As far as i know, clipboard pull and push are impossible to use, right now, because there is no way to assign them a keyboard shortcut.

Also, for what it's worth, i'd set up the shortcuts on my previous laptop, probably around Fedora 32, and the shortcuts were working fine update after update, up to Fedora 35. On this new laptop's fresh install of F35, shortcuts can't be set up, as described in this issue. So it seems that if one could set up the right config, somewhere in GNOME, it could still work.

@andyholmes
Copy link
Collaborator

There's been no progress. GSConnect is effectively a community-driven project now, so this will probably rely on someone coming forward to contribute a fix.

@PrajwalS1234
Copy link

I think if we know the command associated with these operations we can easily create our own shortcuts, is there a way to get the commands which are associated with these operations?

@andyholmes
Copy link
Collaborator

andyholmes commented Jun 22, 2022

Not really without peeking through the source code. The available actions are just all the GActions that don't take parameters, if I remember right. If you want to just ignore the check, you can change this line:

const available = await checkAccelerator(this.accelerator);

to

const available = true;

I make no guarantees you won't shoot yourself in the foot, though.

@axelsimon
Copy link

axelsimon commented Sep 15, 2022

Thanks a lot for the pointer, disabling that check in ~/.local/share/gnome-shell/extensions/[email protected]/preferences/keybindings.js works too.

But weirdly, disabling the check i was able to set clipboard push / paste and clipboard pull / copy shortcuts up, but only the paste one works. 🤔

@AdamPS
Copy link

AdamPS commented Jan 14, 2023

Great thanks, the workaround in keybindings.js works well for me. You only need it in place to set the keys - you can use existing keys without needing the workaround.

@AdamPS
Copy link

AdamPS commented Mar 25, 2023

Gradually more and more users will be running on GNOME versions where this bug exists - so the keyboard shortcuts are confusingly not useable.

Please would you at least consider a workaround something like this? Check if the GNOME shell version is >= the one where this problem was introduced. If so, disable the check for keys already existing.

@andyholmes
Copy link
Collaborator

GSConnect is a community-driven project now, so if you want something changed or added you need open a pull request with those changes. The maintainers are really only here to act as custodians for the project.

@AdamPS
Copy link

AdamPS commented Mar 26, 2023

Sure I understand. Do you think it's a good idea, would you accept such a pull request?

@andyholmes
Copy link
Collaborator

It's possible to overwrite other keyboard shortcuts if you skip the check. So I would say there should probably just be a label added to the keyboard editor warning about that.

Ideally the whole verification would be rewritten, but they're just keyboard shortcuts 🤷‍♂️. So I'd accept a PR that disabled the check, as long as there's a little label somewhere letting the user know.

@AdamPS
Copy link

AdamPS commented Mar 27, 2023

Great thanks. I don't have Gnome dev knowledge myself, however hopefully someone else might step in - it should be a much simpler fix than the "ideal" one.

@ferdnyc ferdnyc pinned this issue Apr 12, 2023
@ferdnyc
Copy link
Member

ferdnyc commented Apr 12, 2023

Pinning this, as it keeps getting re-reported.

@Nakamerica
Copy link

Hello,

for the time being, is there any way at all to push the computer clipboard to the phone?

@andyholmes
Copy link
Collaborator

You can either enable auto-push in settings, or use the clipboardPush GAction. There is no user documentation in GSConnect for using GActions though.

@gerardbosch
Copy link

You can either enable auto-push in settings, or use the clipboardPush GAction. There is no user documentation in GSConnect for using GActions though.

Hi @andyholmes, do you know if it is possible to run that GAction somehow, straight from command-line or script? We could use external other hotkey apps to push/pull from clipboard. I did a quick Google search and couldn't find anything obvious.

I personally don't like to enable full clipboard sync between laptop and phone, and would like to share it on demand using a shortcut, a button or any manual means.

Thanks!

@gerardbosch
Copy link

gerardbosch commented Aug 31, 2023

💡 Simple Workaround below: Just update the settings in dconf.

Sorry, forgot the above message, I realized that it's much simpler to change the line you pointed here to temporary disable it, assign the shortcut, and revert.

For anyone interested, it's also possible to do it without changing the code, if not wrong, the only you need to do is to use dconf-editor to save the preferences of the shortcut.

Something like this will work for the clipboard push and pull (dconf-editor screenshot):

image

You will find this registry under the following key (or can use the search to look for gsconnect):

/org/gnome/shell/extensions/gsconnect/device/<YOUR INSTANCE ID>/

Neither to say that this is a workaround. I suppose that adding a user warning tag on the window as @andyholmes suggested would be easy for someone that knows Gnome development. Just check the version, bypass the check if necessary and warn the user with a small text.

@andyholmes
Copy link
Collaborator

It doesn't look like clipboard push/pull were ever added to the CLI options, but I'd accept a PR for that if someone's interested.

@gerardbosch
Copy link

Hi @andyholmes, is it possible or easy to add the "Pull clipboard" and "Push clipboard" buttons/options in the menu?

It would be at least a neat way to deal with clipboard without relaying on shortcuts. I found strange that those buttons are not already present, maybe there's a reason. Thanks!

image

@andyholmes
Copy link
Collaborator

Sure, issue #1167 has been looking for a volunteer for a while 🙂 There are a few hints to get someone started on it, I'm sure that code hasn't changed much since then.

@gerardbosch
Copy link

I tried to add it for myself the other day before seeing the #1167 but I couldn't understand how it works (I have no experience in Gnome extensions development).

But I'm wondering if Gnome Shell 45 that will introduce/enforce ESM for extensions will break everything and what will be the cost to adapt it. I recently discovered this extension and I found it terrible useful - wouldn't like it became abandoned. I think Gnome 45 is gonna be rolled out soon for many distros, including Ubuntu.

Here is he issue for any one interested: #1665

@andyholmes
Copy link
Collaborator

GNOME Shell will indeed require all extensions to port to ESModules. Whether GSConnect is/will be abandoned is up to the community, as it has been a community-driven project for the last three years 🤷

@gerardbosch
Copy link

gerardbosch commented Sep 3, 2023

GNOME Shell will indeed require all extensions to port to ESModules. Whether GSConnect is/will be abandoned is up to the community, as it has been a community-driven project for the last three years 🤷

How deep and complex is to port it to ESM? I'm not JS dev 😅.

I have the impression that Gnome plugin system is very fragile as it breaks frequently. Isn't it? Thanks anyway!!

@andyholmes
Copy link
Collaborator

There's a porting guide, if you want to give a shot: Port Extensions to GNOME Shell 45

@nromn
Copy link

nromn commented Oct 7, 2023

💡 Simple Workaround below: Just update the settings in dconf.

Sorry, forgot the above message, I realized that it's much simpler to change the line you pointed here to temporary disable it, assign the shortcut, and revert.

For anyone interested, it's also possible to do it without changing the code, if not wrong, the only you need to do is to use dconf-editor to save the preferences of the shortcut.

Something like this will work for the clipboard push and pull (dconf-editor screenshot):

image

You will find this registry under the following key (or can use the search to look for gsconnect):

/org/gnome/shell/extensions/gsconnect/device/<YOUR INSTANCE ID>/

Neither to say that this is a workaround. I suppose that adding a user warning tag on the window as @andyholmes suggested would be easy for someone that knows Gnome development. Just check the version, bypass the check if necessary and warn the user with a small text.

Any idea on how to use this to set a shortcut for remote input? I tried to use this solution but it doesn't work for this.

@ankit-at-quickreply
Copy link

💡 Simple Workaround below: Just update the settings in dconf.

Sorry, forgot the above message, I realized that it's much simpler to change the line you pointed here to temporary disable it, assign the shortcut, and revert.

For anyone interested, it's also possible to do it without changing the code, if not wrong, the only you need to do is to use dconf-editor to save the preferences of the shortcut.

Something like this will work for the clipboard push and pull (dconf-editor screenshot):

image

You will find this registry under the following key (or can use the search to look for gsconnect):

/org/gnome/shell/extensions/gsconnect/device/<YOUR INSTANCE ID>/

Neither to say that this is a workaround. I suppose that adding a user warning tag on the window as @andyholmes suggested would be easy for someone that knows Gnome development. Just check the version, bypass the check if necessary and warn the user with a small text.

This works for now (I think this is the best workaround), but can't seem to pull the clipboard

@gerardbosch
Copy link

This works for now (I think this is the best workaround), but can't seem to pull the clipboard

I've just checked, and it still works for me. Do you mean that clipboard pull fails, but push works? For me, it works on both directions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue that is confirmed as a bug help wanted An issue that needs contributors
Projects
None yet
Development

No branches or pull requests

10 participants