34 lines
840 B
Bash
Executable file
34 lines
840 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
declare -A mapper=(
|
|
["alacritty"]="$HOME/.config/alacritty/alacritty.yml"
|
|
["astronvim"]="$HOME/.config/astronvim/lua/user/init.lua"
|
|
["bash"]="$HOME/.bashrc"
|
|
["bspwm"]="$HOME/.config/bspwm/bspwmrc"
|
|
["environment"]="$HOME/.config/environment"
|
|
["git"]="$HOME/.config/git/config"
|
|
["qutebrowser"]="$HOME/.config/qutebrowser/common.py"
|
|
["starship"]="$HOME/.config/starship.toml"
|
|
["sxhkd"]="$HOME/.config/sxhkd/sxhkdrc"
|
|
["vim"]="$HOME/.config/vim/vimrc"
|
|
["zsh"]="$HOME/.config/zsh/.zshrc"
|
|
)
|
|
|
|
if [[ -z "$1" ]]
|
|
then
|
|
echo "No argument given. Use --list (-l) to show all options."
|
|
exit
|
|
fi
|
|
if [[ "$1" == "-l" ]] || [[ "$1" == "--list" ]]
|
|
then
|
|
echo "${!mapper[@]}"
|
|
exit
|
|
fi
|
|
|
|
target="${mapper["$1"]}"
|
|
if [[ -n "$target" ]]
|
|
then
|
|
$EDITOR "$target"
|
|
else
|
|
echo "Dotfile not found. Use --list (-l) to show all options."
|
|
fi
|