From 6b75e7479e6d6ae43cad4c17b3475a76956638d2 Mon Sep 17 00:00:00 2001 From: InigoGutierrez Date: Tue, 9 Apr 2019 16:16:06 +0200 Subject: Stupid script to browse web and open internet videos from desktop. --- surfraw.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 surfraw.sh (limited to 'surfraw.sh') diff --git a/surfraw.sh b/surfraw.sh new file mode 100755 index 0000000..26ae66d --- /dev/null +++ b/surfraw.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +# Do stuff using surfraw. Take back internet browsing from evil. + +search=$(echo "" | dmenu -p "Search:") +[ "$search" ] || exit 0 +dunstify "Searching $search" +target="$(ddgr --json "$search" | grep -E '"title": |"url": ' | sed '/"title": / N;s/\n//g' | awk '-F ["]' '{print $3 "[" $5 "]" }' | sed 's/"//g;s/,\s*\[/ \[/' | dmenu -i -l 10 -p "Target:" | awk '-F [[]' '{print $2}' | sed 's/]\s*$//')" +dunstify "Trying to play result of $target" +dunstify "Url: $target" +mpv "$target" || qutebrowser "$target" || dunstify "URL not valid." -- cgit v1.2.1