atlas-engineer / nyxt

Nyxt - the hacker's browser.
https://nyxt-browser.com/
9.8k stars 409 forks source link

copy-to-clipboard failing to find existing external utilities #3419

Closed xelxebar closed 3 months ago

xelxebar commented 3 months ago

Describe the bug

The various copy- family commands fail, displaying the following error in the message area:

Warning: Error on separate thread: None of the commands are installed: ("/gnu/store/nqjk5zd1r9p7cm9b2yvn26w5ppbhjlbk-wl-clipboard-2.2.1/bin/wl-copy" "xclip" "/gnu/store/fl49cx8q68ic08b71ysj37shqgq5d5rq-xsel-1.2.0-1.062e6d3/bin/xsel")

Note that the referenced abosulute paths do exist in my store, and xclip is installed in my user profile. Also, ctrl-c and ctrl-v work as expected in text fields.

Information

$ cat /etc/os-release
NAME="Guix System"
ID=guix
PRETTY_NAME="Guix System"
LOGO=guix-icon
HOME_URL="https://guix.gnu.org"
DOCUMENTATION_URL="https://guix.gnu.org/en/manual"
SUPPORT_URL="https://guix.gnu.org/en/help"
BUG_REPORT_URL="https://lists.gnu.org/mailman/listinfo/bug-guix"

$ guix describe
Generation 73    6月 20 2024 00:07:36    (current)
...
  guix c551e40
    repository URL: https://git.savannah.gnu.org/git/guix.git
    branch: master
    commit: c551e406a75273583ae3fef92f32468f905cc07f

$ nyxt --system-information

Nyxt version: 3.11.7
Renderer: GI-GTK
Operating system kernel: Linux 6.9.3
Lisp implementation: SBCL 2.4.0 (Dynamic space size: 3221225472)
Features: (:NYXT-GI-GTK :NYXT-GTK :NYXT-3.11 :NYXT-3 :NYXT-3.11.7
 :CLIPBOARD-CONTENT-METHOD :SWANK :SLYNK :PLUMP-UTF-32 :PARENSCRIPT :NSYMBOLS
 :FSET-EXT-STRINGS :NAMED-READTABLES :CL-FAD :LPARALLEL :21BIT-CHARS
 :CUSTOM-HASH-TABLE-NATIVE :CL-PPCRE-UNICODE :CL-UNICODE :CHUNGA :FLEXI-STREAMS
 :CL-PPCRE :WEBKIT2 :WEBKIT-2.42.5 :WEBKIT-2.42 :WEBKIT-2
 :WEBKIT2-CORS-ALLOWLIST :WEBKIT2-PASTE-PLAINTEXT :WEBKIT2-TRACKING
 :WEBKIT2-MUTE :WEBKIT2-EMOJI :WEBKIT2-MEDIA :WEBKIT2-SANDBOXING :GTK-3-22
 :GTK-3-20 :GTK-3-18 :GTK-3-16 :GTK-3-14 :GTK-3-12 :GTK-3-10 :GTK-3-8 :GTK-3-6
 :GTK-3-4 :GTK :GDK-3-22 :GDK-3-20 :GDK-3-18 :GDK-3-16 :GDK-3-14 :GDK-3-12
 :GDK-3-10 :GDK-3-8 :GDK-3-6 :GDK-3-4 :CAIRO-1-10 :CAIRO-1-12 :GDK-PIXBUF
 :CLOSER-MOP :GLIB-2-30 :GLIB-2-32 :GLIB-2-34 :GLIB-2-36 :GLIB-2-38 :GLIB-2-40
 :GLIB-2-42 :GLIB-2-44 :GLIB-2-46 :GLIB-2-48 :GLIB-2-50 :GLIB-2-52 :GLIB-2-54
 :GLIB-2-56 :GLIB-2-58 :GLIB :BORDEAUX-THREADS :GLOBAL-VARS
 :ASDF-SYSTEM-CONNECTIONS :LPARALLEL.WITH-CLTL2 :LPARALLEL.WITH-CAS
 :LPARALLEL.WITH-STEALING-SCHEDULER :SPLIT-SEQUENCE
 CFFI-FEATURES:FLAT-NAMESPACE CFFI-FEATURES:X86-64 CFFI-FEATURES:UNIX :CFFI
 CFFI-SYS::FLAT-NAMESPACE ALEXANDRIA::SEQUENCE-EMPTYP :FAST-IO-SV :FAST-IO
 :CL-JSON-CLOS :CL-JSON :SBCL-USES-SB-ROTATE-BYTE CHIPZ-SYSTEM:GRAY-STREAMS
 :THREAD-SUPPORT :ASDF3.3 :ASDF3.2 :ASDF3.1 :ASDF3 :ASDF2 :ASDF :OS-UNIX
 :NON-BASE-CHARS-EXIST-P :ASDF-UNICODE :ARENA-ALLOCATOR :X86-64 :GENCGC :64-BIT
 :ANSI-CL :COMMON-LISP :ELF :IEEE-FLOATING-POINT :LINUX :LITTLE-ENDIAN
 :PACKAGE-LOCAL-NICKNAMES :SB-CORE-COMPRESSION :SB-LDB :SB-PACKAGE-LOCKS
 :SB-THREAD :SB-UNICODE :SBCL :UNIX)

ASDF version: 3.3.5
ASDF registries: (NYXT-SOURCE-REGISTRY ENVIRONMENT-SOURCE-REGISTRY USER-SOURCE-REGISTRY
                      USER-SOURCE-REGISTRY-DIRECTORY
                      DEFAULT-USER-SOURCE-REGISTRY SYSTEM-SOURCE-REGISTRY
                      SYSTEM-SOURCE-REGISTRY-DIRECTORY
                      DEFAULT-SYSTEM-SOURCE-REGISTRY)
Critical dependencies: (/gnu/store/yczksmlhwsg8cg0hkvwpkvsksfhfys50-sbcl-cl-cffi-gtk-3.8.8-3.1700fe6/share/common-lisp/sbcl/cl-cffi-gtk/gtk/cl-cffi-gtk.asd
 /gnu/store/bpwi2b0za1idv6fzfxficgyics26q09q-cl-gobject-introspection-0.3-3.83beec4/share/common-lisp/source/cl-gobject-introspection/cl-gobject-introspection.asd
 /gnu/store/lvr278gd5fcvlyijyf2jfy32ws5whqd4-sbcl-cl-webkit-3.5.10/share/common-lisp/sbcl/cl-webkit/webkit2/cl-webkit2.asd)

Guix version: 
aadcg commented 3 months ago

@xelxebar thanks for reporting.

I can't reproduce. What's the output of nyxt --quit --eval "trivial-clipboard::(find-copy-command)"?

Note that Guix packages sbcl-trivial-clipboard with xsel, not xclip. That means that you don't need to have either of these in your profile.

Update:

I'm almost sure env var XDG_SESSION_TYPE isn't set and that's why it can't find the clipboard commands. If you set it to x11 or wayland, then it should work. XDG_SESSION_TYPE=x11 nyxt --quit --eval "trivial-clipboard::(find-copy-command)".

I've sent a patch so that the clipboard commands are always found on X11.

xelxebar commented 3 months ago

I'm almost sure you didn't set env var XDG_SESSION_TYPE

Dang. You're friggin' on point. That did the trick. I wasn't even aware of that particular XDG_* variable. Thank you for investigating this and even bumping the trivial-clipboard commit.