summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaumit Dinesan <justsaumit@protonmail.com>2022-03-30 22:44:27 +0530
committerSaumit Dinesan <justsaumit@protonmail.com>2022-03-30 22:44:27 +0530
commitd66b219ef401962f36f2242823e9686966c003e5 (patch)
treeb94b825646ea980a401ccf363ec9fc7aae3b1ece
parentd3c6b05361cb177e2da1c5961aa82e1da42eb412 (diff)
using qrscan as a binary rather than alias
-rw-r--r--.config/shell/aliasrc1
-rwxr-xr-x.local/bin/passmenu16
-rwxr-xr-x.local/bin/qrscan9
3 files changed, 16 insertions, 10 deletions
diff --git a/.config/shell/aliasrc b/.config/shell/aliasrc
index 9cf11e2..84b2ca8 100644
--- a/.config/shell/aliasrc
+++ b/.config/shell/aliasrc
@@ -38,7 +38,6 @@ alias \
sha="shasum -a 256" \
untar="tar -zxvf" \
untar2="tar xvf" \
- qrscan="xargs -I {} zbarimg -q {} | cut -b 1-8 --complement | xclip -sel c" \
cp="cp -iv" \
mv="mv -iv" \
mkd="mkdir -pv" #make a parent and sub directory
diff --git a/.local/bin/passmenu b/.local/bin/passmenu
index b2f41cb..385cf42 100755
--- a/.local/bin/passmenu
+++ b/.local/bin/passmenu
@@ -1,13 +1,11 @@
-#!/bin/sh
-
#!/usr/bin/env bash
shopt -s nullglob globstar
typeit=0
if [[ $1 == "--type" ]]; then
- typeit=1
- shift
+ typeit=1
+ shift
fi
prefix=${PASSWORD_STORE_DIR-~/.password-store}
@@ -21,12 +19,12 @@ password=$(printf '%s\n' "${password_files[@]}" | dmenu "$@")
pass_cmd=show
if pass show "$password" | grep -q '^otpauth://'; then
- pass_cmd=otp
+ pass_cmd=otp
fi
if [[ $typeit -eq 0 ]]; then
- pass $pass_cmd -c "$password" 2>/dev/null
- else
- pass $pass_cmd "$password" | { IFS= read -r pass; printf %s "$pass"; } |
- xdotool type --clearmodifiers --file -
+ pass $pass_cmd -c "$password" 2>/dev/null
+else
+ pass $pass_cmd "$password" | { IFS= read -r pass; printf %s "$pass"; } |
+ xdotool type --clearmodifiers --file -
fi
diff --git a/.local/bin/qrscan b/.local/bin/qrscan
new file mode 100755
index 0000000..dcd3983
--- /dev/null
+++ b/.local/bin/qrscan
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+if [ -z "$1" ]; then
+ echo "Enter a valid image with QR code"
+else
+ Link=$(zbarimg -q $1 | cut -b 1-8 --complement) &&
+ echo $Link | xclip -sel c
+ notify-send "QR Link copied to clipboard" "$Link"
+fi