adding bin files

This commit is contained in:
2023-04-18 09:55:20 +02:00
parent 363dc6c974
commit 1dc6b93bd5
24 changed files with 531 additions and 0 deletions

22
bin/search_open Executable file
View File

@ -0,0 +1,22 @@
#!/bin/bash
QUERY=$@
if [[ -z $QUERY ]]; then
QUERY=$(dmenu -p "Search Query: " < /dev/null )
fi
[[ -n $QUERY ]] || exit
QUERY=$(echo $QUERY | sed 's/ /+/g')
RESULT=$(curl "http://s.herisson.ovh/search?q=$QUERY&format=json")
TITLES=$(echo "$RESULT" | jq -r '.results[] | .title')
LINKS=$(echo "$RESULT" | jq -r '.results[] | .url')
SELECT=$(paste -d ": " <(seq $(echo "$TITLES" | wc -l)) <(echo "$TITLES") <(echo "$LINKS")| dmenu -l 15 | cut -d: -f1)
[[ -n $SELECT ]] || exit
echo "$LINKS" | head -n $SELECT | tail -1 | xargs xdg-open