From 4e97178df20f69b00b7c7bd31b3441cc85df2b66 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sat, 30 Mar 2019 00:07:48 -0400 Subject: ducksearch and toggletouch posix sh --- .scripts/i3cmds/ducksearch | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to '.scripts/i3cmds/ducksearch') diff --git a/.scripts/i3cmds/ducksearch b/.scripts/i3cmds/ducksearch index d69f3fb..7b5bca6 100755 --- a/.scripts/i3cmds/ducksearch +++ b/.scripts/i3cmds/ducksearch @@ -1,5 +1,4 @@ -#!/bin/bash - +#!/bin/sh # Gives a dmenu prompt to search DuckDuckGo. # Without input, will open DuckDuckGo.com. # URLs will be directly handed to the browser. @@ -13,8 +12,7 @@ choice=$(echo "🦆" | dmenu -i -p "Search DuckDuckGo:") || exit 1 if [ "$choice" = "🦆" ]; then $browser "https://duckduckgo.com" else - # Detect if url - if [[ "$choice" =~ ^(http:\/\/|https:\/\/)?[a-zA-Z0-9]+\.[a-zA-Z]+(/)?.*$ ]]; then + if echo "$choice" | grep "^(http:\/\/|https:\/\/)?[a-zA-Z0-9]+\.[a-zA-Z]+(/)?.*$"; then $browser "$choice" else $browser "https://duckduckgo.com/?q=$choice&t=ffab&atb=v1-1" -- cgit v1.3.1