commit 4077064
hovercats
·
2024-06-17 11:59:15 +0000 UTC
parent 90e3785
shellcheck
2 files changed,
+4,
-4
M
sh/bmks
M
sh/bmks
+2,
-2
1@@ -33,7 +33,7 @@ list() {
2 go_to() {
3 [ ! -s "${bookmarks}" ] && printf "No bookmarks found.\n" && exit 1
4 [ -z "${BROWSER}" ] && printf 'BROWSER var not set\n' && exit 1
5- SELECTION="$(cat "${bookmarks}" | dmenu -c -i -l 10 | awk '{print $(NF)}')"
6+ SELECTION="$(sort "${bookmarks}" | dmenu -c -i -l 10 | awk '{print $(NF)}')"
7 if [ -z "${SELECTION}" ]; then
8 exit 1
9 else
10@@ -42,7 +42,7 @@ go_to() {
11 }
12
13 del() {
14- grep -v "$(cat "${bookmarks}" | dmenu -c -i -l 10)" "${bookmarks}" > _ \
15+ grep -v "$(sort "${bookmarks}" | dmenu -c -i -l 10)" "${bookmarks}" > _ \
16 && mv -f _ "${bookmarks}"
17 }
18
+2,
-2
1@@ -3,9 +3,9 @@
2 # Based on https://github.com/wmutils/contrib/blob/master/focus_watcher.sh
3 # and https://git.disroot.org/root_informatica/wms/src/branch/main/wms_voyeur.sh
4
5-while read ev wid args; do
6+while read -r ev wid; do
7 case $ev in
8- MAP) wattr o $wid || focus $wid ;;
9+ MAP) wattr o "$wid" || focus "$wid" ;;
10 UNMAP) [ ! "$(pfw)" ] && focus top ;;
11 esac
12 done