summaryrefslogtreecommitdiff
path: root/debian/.local/bin/dmenubrowse
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-12-24 13:54:03 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-12-24 13:54:03 +0900
commit28e8bdf7f8286bd431b7f3b709e79f3827b31469 (patch)
tree85b44eff6da4d8443198fb6e04dfb6ee55244588 /debian/.local/bin/dmenubrowse
parent8470ff001befcfd0f626dea69a9e76d43aee0511 (diff)
updates
Diffstat (limited to 'debian/.local/bin/dmenubrowse')
-rwxr-xr-xdebian/.local/bin/dmenubrowse44
1 files changed, 44 insertions, 0 deletions
diff --git a/debian/.local/bin/dmenubrowse b/debian/.local/bin/dmenubrowse
new file mode 100755
index 0000000..f894491
--- /dev/null
+++ b/debian/.local/bin/dmenubrowse
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+# Use dmenu to choose a search option
+search_tool=$(printf "Searx\nDuckDuckGo\nWebsite\nYouTube" | dmenu -i -p "Which option?")
+
+# Exit if no option is selected
+[ -z "$search_tool" ] && exit 1
+
+# Determine the command to execute based on the search tool
+case "$search_tool" in
+"Searx")
+ # Searx can be run directly in the browser
+ tool="browse"
+ ;;
+"DuckDuckGo")
+ # For DuckDuckGo, run ddgr in the terminal
+ tool="$TERMINAL -e browse -d"
+ ;;
+"Website")
+ # Ask the user for the website
+ site=$(printf "bing\ngoogle\nnaver\nyahoo\nyoutube" | dmenu -i -p "Which site?")
+
+ # Exit if no site is provided
+ [ -z "$site" ] && exit 1
+
+ # For website searches, run ddgr in the terminal with the website option
+ tool="$TERMINAL -e browse $site"
+ ;;
+"YouTube")
+ tool="browse -y"
+ ;;
+*)
+ tool="browse"
+ ;;
+esac
+
+# Get the search query from the user
+search_query=$(echo | dmenu -i -p "Search: ")
+
+# Exit if no search query is provided
+[ -z "$search_query" ] && exit 1
+
+# Execute the command
+$tool "$search_query"