aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/scripts/RofiSearch.sh
diff options
context:
space:
mode:
authorJaKooLit <ejhay.games@gmail.com>2025-03-01 02:43:02 +0900
committerJaKooLit <ejhay.games@gmail.com>2025-03-01 02:43:02 +0900
commitf72311190587d83ce58a525db3b7af1adcb2fc13 (patch)
treeac7c5d4ff0d1f0615d0c854af9cd01eac3f311c1 /config/hypr/scripts/RofiSearch.sh
parent7b8857c6c8021a350939187730af0f3fe1c4afe5 (diff)
Introduction of using a separate file for Default apps, terminals, file managers, search engines...
Diffstat (limited to 'config/hypr/scripts/RofiSearch.sh')
-rwxr-xr-xconfig/hypr/scripts/RofiSearch.sh23
1 files changed, 15 insertions, 8 deletions
diff --git a/config/hypr/scripts/RofiSearch.sh b/config/hypr/scripts/RofiSearch.sh
index e256253a..e4b4f6af 100755
--- a/config/hypr/scripts/RofiSearch.sh
+++ b/config/hypr/scripts/RofiSearch.sh
@@ -1,18 +1,25 @@
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
-# Modified Script for Google Search
-# Original Submitted by https://github.com/LeventKaanOguz
+# For Searching via web browsers
-# Opens rofi in dmenu mod and waits for input. Then pushes the input to the query of the URL.
+# Modify this config file for default search engine
+config_file="$HOME/.config/hypr/UserConfigs/01-UserDefaults.conf"
+tmp_config_file=$(mktemp)
+sed 's/^\$//g; s/ = /=/g' "$config_file" > "$tmp_config_file"
+source "$tmp_config_file"
+# ##################################### #
+
+# Rofi theme and message
rofi_theme="$HOME/.config/rofi/config-search.rasi"
-msg='‼️ **note** ‼️ search via default web browser'
+msg='‼️ **note** ‼️ search via default web browser'
+
# Kill Rofi if already running before execution
if pgrep -x "rofi" >/dev/null; then
pkill rofi
- #exit 0
fi
-# Open rofi with a dmenu and pass the selected item to xdg-open for Google search
-#echo "" | rofi -dmenu -config "$rofi_config" | xargs -I{} xdg-open "https://www.google.com/search?q={}"
+# Open Rofi and pass the selected query to xdg-open for Google search
+echo "" | rofi -dmenu -config "$rofi_theme" -mesg "$msg" | xargs -I{} xdg-open $Search_Engine
-echo "" | rofi -dmenu -config $rofi_theme -mesg "$msg" | xargs -I{} xdg-open "https://www.google.com/search?q={}"
+# Clean up temporary file after sourcing
+rm "$tmp_config_file" \ No newline at end of file
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage