qcopy


Logs | Files | LICENSE | GitLab


1
commit 068b5de64b54871abd6326ee7890f17e58614344
2
Author: Connor Etherington <[email protected]>
3
Date:   Tue Mar 14 13:22:17 2023 +0200
4
5
    Auto-Commit Update - 20230314
6
---
7
 PKGBUILD      | 4 ++--
8
 usr/bin/qcopy | 4 ++--
9
 2 files changed, 4 insertions(+), 4 deletions(-)
10
11
diff --git a/PKGBUILD b/PKGBUILD
12
index 1d40d6b..baa1b7d 100644
13
--- a/PKGBUILD
14
+++ b/PKGBUILD
15
@@ -1,13 +1,13 @@
16
 # Maintainer: Connor Etherington <[email protected]>
17
 # ---
18
 pkgname=qcopy
19
-pkgver=1.5
20
+pkgver=2
21
 pkgrel=1
22
 pkgdesc="Easily save important snippets such as passwords for quick access copying at any point"
23
 arch=(any)
24
 url="https://gitlab.com/a4to/${pkgname}"
25
 license=('MIT')
26
-depends=(fzf dialog xsel bat)
27
+depends=(fzf dialog xsel bat xdotool)
28
 install="qcopy.install"
29
 source=(
30
   "https://concise.cc/pkg/${pkgname}-${pkgver}-${pkgrel}-$arch.pkg.tar.zst"
31
diff --git a/usr/bin/qcopy b/usr/bin/qcopy
32
index 675e6fc..6ea80cf 100755
33
--- a/usr/bin/qcopy
34
+++ b/usr/bin/qcopy
35
@@ -32,7 +32,7 @@ PLACEHOLDER(){ awk -F= '{print $1}' ${1:-$ENTRIESFILE}|sed 's/\s*//;/^$/d'|sort
36
 
37
 FIRSTLOOP(){ [ -f $ENTRIESFILE ] && [ $(cat $ENTRIESFILE | wc -w) -ge 1 ] || FIRST ; }
38
 
39
-FIRST(){ dialog --title " ~ First Run ~ " --yesno "$NEWENTRY" 8 82 && NEW && return 0 || clear && exit 1 ; }
40
+FIRST(){ wasFirst=true ; dialog --title " ~ First Run ~ " --yesno "$NEWENTRY" 8 82 && NEW && return 0 || clear && exit 1 ; }
41
 
42
 
43
 function NEW {
44
@@ -109,6 +109,6 @@ FIRSTLOOP && case ${1} in
45
   '-d'|'-r'|'--del'|'--delete'|'--remove') DEL && exit 0 ;;
46
   '-u'|'-p'|'-w'|'--paste'|'--write'|'--use') MAIN && trap "xdotool type --clearmodifiers `xsel -bo`" EXIT ; exit 0 ;;
47
   '-h'|'?'|'--help') echo -e "\n\e[1;32m Usage: \e[0m\n\n  qcopy [OPTION]\n\n\e[1;32m Options: \e[0m\n\n  -a, -n, --add, --new\t\t\tAdd a new entry\n  -d, -r, --del, --delete, --remove\tDelete an entry\n  -u, -p, -w, --paste, --write, --use\tImmediately paste the selected entry\n  -h, ?, --help\t\t\t\tDisplay this help and exit\n" ;;
48
-    *) MAIN && exit 0 ;;
49
+  *) MAIN && [[ -n $wasFirst ]] && dialog --title " ~ First Run ~ " --msgbox "You have successfully created your first entry.\\n\\nNote, that if you want to immediately paste the selected entry, intead of just copying it to the clipboard, you can use the -w option.\\n\\nFor more information, use the -h option." 10 80 && exit 0 || exit 0 ;;
50
 esac
51