summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-x.local/bin/ext8
-rwxr-xr-x.local/bin/linkhandler2
-rwxr-xr-x.local/bin/rotdir2
-rwxr-xr-x.local/bin/statusbar/nettraf1
4 files changed, 7 insertions, 6 deletions
diff --git a/.local/bin/ext b/.local/bin/ext
index c5f89c5..806ce5e 100755
--- a/.local/bin/ext
+++ b/.local/bin/ext
@@ -8,19 +8,19 @@
while getopts "hc" o; do case "${o}" in
c) extracthere="True" ;;
- *) printf "Options:\\n -c: Extract archive into current directory rather than a new one.\\n" && exit ;;
+ *) printf "Options:\\n -c: Extract archive into current directory rather than a new one.\\n" && exit 1 ;;
esac done
if [ -z "$extracthere" ]; then
archive="$(readlink -f "$*")" &&
directory="$(echo "$archive" | sed 's/\.[^\/.]*$//')" &&
mkdir -p "$directory" &&
- cd "$directory" || exit
+ cd "$directory" || exit 1
else
- archive="$(readlink -f "$(echo "$*" | cut -d' ' -f2)")"
+ archive="$(readlink -f "$(echo "$*" | cut -d' ' -f2)" 2>/dev/null)"
fi
-[ "$archive" = "" ] && printf "Give archive to extract as argument.\\n" && exit
+[ -z "$archive" ] && printf "Give archive to extract as argument.\\n" && exit 1
if [ -f "$archive" ] ; then
case "$archive" in
diff --git a/.local/bin/linkhandler b/.local/bin/linkhandler
index 7c7e96f..ee5d170 100755
--- a/.local/bin/linkhandler
+++ b/.local/bin/linkhandler
@@ -10,7 +10,7 @@
[ -z "$1" ] && { "$BROWSER"; exit; }
case "$1" in
- *mkv|*webm|*mp4|*youtube.com/watch*|*youtube.com/playlist*|*youtu.be*|*hooktube.com*|*bitchute.com*)
+ *mkv|*webm|*mp4|*youtube.com/watch*|*youtube.com/playlist*|*youtu.be*|*hooktube.com*|*bitchute.com*|*videos.lukesmith.xyz*)
setsid -f mpv -quiet "$1" >/dev/null 2>&1 ;;
*png|*jpg|*jpe|*jpeg|*gif)
curl -sL "$1" > "/tmp/$(echo "$1" | sed "s/.*\///")" && sxiv -a "/tmp/$(echo "$1" | sed "s/.*\///")" >/dev/null 2>&1 & ;;
diff --git a/.local/bin/rotdir b/.local/bin/rotdir
index 7313a42..86da6db 100755
--- a/.local/bin/rotdir
+++ b/.local/bin/rotdir
@@ -9,4 +9,4 @@
[ -z "$1" ] && echo "usage: rotdir regex 2>&1" && exit 1
base="$(basename "$1")"
- ls "$PWD" | awk "BEGIN { lines = \"\"; m = 0; } /^$base$/ { m = 1; } { if (!m) { if (lines) { lines = lines\"\n\"; } lines = lines\"\"\$0; } else { print \$0; } } END { print lines; }"
+ls "$PWD" | awk -v BASE="$base" 'BEGIN { lines = ""; m = 0; } { if ($0 == BASE) { m = 1; } } { if (!m) { if (lines) { lines = lines"\n"; } lines = lines""$0; } else { print $0; } } END { print lines; }'
diff --git a/.local/bin/statusbar/nettraf b/.local/bin/statusbar/nettraf
index 71e6fe4..eb7a73b 100755
--- a/.local/bin/statusbar/nettraf
+++ b/.local/bin/statusbar/nettraf
@@ -5,6 +5,7 @@
# second, gives network traffic per second.
case $BLOCK_BUTTON in
+ 1) setsid -f "$TERMINAL" -e bmon ;;
3) notify-send "🌐 Network traffic module" "🔻: Traffic received
🔺: Traffic transmitted" ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;