sxbm_dmenu: cosmetics
This commit is contained in:
@ -11,27 +11,27 @@
|
|||||||
prompt="dmenu -i -l 24"
|
prompt="dmenu -i -l 24"
|
||||||
|
|
||||||
bm_open() {
|
bm_open() {
|
||||||
link_num="$(sxbm ls -c "$@" | $prompt | cut -d ")" -f 1)"
|
link_num="$(sxbm ls -c "$@" | $prompt | cut -d ")" -f 1)"
|
||||||
[ -n "$link_num" ] && sxbm open "$link_num"
|
[ -n "$link_num" ] && sxbm open "$link_num"
|
||||||
}
|
}
|
||||||
|
|
||||||
bm_yank() {
|
bm_yank() {
|
||||||
link="$(sxbm ls -c "$@" | $prompt | cut -d " " -f 2)"
|
link="$(sxbm ls -c "$@" | $prompt | cut -d " " -f 2)"
|
||||||
[ -n "$link" ] && echo "$link" | xclip -in -selection clipboard
|
[ -n "$link" ] && echo "$link" | xclip -in -selection clipboard
|
||||||
}
|
}
|
||||||
|
|
||||||
bm_add() {
|
bm_add() {
|
||||||
sxbm add "$@" 2>&1 | xargs -I{} $prompt -p {}
|
sxbm add "$@" 2>&1 | xargs -I{} $prompt -p {}
|
||||||
}
|
}
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
"-a"|"--add")
|
"-a"|"--add")
|
||||||
shift && bm_add "$@"
|
shift && bm_add "$@"
|
||||||
;;
|
;;
|
||||||
"-y"|"--yank")
|
"-y"|"--yank")
|
||||||
shift && bm_yank "$@"
|
shift && bm_yank "$@"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
bm_open "$@"
|
bm_open "$@"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
Reference in New Issue
Block a user