From 4ab18960b338ab47a139a327efd112e973f75573 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sat, 15 Sep 2018 10:05:32 -0400 Subject: [PATCH] Arch Wiki script added --- .config/i3/config | 2 +- .scripts/dmenuarchwiki | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100755 .scripts/dmenuarchwiki diff --git a/.config/i3/config b/.config/i3/config index 0b24cdf..5783f6f 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -296,7 +296,7 @@ bindsym $mod+F7 exec --no-startup-id td-toggle bindsym $mod+F8 exec --no-startup-id ~/.config/mutt/etc/mailsync.sh bindsym $mod+F9 exec --no-startup-id dmenumount bindsym $mod+F10 exec --no-startup-id dmenuumount -##bindsym $mod+F11 +bindsym $mod+F11 exec --no-startup-id dmenuarchwiki bindsym $mod+F12 exec $term -e sudo -A wifi-menu # #---Arrow Keys---# # diff --git a/.scripts/dmenuarchwiki b/.scripts/dmenuarchwiki new file mode 100755 index 0000000..276b5eb --- /dev/null +++ b/.scripts/dmenuarchwiki @@ -0,0 +1,17 @@ +#!/bin/sh + +# Gives a dmenu prompt to search the Arch Wiki in your preferred web browser +# Home goes to the home page of the Arch Wiki +# Anything else, it search it + +# Original idea/script by Github user @Caedis. Minor changes by Luke. + +pgrep -x dmenu && exit + +choice=$(echo "📖" | dmenu -i -p "Type ArchWiki page or search term:") || exit 1 + +if [ "$choice" = "📖" ]; then + $BROWSER "https://wiki.archlinux.org" +else + $BROWSER "https://wiki.archlinux.org/index.php?search=$choice" +fi