dotfiles

My dotfiles: zsh, lf, sxiv, i3, ranger, mpd and more
Log | Files | Refs | Submodules | README | LICENSE

commit 86480f70d94cc38defa8060f9acf3e146d931740
parent edde6779d4c6c279cd43e61bec2e9cbc9227d804
Author: Luke Smith <luke@lukesmith.xyz>
Date:   Fri, 28 Aug 2020 13:31:47 -0400

Merge branch 'master' of github.com:LukeSmithxyz/voidrice into master

Diffstat:
M.local/bin/ext | 8++++----
M.local/bin/linkhandler | 2+-
M.local/bin/rotdir | 2+-
M.local/bin/statusbar/nettraf | 1+
4 files changed, 7 insertions(+), 6 deletions(-)

diff --git 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 @@ -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 @@ -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 @@ -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" ;;