summaryrefslogtreecommitdiff
path: root/.local/bin
diff options
context:
space:
mode:
authorkrolyxon <krolyxon@tutanota.com>2023-05-24 22:58:30 +0530
committerkrolyxon <krolyxon@tutanota.com>2023-05-24 22:58:30 +0530
commit8839ac5f3113f966b35920e412ef73b7aafece54 (patch)
tree2b66b758edf5f74f2795bbe3e77d2b9728607c10 /.local/bin
parentc1af8c0ef031d08812330e1cea925d3858bf6354 (diff)
scripts changes
Diffstat (limited to '.local/bin')
-rwxr-xr-x.local/bin/maimshot6
-rwxr-xr-x.local/bin/statusbar/sb-clock2
-rwxr-xr-x.local/bin/statusbar/sb-memory4
-rwxr-xr-x.local/bin/waldl20
4 files changed, 17 insertions, 15 deletions
diff --git a/.local/bin/maimshot b/.local/bin/maimshot
index d6c522a..c85e1c0 100755
--- a/.local/bin/maimshot
+++ b/.local/bin/maimshot
@@ -4,7 +4,7 @@ case "$(printf "a selected area (copy)\\ncurrent window (copy)\\nfull screen (co
"a selected area (copy)") maim -u -s | xclip -selection clipboard -t image/png ;;
"current window (copy)") maim -i "$(xdotool getactivewindow)" | xclip -selection clipboard -t image/png ;;
"full screen (copy)") sleep 0.2 ; maim | xclip -selection clipboard -t image/png ;;
- "a selected area") maim -u -s ~/pix/ss/pic-selected-"$(date '+%y-%m-%d-%H-%M').png" ;;
- "current window") maim -i "$(xdotool getactivewindow)" ~/pix/ss/pic-window-"$(date '+%y-%m-%d-%H-%M').png" ;;
- "full screen") sleep 0.2 ; maim ~/pix/ss/pic-full-"$(date '+%y-%m-%d-%H-%M').png" ;;
+ "a selected area") maim -u -s ~/pix/ss/pic-selected-$(uuidgen | awk -F- '{printf $2}')-"$(date '+%y-%m-%d').png" ;;
+ "current window") maim -i "$(xdotool getactivewindow)" ~/pix/ss/pic-window-"$(uuidgen | awk -F- '{printf $2}')-$(date '+%y-%m-%d').png" ;;
+ "full screen") sleep 0.2 ; maim ~/pix/ss/pic-full-"$(uuidgen | awk -F- '{printf $2}')-$(date '+%y-%m-%d').png" ;;
esac
diff --git a/.local/bin/statusbar/sb-clock b/.local/bin/statusbar/sb-clock
index a7d7b0e..eca5da0 100755
--- a/.local/bin/statusbar/sb-clock
+++ b/.local/bin/statusbar/sb-clock
@@ -1,2 +1,2 @@
#!/bin/sh
-echo "$(date "+[  %a %d %b ] [  %I:%M %P ]")"
+date "+[  %a %d %b ] [  %I:%M %P ]"
diff --git a/.local/bin/statusbar/sb-memory b/.local/bin/statusbar/sb-memory
index 3e78a22..b894ca1 100755
--- a/.local/bin/statusbar/sb-memory
+++ b/.local/bin/statusbar/sb-memory
@@ -1,2 +1,4 @@
#!/bin/sh
-echo "[  $(free --mebi | sed -n '2{p;q}' | awk '{printf ("%2.2fGiB", ( $3 / 1024), ($2 / 1024))}') $(sensors | awk '/Core 0/ {print " " $3}') ]"
+# echo "[  $(free --mebi | sed -n '2{p;q}' | awk '{printf ("%2.2fGiB", ( $3 / 1024), ($2 / 1024))}') $(sensors | awk '/Core 0/ {print " " $3}') ]"
+
+echo "[  $(free -h --si | sed -n "2s/\([^ ]* *\)\{2\}\([^ ]*\).*/\2/p")  $(grep -o "^[^ ]*" /proc/loadavg ) ]"
diff --git a/.local/bin/waldl b/.local/bin/waldl
index 1957354..48f8fa9 100755
--- a/.local/bin/waldl
+++ b/.local/bin/waldl
@@ -7,9 +7,9 @@ version="0.0.1"
# Usage:
# waldl <query>
# if query left empty then sh_menu will be used (dmenu by default)
-# after the thumbnails are cached, sxiv would open up with the thumbnails
-# Select the wallpapers using `m` on the image. ( marking the image in sxiv )
-# press `q` to quit sxiv, the marked images would start downloading
+# after the thumbnails are cached, nsxiv would open up with the thumbnails
+# Select the wallpapers using `m` on the image. ( marking the image in nsxiv )
+# press `q` to quit nsxiv, the marked images would start downloading
####################
## User variables ##
@@ -19,8 +19,8 @@ version="0.0.1"
walldir="$HOME/pix/wallhaven"
# the dir used to cache thumbnails
cachedir="$HOME/.cache/wallhaven"
-# sxiv options
-sxiv_otps=" -tfpo -z 200" # o is needed for selection
+# nsxiv options
+nsxiv_otps=" -tfpo -z 200" # o is needed for selection
# number of pages to show in search results
# each page contains 24 results
max_pages=4
@@ -66,7 +66,7 @@ dep_ck () {
command -v $pr >/dev/null 2>&1 || sh_info "command $pr not found, install: $pr" 1
done
}
-dep_ck "sxiv" "curl" "jq"
+dep_ck "nsxiv" "curl" "jq"
# clean up command that would be called when the program exits
@@ -109,7 +109,7 @@ sh_info "getting data..."
get_results "$query"
# check if data file is empty, if so then exit
-[ -s "$datafile" ] || sh_info "no images found" 1
+[ -s "$datafile" ] || sh_info "no images found" 1
############################
## downloading thumbnails ##
@@ -130,11 +130,11 @@ done | curl -Z -K -
#sh_info "downloaded thumbnails..."
###########################
-## user selection (sxiv) ##
+## user selection (nsxiv) ##
###########################
# extract the id's out of the thumbnail name
-image_ids="$(sxiv $sxiv_otps "$cachedir")"
+image_ids="$(nsxiv $sxiv_otps "$cachedir")"
[ -z "$image_ids" ] && exit
#########################
@@ -155,4 +155,4 @@ do
done | curl -K -
sh_info "wallpapers downloaded in:- '$walldir/$query'"
-sxiv $(ls -c)
+nsxiv $(ls -c)