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.

23 lines
821 B

4 years ago
4 years ago
  1. #!/bin/sh
  2. DMENU='dmenu -z 1900 -x 10 -y 10 -i'
  3. blacklist="powerlevel10k|secret|gitignore|log|plugins|patches|config/surf|BetterDiscord"
  4. whitelist="config.h|keybind.h|colors.h|color.h|rules.h"
  5. files="$(git --git-dir=$HOME/.dotfiles.git/ --work-tree=$HOME ls-files)"
  6. items=$(echo "$files" | grep -Ev $blacklist)
  7. scripts=$(echo "$files" | grep -Ev $blacklist)
  8. suckless=$(echo "$files" | grep -Ev $blacklist | grep -E $whitelist)
  9. selection=$(printf "$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 $EDITOR "$HOME/$selection"
  13. elif [ $(echo $selection | cut -d"/" -f 1) = "suckless" ]; then
  14. st -c vim -n vim -e $EDITOR "$HOME/$selection"
  15. else
  16. st -c vim -n vim -e $EDITOR "$HOME/$selection"
  17. fi
  18. fi