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