diff options
| author | Luke Smith <luke@lukesmith.xyz> | 2019-03-30 00:07:48 -0400 |
|---|---|---|
| committer | Luke Smith <luke@lukesmith.xyz> | 2019-03-30 00:07:48 -0400 |
| commit | 4e97178df20f69b00b7c7bd31b3441cc85df2b66 (patch) | |
| tree | 55e7c7fac2961b13e5286ca8c705702a70e36508 | |
| parent | 40084275f5493ca0ad8d4b9d8acf5ab341946ffc (diff) | |
| download | eibhear-4e97178df20f69b00b7c7bd31b3441cc85df2b66.tar.gz eibhear-4e97178df20f69b00b7c7bd31b3441cc85df2b66.tar.zst eibhear-4e97178df20f69b00b7c7bd31b3441cc85df2b66.zip | |
ducksearch and toggletouch posix sh
| -rwxr-xr-x | .scripts/i3cmds/ducksearch | 6 | ||||
| -rwxr-xr-x | .scripts/i3cmds/toggletouchpad | 4 |
2 files changed, 4 insertions, 6 deletions
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" diff --git a/.scripts/i3cmds/toggletouchpad b/.scripts/i3cmds/toggletouchpad index bbb4110..6d8c9c8 100755 --- a/.scripts/i3cmds/toggletouchpad +++ b/.scripts/i3cmds/toggletouchpad @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # Toggle touchpad. Requires xf86-input-synaptics. -(synclient | grep TouchpadOff.*1 && synclient TouchpadOff=0)>/dev/null && echo "TouchPad reactivated." && exit +(synclient | grep "TouchpadOff.*1" && synclient TouchpadOff=0)>/dev/null && echo "TouchPad reactivated." && exit synclient TouchpadOff=1 && echo "TouchPad deactivated." |
