Giter Club home page Giter Club logo

wl-clipboard-x11's People

Contributors

1ace avatar brunelli avatar cameronnemo avatar cedws avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

wl-clipboard-x11's Issues

-selection CLIPBOARD

This command doesn't work, although it works in xclip. Can you fix this, please?

Add support for dual X11/Wayland

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.

  1. Change PREFIX to /usr/local
  2. In 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.)

Implementation status

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

  • -o, --output
    write the selection to standard output.

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

AUR is broken

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

wl-clipboard requires any file name to be piped in

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

Accept abbreviated options

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.

Causing Sway to reload

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.