Unable to use op Outside a Terminal
Hello,
I'm wondering if it's possible to op
outside a terminal, e.g. when started by an application launcher. The following script illustrates my use case:
op items list > ~/out 2>&1
When I run this inside a terminal it works and saves the output inside the given file. However, if I start op
with an application launcher, e.g. rofi (tried with others as well), the following output is saved in the file:
[ERROR] 2023/08/22 22:10:37 connecting to desktop app: connection reset, make sure the CLI is correctly installed and Connect with 1Password CLI is enabled in the 1Password app
and the logs at this point say:
INFO 2023-08-22T19:10:37.211 tokio-runtime-worker(ThreadId(8)) [1P:native-messaging/op-native-core-integration/src/lib.rs:407] Extension connecting. INFO 2023-08-22T19:10:37.211 tokio-runtime-worker(ThreadId(8)) [1P:native-messaging/op-native-core-integration/src/lib.rs:409] Extension connection accepted. ERROR 2023-08-22T19:10:37.211 tokio-runtime-worker(ThreadId(8)) [1P:native-messaging/op-native-core-integration/src/connection_handler.rs:98] failed to update client info: InvalidClientInfo ERROR 2023-08-22T19:10:37.211 tokio-runtime-worker(ThreadId(8)) [1P:native-messaging/op-native-core-integration/src/connection_handler.rs:31] Dropping connection with b5x due to error handling incoming message: InvalidClientInfo
So I'm wondering if this means that running op
is only possible within a window deemed as application window by the OS, i.e. for Linux only active X/Wayland windows. If that's the case, are there any workarounds or running op
from a terminal is the only supported use case?
Thank you.
P.S.: I've seen some posts with the same error message but in the ones I've checked it seemed that the user was running the command inside a terminal, which works for me. I'm also using a recent enough version so I won't be affected by the previous restriction of the executable/script running op
having to be owned by the root user.
1Password Version: 8.10.12
Extension Version: Not Provided
OS Version: Ubuntu 23.04 Xorg
Browser: Not Provided
Comments
-
Try adding the following line at the beginning of your script:
#!/bin/bash
0