Open mickenorlen opened 2 years ago
QHotkey doesn't work on Wayland, see https://github.com/Skycoder42/QHotkey/issues/14.
Ok thanks for info and a great application. I guess wayland needs more time.
Thank you ;)
@mickenorlen I ran into this same issue and was able to solve it by binding a global hotkey to the command-line interface. For KDE that involves going to Settings > Keyboard > Shortcuts and creating a global shortcut for the command QOwnNotes --action actionShow_Hide_application
. There should be a similar interface in GNOME and other desktop environments.
So far this works well, but to make it easier / more discoverable for users I wonder if it might be possible to register "Show/Hide application" as one of the global shortcuts available for the program in the system menu?
Right now there are three such global actions associated with QOwnNotes in KDE Settings: New note
(opens a new note), QOwnNotes
(opens the application itself), and Show todo list
(shows a todo list if available). See screenshot below to see what this looks like:
@pbek Are these shortcuts registered from within QOwnNotes, and if so could Show/Hide application be added to make it easier to restore this very useful functionality?
Hah, looks like KDE Plasma finds the actions registered in the tray icon.
Btw. I spent over a week trying to make KDE Plasma 6 work with Wayland on all my systems with Nvidia graphic card. Hopeless... But at least I fixed https://github.com/pbek/QOwnNotes/issues/2976 while I was at it.
@dohliam, what does the QOwnNotes:
shortcut do? Maybe it already does show/hide.
@dohliam, what does the QOwnNotes: shortcut do? Maybe it already does show/hide.
Nah, just tries to run QOwnNotes again...
@dohliam, what does the QOwnNotes: shortcut do? Maybe it already does show/hide.
Yes, that was the first thing I tried! But as you discovered, it only opens the application.
Hah, looks like KDE Plasma finds the actions registered in the tray icon.
Thanks for the pointer -- it makes more sense now why these actions would be included and not others. Does this mean that all we would need to do to get Show/Hide as a globally-available action is to add a corresponding entry to this file for actionShow_Hide_application
and the KDE shortcuts interface should then be able to pick it up automatically?
If so, I would be happy to submit a PR for this.
Hah, the Desktop file, good find! Yes, sure, you can create a PR for adding the show/hide! Thank you.
Although it will do the same as all the other desktop actions do, run QOwnNotes again with the parameter. So an attempt will be made to open a 2nd instance, like the QOwnNotes:
shortcut.
When the "single instance" mode is activated in QOwnNotes the current instance will get focus regardless of the action...
Although it will do the same as all the other desktop actions do, run QOwnNotes again with the parameter. So an attempt will be made to open a 2nd instance, like the
QOwnNotes:
shortcut.
Yes, but the important thing is that it also hides the application if it is already in focus, so it acts as a toggle, which the QOwnNotes
shortcut does not.
When the "single instance" mode is activated in QOwnNotes the current instance will get focus regardless of the action...
Well, that explains why this seems to work so far, since I have that option checked in settings. (Is this the default?)
It does raise an interesting question though regarding what the expected behaviour for the Show/Hide action would be when multiple instances are allowed. Only Show/hide the most recent instance? That seems like it might be complicated -- as a result I would only expect this to work with single-instance mode, whether on X or Wayland (or elsewhere).
A desktop action will always run the command, which would spawn another process, won't it?
Expected behaviour
Global keyboard shortcuts work
Actual behaviour
Global keyboard shortcuts have no effect
Steps to reproduce
Set global keyboard shortcut for example to show/hide application.
Information about the application, settings and environment
Expand
QOwnNotes Debug Information =========================== ## General Info **Current Date**: `tis feb. 15 20:03:50 2022` **Version**: `22.2.2` **Build date**: `Feb 8 2022` **Build number**: `946` **Platform**: `linux` **Operating System**: `Arch Linux` **Build architecture**: `x86_64` **Current architecture**: `x86_64` **Release**: `OBS` **Qt Version (build)**: `5.15.2` **Qt Version (runtime)**: `5.15.2` **Portable mode**: `no` **Settings path / key**: `/home/micke/.config/PBE/QOwnNotes.conf` **Application database path**: `/home/micke/.local/share/PBE/QOwnNotes/QOwnNotes.sqlite` **Application arguments**: `/usr/bin/QOwnNotes` **Qt Debug**: `0` **Locale (system)**: `en_US` **Locale (interface)**: *empty* **Primary screen resolution**: `1280x720` **Icon theme**: `breeze-dark` **Notes in current note folder**: `25` **Calendar items**: `1` **Enabled scripts**: `0` ## Server Info **serverUrl**: `https://cloud.orbcoding.com` **appIsValid**: `yes` **notesPathExists**: `yes` **serverVersion**: `23.0.1.2` **appVersion**: *empty* ## Spellchecking **Enabled**: `false` **Selected language**: `auto` **Language codes**: `en_US, en_US-large, it_CH, it_IT, sv_FI, sv_SE` **Language names**: `American English (United States), American English (United States) [large], italiano (Svizzera), italiano (Italia), svenska (Finland), svenska (Sverige)` **Application dictionaries path**: `/home/micke/.local/share/PBE/QOwnNotes/dicts` ## Note folders **currentNoteFolderId**: `1` ### Note folder `default` **id**: `1` **isCurrent**: `yes` **activeTagId**: `0` **localPath**: `/home/micke/Nextcloud/Notes` **remotePath**: `Notes` **cloudConnectionId**: `1` **isShowSubfolders**: `yes` **isUseGit**: `no` **allowDifferentNoteFileName**: `no` **activeNoteSubFolder name**: `orb` **database file**: `/home/micke/Nextcloud/Notes/notes.sqlite` ## Cloud connections ### Cloud connection `Default` **id**: `1` **isCurrent**: `yes` **serverUrl**: `https://cloud.orbcoding.com` **username**: `mickenorlen` **accountId**: `mickenorlen` ## Enabled scripts ## Settings **ActiveNoteHistoryItem** (NoteHistoryItem): `