diff options
| author | Don Williams <don.e.williams@gmail.com> | 2026-01-08 21:10:18 -0500 |
|---|---|---|
| committer | Don Williams <don.e.williams@gmail.com> | 2026-01-08 21:10:18 -0500 |
| commit | 10f3c5d0792ef5d652e0546fa8c8181a43f47c99 (patch) | |
| tree | e1fc3be263cf0c8678703323bfffad3efc3e60f1 /config/hypr/scripts/RofiSearch.sh | |
| parent | a35a1c4e980081566287dd6e2510f658f046cad1 (diff) | |
Fixing more scripts in Hyprland-Dots
- Hypridle.sh now launches hypridle in the background (& disown)
- when enabling the daemon, preventing the toggle command from hanging Waybar.
- RofiSearch.sh verifies that jq is available,
- captures the user’s query explicitly - URL-encodes it via jq @uri,
- opens the configured search engine with the encoded query instead of dropping the term.
- Sounds.sh now tries pw-play, then paplay, then aplay,
- emitting an error if none are installed
- the script no longer calls the non-existent pa-play.
On branch development
Your branch is up to date with 'origin/development'.
Changes to be committed:
modified: config/hypr/scripts/Hypridle.sh
modified: config/hypr/scripts/RofiSearch.sh
modified: config/hypr/scripts/Sounds.sh
Diffstat (limited to 'config/hypr/scripts/RofiSearch.sh')
| -rwxr-xr-x | config/hypr/scripts/RofiSearch.sh | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/config/hypr/scripts/RofiSearch.sh b/config/hypr/scripts/RofiSearch.sh index 8ef12c46..dfeb19ac 100755 --- a/config/hypr/scripts/RofiSearch.sh +++ b/config/hypr/scripts/RofiSearch.sh @@ -4,6 +4,10 @@ # Define the path to the config file config_file=$HOME/.config/hypr/UserConfigs/01-UserDefaults.conf +if ! command -v jq >/dev/null 2>&1; then + notify-send -u low "Rofi Search" "jq is required for URL encoding. Please install jq." + exit 1 +fi # Check if the config file exists if [[ ! -f "$config_file" ]]; then @@ -32,5 +36,12 @@ if pgrep -x "rofi" >/dev/null; then pkill rofi fi -# 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
\ No newline at end of file +# Open Rofi and pass the selected query to xdg-open for the configured search engine +query=$(printf '' | rofi -dmenu -config "$rofi_theme" -mesg "$msg") + +if [[ -z "$query" ]]; then + exit 0 +fi + +encoded_query=$(printf '%s' "$query" | jq -sRr @uri) +xdg-open "${Search_Engine}${encoded_query}" >/dev/null 2>&1 & |
