Created
November 20, 2023 09:46
-
-
Save naranyala/bc496b23f2ed97685868eaa3a9f8869a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
declare -A websites | |
websites["google"]="https://www.google.com" | |
websites["twitter"]="https://twitter.com" | |
# Get website names as a list | |
website_names=$(printf "%s\n" "${!websites[@]}") | |
# 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