Another copy of my dotfiles. Because I don't completely trust GitHub.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
1.1 KiB

  1. #!/bin/sh
  2. DMENU='dmenu -z 1900 -x 10 -y 10 -i'
  3. blacklist="powerlevel10k|secret|gitignore|log|plugins|patches|config/surf"
  4. whitelist="config.h|keybind.h|colors.h|color.h|rules.h"
  5. declare -A mappings
  6. items=$(find "$HOME/.dotfiles/config" -type f | grep -Ev $blacklist | sed -n "s|$HOME/.dotfiles/config/|config/|p")
  7. scripts=$(find "$HOME/.dotfiles/local/bin" -type f | grep -Ev $blacklist | sed -n "s|$HOME/.dotfiles/local/bin/|scripts/|p")
  8. suckless=$(find "$HOME/.dotfiles/suckless" -type f | grep -Ev $blacklist | grep -E $whitelist | sed -n "s|$HOME/.dotfiles/suckless/|suckless/|p")
  9. selection=$(echo -e "$items\n$scripts\n$suckless" | $DMENU)
  10. if [ ! "$selection" = "" ]; then
  11. if [ $(echo $selection | cut -d"/" -f 1) = "scripts" ]; then
  12. st -c vim -n vim -e vim "$(echo $selection | sed -n "s|scripts/|$HOME/.dotfiles/local/bin/|p")"
  13. elif [ $(echo $selection | cut -d"/" -f 1) = "suckless" ]; then
  14. st -c vim -n vim -e vim "$(echo $selection | sed -n "s|suckless/|$HOME/.dotfiles/suckless/|p")"
  15. else
  16. st -c vim -n vim -e vim "$(echo $selection | sed -n "s|config/|$HOME/.dotfiles/config/|p")"
  17. fi
  18. fi