diff options
| author | JaKooLit <jimmielovejay@gmail.com> | 2024-05-09 21:23:36 +0900 |
|---|---|---|
| committer | JaKooLit <jimmielovejay@gmail.com> | 2024-05-09 21:23:36 +0900 |
| commit | 42430346d8e9bd491f349a12e28f2d8299ae601b (patch) | |
| tree | d7c3a5611522f5c485614fbd62334a28e5b74253 /config/hypr/scripts | |
| parent | cd3766fb4053cd7ac3b0b54e36b856d31a8cde4d (diff) | |
updated rofi search to close first if opened
Diffstat (limited to 'config/hypr/scripts')
| -rwxr-xr-x | config/hypr/scripts/RofiSearch.sh | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/config/hypr/scripts/RofiSearch.sh b/config/hypr/scripts/RofiSearch.sh index 13148455..9b7e4bd4 100755 --- a/config/hypr/scripts/RofiSearch.sh +++ b/config/hypr/scripts/RofiSearch.sh @@ -3,8 +3,15 @@ # Original Submitted by https://github.com/LeventKaanOguz # Opens rofi in dmenu mod and waits for input. Then pushes the input to the query of the URL. -# rofi_config="$HOME/.config/rofi/config-search.rasi" + +# 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" -p "Search:" | xargs -I{} xdg-open "https://www.google.com/search?q={}" -echo "" | rofi -dmenu -config "$rofi_config" -p "Search:" | xargs -I{} xdg-open https://www.google.com/search?q={} |
