voidrice/.local/bin/shortcuts
2020-01-29 12:10:09 -05:00

13 lines
624 B
Bash
Executable File

#!/usr/bin/env bash
# Output locations. Unactivated progs should go to /dev/null.
shell_shortcuts="$HOME/.config/shortcutrc"
# Remove, prepare files
printf "# vim: filetype=sh\\nalias " > "$shell_shortcuts"
# Format the `directories` file in the correct syntax and sent it to all three configs.
sed "s/\s*#.*$//;/^\s*$/d" "$HOME/.config/directories" | tee >(awk '{print $1"=\"cd "$2" && ls -a\" \\"}' >> "$shell_shortcuts")
# Format the `files` file in the correct syntax and sent it to both configs.
sed "s/\s*#.*$//;/^\s*$/d" "$HOME/.config/files" | tee >(awk '{print $1"=\"$EDITOR "$2"\" \\"}' >> "$shell_shortcuts")