Files
dotfiles/scripts/dm-web
2024-10-09 16:55:47 +01:00

29 lines
794 B
Bash
Executable File

#!/bin/bash
engine="https://www.google.com/search?q="
declare -A bookmarks=(
["YouTube"]="https://www.youtube.com/"
["GitHub"]="https://github.com/TrudeEH/dotfiles"
["TrudeWeb"]="https://trudeeh.github.io/web/"
["Gemini"]="https://gemini.google.com/app"
["Element"]="https://app.element.io/#/home"
["Gmail"]="https://mail.google.com/mail/u/0/#inbox"
["Google Messages"]="https://messages.google.com/web/conversations"
["WOL"]="https://wol.jw.org/pt-PT/"
["Discord"]="https://discord.com/app"
)
choice=$(printf "%s\n" "${!bookmarks[@]}" | dmenu -i -p "Search:")
if [[ -n "$choice" ]]; then
# Find the matching URL
url=${bookmarks[$choice]}
if [[ -n "$url" ]]; then
xdg-open $url
else
xdg-open $engine$choice
fi
fi