Open alexherbo2 opened 4 years ago
Yep, it sounds good. I use a similar approach for a plumb
script. It uses the CLIPBOARD_COPY
and CLIPBOARD_PASTE
command implementation, with defaults (for Wayland, X11, macOS) if they are not set.
So I implemented this in 5f05120, but I haven't put the xclip
into the config file yet because I don't know better.
@alexherbo2 would you be able to point me in the right direction for some other default clipboard tools for other systems? I've always just used Xorg and xclip, but I do use sway quite a bit in another TTY
so I should probably get this working,
System | tool |
---|---|
X11 | xclip |
Wayland | ?? |
MacOS | ?? |
WSL | ?? |
BSD | ?? |
Also does anybody know if it safe to use $XDG_SESSION_TYPE
inside the config script to automatically set the users clipboard?
Mac
pbcopy
pbopen
Wayland
wl-open
wl-paste
BSD is just Xclip
Try also something like this :
#!/bin/sh
case "$(uname -s)" in
Darwin)
echo 'Mac OS X'
;;
Linux)
echo 'Linux'
;;
CYGWIN*|MINGW32*|MSYS*|MINGW*)
echo 'MS Windows'
;;
So as of d3b53df the cadmus script should now use commands for the clipboard based on the kernel name using uname -s
, this issue however, should stay open until #12 is closed because any subscript other than find and search doesn't follow the stdin/stdout philosophy and hence this logic will not be applied.
can somebody on macOS confirm that cadmus convert org2md
actually transforms the clipboard?
Now all the subscripts either take STDIN or STDOUT (or checks itself in the case of fix) and cadmus tests the OS for the appropriate clipboard command.
Any scripts underneath bin/tags or bin/tools needs to be re-written, I just copy pasted them in from where they were, they're all half-assed, but that's tracked in #12
@alexherbo2 Could you review the changes I made and if they address the issue could you please close it?
@RyanGreenup Sure.
CLIPBOARD_COPY
and CLIPBOARD_PASTE
naming. CLIP_IN
and CLIP_OUT
naming sounds very specific to xclip
.plumb
script I mentioned for detecting the user environment and setting the clipboard variables.xclip
copying both primary and clipboard selections (xclip -filter | xclip -selection clipboard
).
Yeah sure thing, can you be more specific, do you mean something to specify the command so that the script doesn't rely specifically on
xclip
? so something like this:I recently refactored the code so it uses a
config.json
, so this could probably go into there, what do you think?