Skip to content

Instantly share code, notes, and snippets.

@naranyala
Last active December 28, 2024 14:33
Show Gist options
  • Save naranyala/037f2ad8bd3262bfbc5dd6ba5aa61c3b to your computer and use it in GitHub Desktop.
Save naranyala/037f2ad8bd3262bfbc5dd6ba5aa61c3b 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"]="https://google.com/"
websites["youtube"]="https://youtube.com/"
websites["x-twitter"]="https://x.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