From 5884abce16409da9adafbd39d889e7a638f66bac Mon Sep 17 00:00:00 2001 From: Vico Shortman Date: Fri, 11 Apr 2025 03:23:28 +0200 Subject: [PATCH] Removed browser config, using default browser only with xdg-open --- README.md => README | 11 ++--------- launcher.sh | 18 +----------------- 2 files changed, 3 insertions(+), 26 deletions(-) rename README.md => README (92%) diff --git a/README.md b/README similarity index 92% rename from README.md rename to README index fb25d0b..cb5a5f4 100644 --- a/README.md +++ b/README @@ -44,7 +44,6 @@ On first run, the script creates a config file at: ``` log_file: /logs/shrtrun.log -browser: firefox search_engine: https://duckduckgo.com/?q= youtube_search: https://www.youtube.com/results?search_query= ``` @@ -76,14 +75,8 @@ This lets you recall previous commands easily when relaunching shrtrun. Only suc - ๐Ÿง **Debian/Ubuntu:** `sudo apt install rofi xdg-utils libnotify-bin` - ๐Ÿง **Arch/Manjaro:** `sudo pacman -S rofi xdg-utils libnotify` - ๐Ÿง **Fedora:** `sudo dnf install rofi xdg-utils libnotify` - -## ๐ŸŽจ Customization Ideas - -- โž• Add new command prefixes (e.g., `!r` for Reddit) -- ๐ŸŽจ Change styling in `rofi` config -- ๐ŸŒ Sync history across machines +- ๐Ÿง **openSUSE:** `sudo zypper install rofi xdg-utils libnotify` --- -๐Ÿ“ **GPL License** โ€“ This project is licensed under the GNU General Public License. See the LICENSE file for more details. ๐Ÿงพ - +๐Ÿ“ **GPL License** โ€“ This project is licensed under the GNU General Public License. See the LICENSE file for more details. ๐Ÿงพ \ No newline at end of file diff --git a/launcher.sh b/launcher.sh index 8800502..abf44dc 100644 --- a/launcher.sh +++ b/launcher.sh @@ -12,7 +12,6 @@ if [ ! -f "$CONFIG_FILE" ]; then cat > "$CONFIG_FILE" << EOF # Quick Launcher Configuration log_file: /logs/shrtrun.log -browser: firefox search_engine: https://duckduckgo.com/?q= youtube_search: https://www.youtube.com/results?search_query= EOF @@ -32,7 +31,6 @@ get_config_value() { } # Get configuration values -BROWSER=$(get_config_value "browser" "firefox") SEARCH_ENGINE=$(get_config_value "search_engine" "https://duckduckgo.com/?q=") YOUTUBE_SEARCH=$(get_config_value "youtube_search" "https://www.youtube.com/results?search_query=") LOG_FILE=$(get_config_value "log_file" "/.logs/shrtrun.log") @@ -93,21 +91,7 @@ if [[ "$USER_INPUT" == \!* ]]; then # Format the search URL SEARCH_URL="${SEARCH_ENGINE}${QUERY// /+}" echo "$(date): Opening search URL: $SEARCH_URL" >> "$LOG_FILE" - - # Try multiple methods to open the browser - if command -v "$BROWSER" &> /dev/null; then - "$BROWSER" "$SEARCH_URL" & - elif command -v xdg-open &> /dev/null; then - xdg-open "$SEARCH_URL" & - else - # Try common browsers - for browser in firefox google-chrome chromium-browser brave-browser; do - if command -v "$browser" &> /dev/null; then - "$browser" "$SEARCH_URL" & - break - fi - done - fi + xdg-open "$SEARCH_URL" &> /dev/null & disown # Append to history echo "$USER_INPUT" >> "$HISTORY_FILE"