Skip to content

Instantly share code, notes, and snippets.

@naranyala
Created October 26, 2023 14:59
Show Gist options
  • Save naranyala/aa990638e46645b3379a18d854500816 to your computer and use it in GitHub Desktop.
Save naranyala/aa990638e46645b3379a18d854500816 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Declare a custom array of dir_path
declare -A dir_path
dir_path["Downloads"]="$HOME/Downloads/"
dir_path["Pictures"]="$HOME/Pictures/"
dir_path["repos"]="$HOME/repos"
dir_path["dotfiles"]="$HOME/dotfiles"
# Use Rofi to select a custom website
# selected_path=$(echo "${!dir_path[@]}" | tr ' ' '\n' | rofi -dmenu -p "Goto DIR Thunar:")
selected_path=$(printf '%s\n' "${!dir_path[@]}" | rofi -dmenu -i -p "Goto DIR with Thunar: ")
# Prompt the user for a search query
if [ -n "$selected_path" ]; then
thunar "${dir_path[$selected_path]}" &
else
notify-send "ERR" "invalid path!"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment