Skip to content

Instantly share code, notes, and snippets.

@naranyala
Last active February 23, 2024 10:10
Show Gist options
  • Save naranyala/5df85e190391f59c5f0eab71c8fae4e9 to your computer and use it in GitHub Desktop.
Save naranyala/5df85e190391f59c5f0eab71c8fae4e9 to your computer and use it in GitHub Desktop.
#!/bin/bash
PATH_MEDIA="/media"
PATH_HOME="/home"
# Declare a custom array of dirs
declare -A dirs
dirs["dir:category:subcategory"]="$PATH_MEDIA/public-repos"
dirs["dir:category:subcategory"]="$PATH_MEDIA/private-repos"
dirs["dir:subcategory:project-name"]="$PATH_HOME/project-a"
dirs["dir:subcategory:project-name"]="$PATH_HOME/project-b"
# dirs[""]="/home"
# Use Rofi to select a custom website
selected_directory=$(echo "${!dirs[@]}" | tr ' ' '\n' | sort | rofi -dmenu -p "Directory Bookmarks: ")
# Prompt the user for a search query
if [ -n "$selected_directory" ]; then
final_destination="${dirs[$selected_directory]}"
notify-send "opening: $final_destination"
pcmanfm -n "$final_destination"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment