summaryrefslogtreecommitdiffstats
path: root/.local
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2023-10-28 08:41:43 -0400
committerLuke Smith <luke@lukesmith.xyz>2023-10-28 08:41:43 -0400
commit0cc589bcadf5a8ce6aee2706e749fee878ccca75 (patch)
tree8cbd17151ea65bcaf73085899917ac66d1360122 /.local
parent6ba48b27339d47732519476333712bb4b2cde87f (diff)
parent1e3adf9c03b2e563e81a13d6907ffd5ca20b887a (diff)
downloadeibhear-0cc589bcadf5a8ce6aee2706e749fee878ccca75.tar.gz
eibhear-0cc589bcadf5a8ce6aee2706e749fee878ccca75.tar.zst
eibhear-0cc589bcadf5a8ce6aee2706e749fee878ccca75.zip
Merge branch 'master' of github.com:LukeSmithxyz/voidrice
Diffstat (limited to '.local')
-rwxr-xr-x.local/bin/booksplit4
-rwxr-xr-x.local/bin/mounter2
-rwxr-xr-x.local/bin/statusbar/sb-forecast2
-rwxr-xr-x.local/bin/statusbar/sb-internet4
-rwxr-xr-x.local/bin/statusbar/sb-mailbox2
-rwxr-xr-x.local/bin/statusbar/sb-torrent4
-rwxr-xr-x.local/bin/xdg-terminal-exec3
7 files changed, 12 insertions, 9 deletions
diff --git a/.local/bin/booksplit b/.local/bin/booksplit
index a6845f7..079d85f 100755
--- a/.local/bin/booksplit
+++ b/.local/bin/booksplit
@@ -12,7 +12,7 @@ inputaudio="$1"
ext="${1##*.}"
# Get a safe file name from the book.
-escbook="$(echo "$booktitle" | iconv -cf UTF-8 -t ASCII//TRANSLIT | tr -d '[:punct:]' | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | sed "s/-\+/-/g;s/\(^-\|-\$\)//g")"
+escbook="$(echo "$booktitle" | iconv -c -f UTF-8 -t ASCII//TRANSLIT | tr -d '[:punct:]' | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | sed "s/-\+/-/g;s/\(^-\|-\$\)//g")"
! mkdir -p "$escbook" &&
echo "Do you have write access in this directory?" &&
@@ -31,7 +31,7 @@ do
cmd="$cmd -metadata artist=\"$author\" -metadata title=\"$title\" -metadata album=\"$booktitle\" -metadata year=\"$year\" -metadata track=\"$track\" -metadata total=\"$total\" -ss \"$start\" -to \"$end\" -vn -c:a copy \"$file\" "
fi
title="$(echo "$x" | cut -d' ' -f2-)"
- esctitle="$(echo "$title" | iconv -cf UTF-8 -t ASCII//TRANSLIT | tr -d '[:punct:]' | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | sed "s/-\+/-/g;s/\(^-\|-\$\)//g")"
+ esctitle="$(echo "$title" | iconv -c -f UTF-8 -t ASCII//TRANSLIT | tr -d '[:punct:]' | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | sed "s/-\+/-/g;s/\(^-\|-\$\)//g")"
track="$((track+1))"
start="$end"
done < "$2"
diff --git a/.local/bin/mounter b/.local/bin/mounter
index b532e08..756d04d 100755
--- a/.local/bin/mounter
+++ b/.local/bin/mounter
@@ -36,7 +36,7 @@ filter() { sed "s/ /:/g" | awk -F':' '$7==""{printf "%s%s (%s) %s\n",$1,$3,$5,$6
unopenedluks="$(for drive in $allluks; do
uuid="${drive%% *}"
uuid="${uuid//-}" # This is a bashism.
- for open in $decrypted; do
+ [ -n "$decrypted" ] && for open in $decrypted; do
[ "$uuid" = "$open" ] && break 1
done && continue 1
echo "🔒 $drive"
diff --git a/.local/bin/statusbar/sb-forecast b/.local/bin/statusbar/sb-forecast
index 368c17f..d8a16aa 100755
--- a/.local/bin/statusbar/sb-forecast
+++ b/.local/bin/statusbar/sb-forecast
@@ -7,7 +7,7 @@ url="${WTTRURL:-wttr.in}"
weatherreport="${XDG_CACHE_HOME:-$HOME/.cache}/weatherreport"
# Get a weather report from 'wttr.in' and save it locally.
-getforecast() { curl -sf "$url/$LOCATION" > "$weatherreport" || exit 1; }
+getforecast() { timeout --signal=1 2s curl -sf "$url/$LOCATION" > "$weatherreport" || exit 1; }
# Forecast should be updated only once a day.
checkforecast() {
diff --git a/.local/bin/statusbar/sb-internet b/.local/bin/statusbar/sb-internet
index 4c8131c..5440a52 100755
--- a/.local/bin/statusbar/sb-internet
+++ b/.local/bin/statusbar/sb-internet
@@ -25,9 +25,9 @@ elif [ "$(cat /sys/class/net/w*/operstate 2>/dev/null)" = 'down' ] ; then
fi
# Ethernet
-[ "$(cat /sys/class/net/e*/operstate 2>/dev/null)" = 'up' ] && ethericon="🌐 " || ethericon="❎ "
+[ "$(cat /sys/class/net/e*/operstate 2>/dev/null)" = 'up' ] && ethericon="🌐" || ethericon="❎"
# TUN
-[ -n "$(cat /sys/class/net/tun*/operstate 2>/dev/null)" ] && tunicon="🔒 "
+[ -n "$(cat /sys/class/net/tun*/operstate 2>/dev/null)" ] && tunicon=" 🔒"
printf "%s%s%s\n" "$wifiicon" "$ethericon" "$tunicon"
diff --git a/.local/bin/statusbar/sb-mailbox b/.local/bin/statusbar/sb-mailbox
index 2132184..88522f2 100755
--- a/.local/bin/statusbar/sb-mailbox
+++ b/.local/bin/statusbar/sb-mailbox
@@ -4,7 +4,7 @@
# When clicked, brings up `neomutt`.
case $BLOCK_BUTTON in
- 1) setsid -f "$TERMINAL" -e neomutt ;;
+ 1) setsid -w -f "$TERMINAL" -e neomutt; pkill -RTMIN+12 "${STATUSBAR:-dwmblocks}" ;;
2) setsid -f mw -Y >/dev/null ;;
3) notify-send "📬 Mail module" "\- Shows unread mail
- Shows 🔃 if syncing mail
diff --git a/.local/bin/statusbar/sb-torrent b/.local/bin/statusbar/sb-torrent
index 6527005..08c9173 100755
--- a/.local/bin/statusbar/sb-torrent
+++ b/.local/bin/statusbar/sb-torrent
@@ -11,9 +11,9 @@ transmission-remote -l | grep % |
sort -h | uniq -c | awk '{print $3 $1}' | paste -sd ' ' -
case $BLOCK_BUTTON in
- 1) setsid -f "$TERMINAL" -e tremc ;;
+ 1) setsid -f "$TERMINAL" -e stig ;;
2) td-toggle ;;
- 3) notify-send "🌱 Torrent module" "\- Left click to open tremc.
+ 3) notify-send "🌱 Torrent module" "\- Left click to open stig.
- Middle click to toggle transmission.
- Shift click to edit script.
Module shows number of torrents:
diff --git a/.local/bin/xdg-terminal-exec b/.local/bin/xdg-terminal-exec
new file mode 100755
index 0000000..12b18ff
--- /dev/null
+++ b/.local/bin/xdg-terminal-exec
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+"$TERMINAL" -e "$@"