98 lines
2.4 KiB
Bash
98 lines
2.4 KiB
Bash
#!/usr/bin/env bash
|
|
#
|
|
# SCRIPT NAME:
|
|
# symlinks.sh
|
|
#
|
|
# AUTHOR:
|
|
# Severin Kaderli <severin@kaderli.dev>
|
|
#
|
|
# DESCRIPTION:
|
|
# Creates symlinks
|
|
|
|
CONFIG_LINKED_FILES_HOME=(
|
|
".config/bat"
|
|
".config/bottom"
|
|
".config/ccache"
|
|
".config/cmus"
|
|
".config/cron"
|
|
".config/custom"
|
|
".config/chromium-flags.conf"
|
|
".config/dconf"
|
|
".config/dunst"
|
|
".config/electron19-flags.conf"
|
|
".config/electron20-flags.conf"
|
|
".config/electron21-flags.conf"
|
|
".config/electron-flags.conf"
|
|
".config/environment.d"
|
|
".config/Element"
|
|
".config/espanso"
|
|
".config/fontconfig"
|
|
".config/git"
|
|
".config/gtk-2.0"
|
|
".config/gtk-3.0"
|
|
".config/httpie"
|
|
".config/kanshi"
|
|
".config/lapce-stable"
|
|
".config/maven"
|
|
".config/mopidy"
|
|
".config/mpd"
|
|
".config/mpv"
|
|
".config/MangoHud"
|
|
".config/mimeapps.list"
|
|
".config/MusicBrainz"
|
|
".config/ncmpcpp"
|
|
".config/npm"
|
|
".config/octave"
|
|
".config/pacman"
|
|
".config/paru"
|
|
".config/python"
|
|
".config/redshift"
|
|
".config/ranger"
|
|
".config/rofi"
|
|
".config/sqlite3"
|
|
".config/starship"
|
|
".config/streamlink"
|
|
".config/ssh"
|
|
".config/sway"
|
|
".config/Thunar"
|
|
".config/Trolltech.conf"
|
|
".config/user-dirs.dirs"
|
|
".config/user-dirs.locale"
|
|
".config/vim"
|
|
".config/vue"
|
|
".config/waybar"
|
|
".config/wget"
|
|
".config/xdg-desktop-portal-wlr"
|
|
".config/yay"
|
|
".config/zathura"
|
|
".config/zsh"
|
|
".config/kitty"
|
|
".local/bin"
|
|
".local/share/applications"
|
|
".local/share/gnupg/gpg.conf"
|
|
".local/share/gnupg/dirmngr.conf"
|
|
)
|
|
|
|
declare -A CONFIG_LINKED_FILES
|
|
CONFIG_LINKED_FILES=(
|
|
["${HOME}/documents"]="${HOME}/data/Documents"
|
|
["${HOME}/music"]="${HOME}/data/media/Music"
|
|
["${HOME}/pictures"]="${HOME}/data/media/pictures"
|
|
)
|
|
|
|
output::section "Symlinks"
|
|
for file in "${CONFIG_LINKED_FILES_HOME[@]}"; do
|
|
output::log "Linking ${YELLOW}\${HOME}/${file}${DEFAULT} to ${YELLOW}\${SYSTEM_DIR}/${file}${DEFAULT}"
|
|
rm -rf "${HOME:?}/${file}" |& output::debug
|
|
ln -fs "${SYSTEM_DIR}/${file}" "${HOME}/${file}" |& output::debug
|
|
done
|
|
|
|
for file in "${!CONFIG_LINKED_FILES[@]}"; do
|
|
output::log "Linking ${YELLOW}${file}${DEFAULT} to ${YELLOW}${CONFIG_LINKED_FILES[${file}]}${DEFAULT}"
|
|
rm -rf "${file}" |& output::debug
|
|
ln -fs "${CONFIG_LINKED_FILES[${file}]}" "${file}" |& output::debug
|
|
done
|
|
|
|
update-desktop-database ~/.local/share/applications
|
|
|
|
output::success "Successfully created symlinks"
|