From 51a5f202b821d7d35b91fd596df98453e997c15b Mon Sep 17 00:00:00 2001 From: samedamci Date: Tue, 17 Mar 2020 20:06:32 +0100 Subject: [PATCH] Add bookmarks to websearch script --- botfiles/.scripts/websearch | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/botfiles/.scripts/websearch b/botfiles/.scripts/websearch index 5ab7c91..401c488 100755 --- a/botfiles/.scripts/websearch +++ b/botfiles/.scripts/websearch @@ -1,8 +1,22 @@ -#!/usr/bin/env zsh +#!/usr/bin/env sh -PHRASE=$(printf | dmenu -h 24 -p "Web search:") +bookmarks="redd.it\narch wiki\ninvidio.us\ngithub\ngitlab\ndotfiles\npython doc\nvulcan" +PHRASE=$(printf "${bookmarks}" | dmenu -h 24 -p "Web search:") -if [ -n "$PHRASE" ]; then - qutebrowser $PHRASE & +case "$PHRASE" in + "redd.it") PG="https://old.reddit.com" ;; + "arch wiki") PG="https://wiki.archlinux.org" ;; + "invidio.us") PG="https://invidio.us" ;; + "github") PG="https://github.com" ;; + "gitlab") PG="https://gitlab.com" ;; + "dotfiles") PG="https:github.com/samedamci/biual-dot-conf" ;; + "python doc") PG="https://docs.python.org/3/" ;; + "vulcan") PG="https://uonetplus.vulcan.net.pl/powiatrycki" ;; + *) PG="$PHRASE" +esac + +if [ -n "$PG" ]; then + qutebrowser "$PG" & bspc desktop -f '^3' fi +