Skip to content

Instantly share code, notes, and snippets.

@debxp
Created August 26, 2019 12:27
Show Gist options
  • Save debxp/e4cca8aae73a05e6e1b8f73962fddec1 to your computer and use it in GitHub Desktop.
Save debxp/e4cca8aae73a05e6e1b8f73962fddec1 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
msg="Abrir aqui..."
inicio="$HOME"
fonte="Menlo-15"
abrir_pasta() { xdg-open "$1"; exit 0; }
caminho=$(find $inicio -maxdepth 1 -type d | cut -d'/' -f4- | sed -e "s/^$/$msg/g" | dmenu -i -l 10 -fn $fonte -p "Abrir: ")
[[ -z $caminho ]] && exit 0
[[ "$caminho" = "$msg" ]] && abrir_pasta "$inicio"
pasta=$(find "$inicio/$caminho" -type d | cut -d'/' -f5- | sed -e "s/^$/$msg/g" | dmenu -i -l 10 -fn $fonte -p "$inicio/$caminho: ")
[[ -z $pasta ]] && exit 0
[[ "$pasta" = "$msg" ]] && abrir_pasta "$inicio/$caminho" || abrir_pasta "$inicio/$caminho/$pasta"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment