Skip to content

Instantly share code, notes, and snippets.

@naranyala
Created December 24, 2023 02:23
Show Gist options
  • Save naranyala/4773d3c0341dd30d9f3188175bfe0ce0 to your computer and use it in GitHub Desktop.
Save naranyala/4773d3c0341dd30d9f3188175bfe0ce0 to your computer and use it in GitHub Desktop.
#!/bin/bash
DEFAULT_BROWSER="brave"
# Declare a custom array of websites
declare -A websites
websites["google"]="google.com"
websites["github"]="github.com"
websites["twitter"]="twitter.com"
# websites[""]="https://%s"
# Use Rofi to select a custom website
selected_website=$(echo "${!websites[@]}" | tr ' ' '\n' | sort | rofi -dmenu -p "Web Bookmarks:")
# Prompt the user for a search query
if [ -n "$selected_website" ]; then
final_destination="${websites[$selected_website]}"
xdg-open "$final_destination"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment