summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaumit Dinesan <justsaumit@protonmail.com>2022-03-30 19:57:37 +0530
committerSaumit Dinesan <justsaumit@protonmail.com>2022-03-30 19:57:37 +0530
commitd3c6b05361cb177e2da1c5961aa82e1da42eb412 (patch)
tree52dd3f5fcfcfc5918936e92ebc3bd45f7e1c0561
parent0fca442eeead2bdd99df7f84412db077d8e2c875 (diff)
minor changes + qrscan
-rw-r--r--.config/shell/aliasrc5
-rwxr-xr-x.local/bin/improveqrscan12
2 files changed, 15 insertions, 2 deletions
diff --git a/.config/shell/aliasrc b/.config/shell/aliasrc
index 5d78fbb..9cf11e2 100644
--- a/.config/shell/aliasrc
+++ b/.config/shell/aliasrc
@@ -28,7 +28,7 @@ alias \
g1="git add ." \
g2="git commit -S -m" \
g3="git push origin HEAD --force" \
- gs="git status"
+ gs="git status" \
glg="git log --graph --abbrev-commit --decorate --format=format:'%C(bold green)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold yellow)(%ar)%C(reset)%C(auto)%d%C(reset)%n''%C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all"
#useful command line substitutions
@@ -38,6 +38,7 @@ 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
@@ -57,7 +58,7 @@ alias \
st="cd .local/src/st" \
dwm="cd .local/src/dwm" \
dwmblocks="cd .local/src/dwmblocks" \
- calc="quich"
+ calc="quich" \
rm="trash" \
listdel="trash-list" \
restore="trash-restore" \
diff --git a/.local/bin/improveqrscan b/.local/bin/improveqrscan
new file mode 100755
index 0000000..9e84d6b
--- /dev/null
+++ b/.local/bin/improveqrscan
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+if [ -z "$1" ]; then
+ echo "Enter a valid image with QR code"
+else
+ zbarimg -q $1 | cut -b 1-8 --complement | xclip -o -sel c;
+##use in command line argument like
+##qrscan "image" | xclip -sel c -o because
+## ERROR: target STRING not available
+## xclip -o outputs current clipboard...
+## xclip -i flag standard input
+fi