2022-08-01 13:59:07 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
declare -A mapper=(
|
2022-10-04 21:17:16 +00:00
|
|
|
[".e"]="$HOME/.bin/.e"
|
2022-08-13 11:23:01 +00:00
|
|
|
["alacritty"]="$HOME/.config/alacritty/alacritty.yml"
|
|
|
|
["astronvim"]="$HOME/.config/astronvim/lua/user/init.lua"
|
2023-02-02 18:55:18 +00:00
|
|
|
["autostart"]="$HOME/.bin/autostart-manage"
|
2023-03-20 11:32:57 +00:00
|
|
|
["autostart.toml"]="$HOME/.config/autostart.toml"
|
2022-08-01 13:59:07 +00:00
|
|
|
["bash"]="$HOME/.bashrc"
|
|
|
|
["bspwm"]="$HOME/.config/bspwm/bspwmrc"
|
2023-10-19 00:20:28 +00:00
|
|
|
["env"]="$HOME/.config/environment"
|
|
|
|
["env.d"]="$HOME/.config/env.d/"
|
2022-08-13 11:23:01 +00:00
|
|
|
["git"]="$HOME/.config/git/config"
|
2022-10-04 20:23:22 +00:00
|
|
|
["git-ignore"]="$HOME/.config/git/ignore"
|
2023-04-02 18:55:57 +00:00
|
|
|
["home-manager"]="$HOME/.config/home-manager/home.nix"
|
2023-06-02 23:29:58 +00:00
|
|
|
["hyprland"]="$HOME/.config/hypr/hyprland.conf"
|
2023-04-02 17:27:03 +00:00
|
|
|
["nvim"]="$HOME/.config/nvim/"
|
2023-04-11 11:08:44 +00:00
|
|
|
["nvim.packer"]="$HOME/.config/nvim/lua/plugins.lua"
|
2023-01-03 01:15:35 +00:00
|
|
|
["polybar"]="$HOME/.config/polybar"
|
2023-10-18 21:51:45 +00:00
|
|
|
["qutebrowser"]="$HOME/.config/qutebrowser/config.py"
|
|
|
|
["qutebrowser-kiosk"]="$HOME/.config/qutebrowser/config_kiosk.py"
|
2022-08-13 11:23:01 +00:00
|
|
|
["starship"]="$HOME/.config/starship.toml"
|
2022-08-01 13:59:07 +00:00
|
|
|
["sxhkd"]="$HOME/.config/sxhkd/sxhkdrc"
|
|
|
|
["vim"]="$HOME/.config/vim/vimrc"
|
2022-10-21 22:58:24 +00:00
|
|
|
["wakatime"]="$HOME/.config/wakatime/.wakatime.cfg.tpl"
|
2023-07-01 11:05:41 +00:00
|
|
|
["waybar"]="$HOME/.config/waybar/"
|
2022-10-13 12:43:07 +00:00
|
|
|
["xprofile"]="$HOME/.xprofile"
|
2023-10-18 23:12:01 +00:00
|
|
|
["yadm-encrypt"]="$HOME/.config/yadm/encrypt"
|
2022-08-01 13:59:07 +00:00
|
|
|
["zsh"]="$HOME/.config/zsh/.zshrc"
|
|
|
|
)
|
|
|
|
|
2022-10-17 16:49:58 +00:00
|
|
|
if [ -z "$1" ]
|
2022-08-01 13:59:07 +00:00
|
|
|
then
|
|
|
|
echo "No argument given. Use --list (-l) to show all options."
|
|
|
|
exit
|
|
|
|
fi
|
2022-10-17 16:49:58 +00:00
|
|
|
if [ "$1" = "-l" ] || [ "$1" = "--list" ]
|
2022-08-01 13:59:07 +00:00
|
|
|
then
|
|
|
|
echo "${!mapper[@]}"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
target="${mapper["$1"]}"
|
2022-10-17 16:49:58 +00:00
|
|
|
if [ -n "$target" ]
|
2022-08-01 13:59:07 +00:00
|
|
|
then
|
2023-04-02 17:27:03 +00:00
|
|
|
if [ -d "$target" ]
|
|
|
|
then
|
|
|
|
cd "$target"
|
|
|
|
$EDITOR .
|
|
|
|
else
|
|
|
|
$EDITOR "$target"
|
|
|
|
fi
|
2022-08-01 13:59:07 +00:00
|
|
|
else
|
|
|
|
echo "Dotfile not found. Use --list (-l) to show all options."
|
|
|
|
fi
|