samedamci ba8b56fe0f
Add 'search' script
+ Change Transmission client to stig
+ Edit Xresources colors
+ Edit nvim colors
+ Change pdf viewer in vifmrc to zathura
+ Bind 'search' script in sxhkdrc
2020-05-22 09:57:50 +02:00

18 lines
375 B
Bash
Executable File

#!/bin/sh
# Search in $BROWSER or use bookmarks from file.
bmfile="$HOME/.config/bookmarks"
m() { rofi -dmenu -width 600 -i -p "Search" -l "$(wc -l "$bmfile")" ;}
chosen="$(
sed 's/http.*\/ //g' "$bmfile" | m
)"
[ ! "$chosen" ] && exit 0
url="$(grep "$chosen" "$bmfile" | awk '{ print $1 }')"
[ ! "$url" ] && url="https://duckduckgo.com/?q=$chosen"
"$BROWSER" "$url"