commit fe45e09993f3532da13cfa986e9e6b3a3501c849
parent 171208047b4e179b91e7ad00ec4cf2137550e525
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date: Thu, 10 Sep 2020 15:18:29 -0700
Rewrite mark
remove seperate catagory selection.
use costom list binary to do heavy lifting.
allow use in places other that bookmarks directory.
Diffstat:
2 files changed, 7 insertions(+), 18 deletions(-)
diff --git a/scripts/.local/bin/mark b/scripts/.local/bin/mark
@@ -1,20 +1,9 @@
#!/usr/bin/env dash
-# bookmarks via dmenu.
+# select a line from a file via dmenu, useful for bookmarks.
-usage() { echo "usage: `basename $0` [-a]" ;}
+set -eu
-# configuration
-dmenu() { command dmenu -l 10 ;}
xclip() { command xclip -selection clipboard $* ;}
-if [ "$1" = "-h" ]
-then
- usage; exit 1
-else
- if [ "$1" = "-a" ]; then
- cat `find $BOOKMARK -type f` | dmenu | xclip
- else
- dmenu < $BOOKMARK/`find $BOOKMARK -type f | awk -F"$BOOKMARK/?" '{print $2}' | dmenu` | xclip
- fi
- notify-send "`xclip -out`"
-fi
+url=`list -b $@ | column -ts" " | dmenu -i`
+echo "$url" | awk '{ print $2 }' | xclip && notify-send "`xclip -out`"
diff --git a/sxhkd/.config/sxhkd/sxhkdrc b/sxhkd/.config/sxhkd/sxhkdrc
@@ -15,11 +15,11 @@ super + d
dmenu_run
# view bookmarks
-super + {shift,_} + m
- mark {-a,_}
+super + m
+ mark $BOOKMARK/*
# edit bookmarks
-super + alt + m
+super + shift + m
cd $BOOKMARK && $TERMINAL
# launch sxiv on wallpapers