Various Linux scripts.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
915 B

#!/bin/bash
#Создан: Чт 23 июн 2016 13:14:17
7 years ago
#Изменён: Ср 04 апр 2018 19:38:58
7 years ago
# BROWSER=surf,vimprobable2,vimb,jumanji,chromium
BROWSER=min
8 years ago
SEARCH="https://duckduckgo.com/?q="
9 years ago
#title:url
URLS="$SHELLRC/var/www/urls"
8 years ago
LINES=5
# URL="$(rofi -dmenu -hide-scrollbar -columns 8 -location 1 -width 100 -lines 10 -input $URLS)"
TITLES="$(awk '/\[/{print NR-1}' $URLS | paste -s -d ',')"
BADURLS="$(awk '/XXX/{print NR-1}' $URLS | paste -s -d ',')"
WEBSITE=$(cat $URLS \
| cut -d ':' -f 1 \
| sed 's/XXX //' \
8 years ago
| rofi -dmenu -hide-scrollbar -i -columns 4 -location 1 -width 100 -lines $LINES -a $TITLES -u $BADURLS -p "web:")
if [ ! -z "$WEBSITE" ]; then
URL="$(grep "${WEBSITE}:" $URLS | cut -d ':' -f 2-)"
if [ ! -z "$URL" ]; then
$BROWSER "$URL"
else
case $WEBSITE in
/*) $BROWSER "${WEBSITE/\/}" ;;
*) $BROWSER "$(echo $SEARCH$WEBSITE | tr ' ' '+')";;
esac
fi
fi