From e6b8018faa47f0b2775c76ff5fb36be2563df5e0 Mon Sep 17 00:00:00 2001 From: tiynger Date: Wed, 11 Sep 2019 12:28:20 +0200 Subject: [PATCH] dmenu and shortcut changes --- .config/neofetch/config.conf | 2 +- .config/sxhkd/sxhkdrc | 6 +++++- .local/bin/i3cmds/googlesearch | 20 ++++++++++++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100755 .local/bin/i3cmds/googlesearch diff --git a/.config/neofetch/config.conf b/.config/neofetch/config.conf index 15fdd64..446a21b 100644 --- a/.config/neofetch/config.conf +++ b/.config/neofetch/config.conf @@ -668,7 +668,7 @@ ascii_distro="arch_old" # Example: # ascii_colors=(distro) - Ascii is colored based on Distro colors. # ascii_colors=(4 6 1 8 8 6) - Ascii is colored using these colors. -ascii_colors=(44 44 44 44 44 44) +ascii_colors=(44 16 0 0 0 0) # Bold ascii logo # Whether or not to bold the ascii logo. diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc index cbad002..d56f305 100644 --- a/.config/sxhkd/sxhkdrc +++ b/.config/sxhkd/sxhkdrc @@ -7,13 +7,17 @@ super + b super + c code super + d - dmenu_run + ducksearch super + f $TERMINAL -e $FILE +super + g + googlesearch super + i idea super + m $TERMINAL -e neomutt +super + r + dmenu_run super + x xournalpp diff --git a/.local/bin/i3cmds/googlesearch b/.local/bin/i3cmds/googlesearch new file mode 100755 index 0000000..f8312a2 --- /dev/null +++ b/.local/bin/i3cmds/googlesearch @@ -0,0 +1,20 @@ +#!/bin/sh +# Gives a dmenu prompt to search DuckDuckGo. +# Without input, will open DuckDuckGo.com. +# URLs will be directly handed to the browser. +# Anything else, it search it. +browser=${BROWSER:-firefox} + +pgrep -x dmenu && exit + +choice=$(echo "G" | dmenu -i -p "Search Google:") || exit 1 + +if [ "$choice" = "G" ]; then + $RTV_BROWSER "https://google.com" +else + if echo "$choice" | grep "^(http:\/\/|https:\/\/)?[a-zA-Z0-9]+\.[a-zA-Z]+(/)?.*$"; then + $RTV_BROWSER "$choice" + else + $RTV_BROWSER "https://google.com/search?q=$choice" + fi +fi