Browse Source

Fix opening qutebrowser with search results in rofi

Colin Powell 5 years ago
parent
commit
24472e64f9
3 changed files with 35 additions and 2 deletions
  1. 7 2
      i3/.config/i3/config
  2. 27 0
      rofi/.config/rofi/searx-search.sh
  3. 1 0
      x/.config/mimeapps.list

+ 7 - 2
i3/.config/i3/config

@@ -135,6 +135,11 @@ bindsym $mod+Ctrl+space floating toggle; resize set 700px 975px; $center
 # CENTER FLOATING
 bindsym $mod+c $center
 
+# DISPLAYS
+bindsym $mod+F1 exec ~/.screenlayout/titan-one.sh
+bindsym $mod+F2 exec ~/.screenlayout/titan-two.sh
+bindsym $mod+F3 exec ~/.screenlayout/titan-three.sh
+
 ##### WORKSPACES ##################################
 
 # WORKSPACES
@@ -254,8 +259,8 @@ exec feh --bg-scale ~/var/inbox/astrobin/`ls -Ar ~/var/inbox/astrobin | tail -n
 ##### APP BINDS ###################################
 
 bindsym $mod+n       exec $browser
-bindsym $mod+Ctrl+n  exec marcador rofi ~/.config/rofi/marcador.db
-bindsym $mod+Shift+n exec ~/.config/rofi/web-search.sh
+bindsym $mod+Shift+n exec ~/.config/rofi/searx-search.sh
+bindsym $mod+Ctrl+n exec ~/.config/rofi/web-search.sh
 bindsym $mod+Shift+b exec ~/.config/rofi/books-search.sh
 bindsym $mod+Shift+c exec ~/.config/rofi/github-repos.sh
 

+ 27 - 0
rofi/.config/rofi/searx-search.sh

@@ -0,0 +1,27 @@
+#!/usr/bin/env bash
+
+# -----------------------------------------------------------------------------
+# Requirements:
+#   rofi
+# Description:
+#   Use rofi to search the web.
+# Usage:
+#   searx-search.sh
+# -----------------------------------------------------------------------------
+# Script:
+
+URL="https://search.unbl.ink/?q="
+main() {
+  # Open rofi for prompt
+  query=$( rofi  -dmenu -matching fuzzy -location 0 -p "Query > " )
+  if [[ -n "$query" ]]; then
+    url=$URL$query
+    xdg-open "$url"
+  else
+    exit
+  fi
+}
+
+main
+
+exit 0

+ 1 - 0
x/.config/mimeapps.list

@@ -1,3 +1,4 @@
 [Default Applications]
 application/epub+zip=com.github.johnfactotum.Foliate.desktop
 x-scheme-handler/http=qutebrowser.desktop
+x-www-browser=qutebrowser.desktop