Skip to content

Instantly share code, notes, and snippets.

@naranyala
Created November 28, 2023 13:19
Show Gist options
  • Save naranyala/96daff00b9b985beef713378a2039e1e to your computer and use it in GitHub Desktop.
Save naranyala/96daff00b9b985beef713378a2039e1e to your computer and use it in GitHub Desktop.
#!/bin/bash
declare -A websites
websites["ai-perplexity"]="https://www.perplexity.ai/search"
websites["ai-ms-copilot"]="https://copilot.microsoft.com/"
websites["ai-youcom"]="https://you.com/search"
websites["ai-huggingface"]="https://huggingface.co/chat"
websites["ai-claude-ai"]="https://claude.ai/chat"
websites["ai-google-bard"]="https://bard.google.com/chat"
websites["ai-chatgpt"]="https://chat.openai.com"
# Get website names as a list
website_names=$(printf "%s\n" "${!websites[@]}" | sort)
# Use Rofi to select a website
selected_website_name=$(echo "$website_names" | rofi -dmenu -p "Select a website:")
# Get the corresponding URL using the selected website name
selected_website_url="${websites[$selected_website_name]}"
# Open the selected website in the default web browser
if [[ -n $selected_website_url ]]; then
xdg-open "$selected_website_url"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment