diff options
author | eoli3n | 2021-01-05 11:38:21 +0100 |
---|---|---|
committer | eoli3n | 2021-01-05 11:38:21 +0100 |
commit | 0dd74111b1bc1c69bcdbde240cb92936b39a983e (patch) | |
tree | cbf9a19e04cb1b7b441e1178aba2aa57796ca652 | |
parent | 424353078085841af4ce9ecc54dfa5831fe1e533 (diff) | |
download | aur-0dd74111b1bc1c69bcdbde240cb92936b39a983e.tar.gz |
autocopy disable by default, fix xclip
-rw-r--r-- | .SRCINFO | 4 | ||||
-rw-r--r-- | PKGBUILD | 4 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rwxr-xr-x | up | 25 |
4 files changed, 21 insertions, 14 deletions
@@ -1,6 +1,6 @@ pkgbase = upaste pkgdesc = Paste and upload files on x0.at - pkgver = 0.1.2 + pkgver = 0.1.3 pkgrel = 1 url = https://github.com/eoli3n/upaste arch = any @@ -10,7 +10,7 @@ pkgbase = upaste optdepends = xclip: Command line interface to the X11 clipboard source = up source = UNLICENSE - sha256sums = 4775536bcc695a19e1559fbed27479a309d062cae8f1cd3fd125fb8ed1eec012 + sha256sums = ed78a5f4a4c0f78be67c71c725f842aff57b68e77f60e24ba51e6131e513c765 sha256sums = 6b0382b16279f26ff69014300541967a356a666eb0b91b422f6862f6b7dad17e pkgname = upaste @@ -1,7 +1,7 @@ # Maintainer: Jonathan Kirszling <jkirsz@gmail.com> pkgname=upaste pkgrel=1 -pkgver=0.1.2 +pkgver=0.1.3 pkgdesc="Paste and upload files on x0.at" arch=('any') url="https://github.com/eoli3n/$pkgname" @@ -11,7 +11,7 @@ optdepends=('wl-clipboard: Command-line copy/paste utilities for Wayland', depends=('curl') source=("up" "UNLICENSE") -sha256sums=("4775536bcc695a19e1559fbed27479a309d062cae8f1cd3fd125fb8ed1eec012" +sha256sums=("ed78a5f4a4c0f78be67c71c725f842aff57b68e77f60e24ba51e6131e513c765" "6b0382b16279f26ff69014300541967a356a666eb0b91b422f6862f6b7dad17e") package() { diff --git a/README.md b/README.md index e8d3e0e11882..13aa10f1d368 100644 --- a/README.md +++ b/README.md @@ -19,5 +19,5 @@ C-d C-d ``` Options : -h Print this usage - -a Disable autocopy in clipboard + -a Enable autocopy in clipboard -t Set extension, without dot @@ -4,7 +4,7 @@ # Vars -autocopy=1 +autocopy=0 # Functions @@ -29,7 +29,7 @@ C-d C-d Options : -h Print this usage - -a Disable autocopy in clipboard + -a Enable autocopy in clipboard -t Set extension, without dot EOF } @@ -68,14 +68,21 @@ autocopy () { # If xorg or wayland is running if [ -n "$DISPLAY" ] then - # If xclip is installed - if which xclip >/dev/null 2>&1 + if [ "$XDG_SESSION_TYPE" = "x11" ] then - xclip "$1" - # Else if wl-clipboard is installed - elif which wl-copy >/dev/null 2>&1 + # If xclip is installed + if which xclip >/dev/null 2>&1 + then + echo "$1" | xclip + fi + fi + if [ "$XDG_SESSION_TYPE" = "wayland" ] then - wl-copy -p "$1" + # Else if wl-clipboard is installed + if which wl-copy >/dev/null 2>&1 + then + wl-copy -p "$1" + fi fi fi } @@ -139,7 +146,7 @@ while getopts "hat:" arg do case $arg in a) - autocopy=0 + autocopy=1 ;; h) usage |