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.0 KiB

  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. declare -A mappings
  6. items=$(cd ~/.config; git ls-files | grep -Ev $blacklist | sed -n "s|^|config/|p")
  7. scripts=$(cd ~/.local/bin ; git ls-files | grep -Ev $blacklist | sed -n "s|^|scripts/|p")
  8. suckless=$(cd ~/.dotfiles/suckless ; git ls-files | grep -Ev $blacklist | grep -E $whitelist | sed -n "s|^|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 $EDITOR "$(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 $EDITOR "$(echo $selection | sed -n "s|suckless/|$HOME/.dotfiles/suckless/|p")"
  15. else
  16. st -c vim -n vim -e $EDITOR "$(echo $selection | sed -n "s|config/|$HOME/.dotfiles/config/|p")"
  17. fi
  18. fi