brunelli / wl-clipboard-x11 Goto Github PK
View Code? Open in Web Editor NEWA wrapper to use wl-clipboard as a drop-in replacement to X11 clipboard tools
License: GNU General Public License v3.0
A wrapper to use wl-clipboard as a drop-in replacement to X11 clipboard tools
License: GNU General Public License v3.0
This command doesn't work, although it works in xclip. Can you fix this, please?
Sometimes I login with XOrg due to screensharing not working with video chat flatpak app. I propose these changes, or at least documentation on how to do this.
PREFIX
to /usr/local
wl-clipboard-x11
shell script, check XDG_SESSION_TYPE
value. If "x11", forward to the x11 command. Something like:BASENAME="$(basename "$0")"
if [ "$XDG_SESSION_TYPE" = x11 -a "$0" = /usr/local/bin/$BASENAME -a -x /usr/bin/$BASENAME ]; then
exec /usr/bin/$BASENAME "$@"
fi
(edit: bindir changed to prefix. Removed man step. Removed my workaround.)
This is a list of xclip
and xsel
options, as per their man pages.
Lines marked with a โ๏ธ are already translated to wl-clipboard
. The others are either not yet implemented in wl-clipboard
/wl-clipboard-x11
(empty box) or unlikely to ever be supported (crossed out).
This list will be edited as new options are supported.
XCLIP
-i, -in
read text into X selection from standard input or files (default)
-o, -out
print the selection to standard out (generally for piping to a file or program)
-f, -filter
when xclip is invoked in the in mode with output level set to silent (the defaults), the filter option will cause xclip to print the text piped to standard in back to standard out unmodified
-r, -rmlastnl
when the last character of the selection is a newline character, remove it. Newline characters that are not the last character in the selection are not affected. If the selection does not end with a newline character, this option has no effect. This option is useful for copying one-line output of programs like pwd to the clipboard to paste it again into the command prompt without executing the line immediately due to the newline character pwd appends.
-l, -loops (will only loop once)
number of X selection requests (pastes into X applications) to wait for before exiting, with a value of 0 (default) causing xclip to wait for an unlimited number of requests until another application (possibly another invocation of xclip) takes ownership of the selection
-t, -target (TARGETS
not implemented)
specify a particular data format using the given target atom. With -o the special target atom name "TARGETS" can be used to get a list of valid target atoms for this selection. For more information about target atoms refer to ICCCM section 2.6.2
-d, -display
X display to use (e.g. "localhost:0"), xclip defaults to the value in $DISPLAY if this option is omitted
-h, -help
show quick summary of options
-selection
specify which X selection to use, options are "primary" to use XA_PRIMARY (default), "secondary" for XA_SECONDARY or "clipboard" for XA_CLIPBOARD
-version
show version information
-silent
fork into the background to wait for requests, no informational output, errors only (default)
-quiet show informational messages on the terminal and run in the foreground
-verbose
provide a running commentary of what xclip is doing
-noutf8
operate in legacy (i.e. non UTF-8) mode for backwards compatibility (Use this option only when really necessary, as the old behavior was broken)
XSEL
Input options
-a, --append
append standard input to the selection. Implies -i.
-f, --follow
append to selection as standard input grows. Implies -i.
-i, --input
read standard input into the selection.
Output options
Action options
-c, --clear
clear the selection. Overrides all input options.
-d, --delete (currently working the same as --clear
)
Request that the current selection be deleted. This not only clears the selection, but also requests to the program in which the selection resides that the selected contents be deleted. Overrides all input options.
Selection options
-p, --primary
operate on the PRIMARY selection (default).
-s, --secondary
operate on the SECONDARY selection.
-b, --clipboard
operate on the CLIPBOARD selection.
-k, --keep
Do not modify the selections, but make the PRIMARY and SECONDARY selections persist even after the programs they were selected in exit. (Conventionally, the CLIPBOARD selection is persisted by a separate special purpose program such as xclipboard(1)). Ignores all input and output options.
-x, --exchange
exchange the PRIMARY and SECONDARY selections. Ignores all input and output options.
X options
--display displayname
specify the server to use; see X(1).
-t ms, --selectionTimeout ms (using timeout wl-{copy,paste}
)
Specify the timeout in milliseconds within which the selection must be retrieved. In --input mode, the background process exits after this amount of time. A value of 0 (zero) specifies no timeout (default).
Miscellaneous options
-l filename, --logfile filename
Specify the file to log errors to when detached. (Default $HOME/.xsel.log)
-n, --nodetach
Do not detach from the controlling terminal. Without this option, xsel will fork to become a background process in input, exchange and keep modes.
-h, --help
display usage information and exit
-v, --verbose
Print informative messages. Additional instances of -v raise the debugging level, ie. print more information.
--version
output version information and exit
The AUR symlinks xclip
and xsel
to the wrong location:
/home/$USER/.cache/yay/wl-clipboard-x11/pkg/wl-clipboard-x11/usr/share/wl-clipboard-x11/wl-clipboard-x11
instead of /usr/share/wl-clipboard-x11/wl-clipboard-x11
When emulating a command like:
xclip -selection clipboard /tmp/filename
it gets translated to:
wl-copy /tmp/filename
Unfortunately, this means that the clipboard now contains literally the text /tmp/filename
as wl-clipboard expects files to be piped in.
It should translate the command to:
wl-copy < /tmp/filename
As @YaLTeR points out, xclip accepts abbreviated forms of its options as long as they're unambiguous. Here's what the man page says:
Options can be abbreviated as long as they remain unambiguous. For example, it is possible to use
-d
or-disp
instead of-display
. However,-v
couldn't be used because it is ambiguous (it could be short for-verbose
or-version
), so it would be interpreted as a filename.Note that only the first character of the selection specified with the
-selection
option is important. This means that "p
", "sec
" and "clip
" would have the same effect as using "primary
", "secondary
" or "clipboard
" respectively.
For some reason this lib is causing my Sway instance to reload whenever anything is copied. This isn't happening with plain xclip
. How can I go about debugging this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.