diff options
author | Thore Bödecker <me@foxxx0.de> | 2022-06-26 11:21:59 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2022-06-26 11:41:32 +0200 |
commit | 836240e023df6ea5680c52cc2e59f7c86e79f3ad (patch) | |
tree | dce34d22e37d3eee8754a8511fe04bfb6cd57953 | |
parent | 75da052b8093ea96f68702a1e7cbf628d8d8869b (diff) |
add wl-clipboard support for waylandv2.2.0
-rw-r--r-- | PKGBUILD | 5 | ||||
-rw-r--r-- | fb.1 | 19 | ||||
-rwxr-xr-x | fb.py | 2 |
3 files changed, 20 insertions, 6 deletions
@@ -8,7 +8,10 @@ arch=("any") url="https://paste.xinu.at" license=('GPL3') depends=('python' 'python-pycurl' 'python-xdg') -optdepends=('xclip: for automatically copying the URL into the clipboard') +optdepends=( + 'xclip: automatically copy the URL into the clipboard on X11' + 'wl-clipboard: automatically copy the URL into the clipboard on wayland' +) source=("git+https://git.server-speed.net/users/flo/fb#branch=dev") md5sums=('SKIP') validpgpkeys=("CFA6AF15E5C74149FC1D8C086D1655C14CE1C13E") @@ -38,13 +38,22 @@ If the file being uploaded is bigger than 10MiB .Nm will query the server for the maximum upload size and abort the upload if the file would be rejected. +.Pp Before terminating, .Nm -will try to copy all links into the X clipboard if -.Xr xclip 1 -or on Darwin -.Xr pbcopy -is installed. +will try to copy all links into the clipboard. Depending on the environment from +which +.Nm +was executed. +If you want this to work, you need to install the correct tool for your environment: +.Bl -tag -width "wl-clipboard(1)" -offset indent +.It Xr xclip 1 +when running on X11 +.It Xr wl-clipboard 1 +when running on wayland +.It Xr pbcopy 1 +when running on Mac OS / Darwin +.El .Pp If you want to use paste.xinu.at, you need to create an account there and then run .Sq Nm Fl a @@ -401,6 +401,8 @@ class ConfigParser: self.config["clipboard_cmd"] = "xclip" if os.uname()[0] == "Darwin": self.config["clipboard_cmd"] = "pbcopy" + elif os.environ.get('XDG_SESSION_TYPE') == 'wayland': + self.config["clipboard_cmd"] = "wl-copy" self.config["apikey_file"] = os.path.join(xdg.BaseDirectory.xdg_config_home, "fb-client/apikey") self._parse(file, ignoreMissing=ignoreMissing) |