Forum Discussion
1Password Shortcuts on Wayland
1Password is an application that works very well when users can invoke it from anywhere. Quick Access in particular is a feature that is meant to be invoked from anywhere on your desktop. However, as many of you know, the Wayland developers made a deliberate choice to not allow applications to set global shortcuts. To my knowledge, all Wayland implementations have continued to honor this choice. The reasoning is valid, though: global shortcuts make keyloggers trivial.
1Password can run as a native Wayland application, and defaults to XWayland. This, however, does not help since the primary desktop environment is itself Wayland.
For a variety of reasons, we have provided command line options for several of the most useful 1Password commands. In this article, I'll describe how to use those options to set up global shortcuts for 1Password with both Gnome Shell and Sway. It is, fortunately, very easy.
Gnome Shell
For this example, I'm running Gnome Shell 40.4.0, Wayland mode, on Fedora Core 34.
Start by finding Keyboard > Customize Shortcuts
in your Settings application.
Next, select Customize Shortcuts
Your list of custom shortcuts may start empty, but you will want to get to something like this:
Press the +
button at the bottom to create a new shortcut, and you'll get a screen like this:
As you create each shortcut, name each one in a way that makes sense to you. In the Command
field, you will write a trivial script that invokes 1Password with the option that you want. Once you have created that invocation, set the keyboard shortcut as you desire. I recommend multiple key bindings that all work together. The following is the 1Password defaults set on other platforms, and on XOrg-based displays.
Name | Command | Shortcut |
---|---|---|
Open or Toggle 1Password | 1password --toggle | Ctrl + p |
Lock 1Password | 1password --lock | Ctrl + Shift + L |
Open Quick Access | 1password --quick-access | Ctrl + Shift + Space |
note: there is no default for Open or Toggle 1Password, so I made something up.
Sway
Sway does not have a GUI configurator, but instead does everything in the configuration file at ~/.config/sway/config
. Fortunately, this is very easy to set up:
bindsym Ctrl+Shift+l 1password --lock
byndsym Ctrl+Shift+space exec 1password --quick-access
KDE Plasma
coming soon
15 Replies
- roy_orbisonOccasional Contributor
I guess KDE wasn't coming soon. My normal defined shortcuts broke completely in a recent version of 1Pass, and editing them has been removed from its settings dialogue. Editing the ~/.config/1Password/settings/settings.json file did not work, either.
These extra actions should be defined in the .desktop file. Then the shortcuts can be configured in the system settings. To correct this, I edited the shortcut from the Edit Applications tool, just changed the name a bit and saved it, which creates a local copy at ~/.local/share/applications/1password.desktop I edited that file, changing the name back, then adding this at the top:
[Desktop Action Lock] Exec=/opt/1Password/1password --quick-access Name=Lock [Desktop Action QuickAccess] Exec=/opt/1Password/1password --quick-access Name=Quick Access
and adding the line
Actions=Lock;QuickAccess;
Under the main
[Desktop Entry]
section. You may need to change the path to the main binary in those actions to match the Exec line from the main entry. The app can now be added under Settings > Keyboard > Shortcuts. If it's already there, you may need to remove it and add it again so the extra actions are recognised.
- Former Member
Echoing support for this issue. I have to use a 1.5x scaling factor in Wayland, and XWayland apps don't work well with that -- the text is very fuzzy! Running electron apps in Wayland solves the blurry text issue.
Interestingly, 1Password does render pretty well for me in Wayland using v8.7.0 (on Fedora 36 with Sway). I just copied the
1password.desktop
file from/usr/share/applications
to~/.local/share/applications
, and set the Exec line toExec=/opt/1Password/1password --enable-features=UseOzonePlatform --ozone-platform=wayland %U
. With this change, both the main 1Password window and the quick access menu both render at high DPI without fuzzy text.I've not experienced any crashes yet, though I do have a few issues:
1. When opening a new 1Password window on a workspace with a window open, there is a large empty area at the top -- about 200px? This doesn't happen on a blank workspace, where 1Password can fill the screen, just on a workspace where it's split to only part of the screen. Setting it to float also avoids the problem.
2. Quick Access actually renders fine, it's just that the shortcut only works every other time. Ctrl-Shift-Space opens it, Esc closes it, Ctrl-Shift-Space does nothing, but Ctrl-Shift-Space once more opens it. So effectively, the shortcut becomes Ctrl-Shift and then tap space twice. :P
3. Copy/pasting out of the main 1Password app (or quick access) doesn't work at all. At the very least, the values aren't copied to the global clipboard. So if I use the shortcut or click "copy value," nothing gets pasted into other apps like Firefox.Thankfully copy/pasting in the 1Password browser extension works great :)
- Former Member
Yeah, that should be pretty easy, I just need time to put it in. In an ideal world, we could detect it at startup and automatically choose the Wayland renderer, as well. But right now, the Wayland renderer for Electron always crashes on our machines.
- tunixFrequent Contributor
I came here to report that quick access was acting strangely (on Fedora Silverblue 35) and found out about this post. :) Thank you for the clarification.
I believe 1Password (I'm using the flatpak version btw) can detect whether it's working on wayland and direct us to the settings of the DE? (I don't know what that would be for sway -- maybe at least the app can state the fact and save us from visiting the forum?)
- Former Member
@Savanni all right
Let’s hope that it will work soon 🤞🏻 - Former Member
@Goldgamer We ran into trouble (an inexplicable crash) last month with a version of electron that was supposed to have full Wayland support. I had to table things for a bit and haven't had the chance to get back.
- Former Member
Is there any news on bringing Full Wayland support for Linux please?
I would really like to uninstall XWayland since it's working pretty bad with modern hard- software. - jmanesOccasional Contributor
The 1password command does not seem present for me using Flatpak. I changed the keybinding to invoke the following instead:
flatpak run com.onepassword.OnePassword --quick-access
This renders the same result. Thanks for adding this feature!
- Former Member
I'm running 1password 8.4.1 in Fedora 35 with "1password --enable-features=UseOzonePlatform --ozone-platform=wayland"
when first quick access launch fine but second makes 1password app crash with this error:[25769:1206/173556.083974:ERROR:wayland_event_watcher.cc(242)] Fatal Wayland protocol error 0 on interface wl_surface (object 50). Shutting down..
- Former Member
Hi, @JoeVandelay. The current beta added the ability to edit shortcuts in 8.2.2-19, and the ability to clear the shortcuts in 8.2.2-23. Those features did not make it into the latest stable release.