Update 'kfg'

This commit is contained in:
2023-05-27 20:03:44 +02:00
parent 7ee0d9db2e
commit 8c393c6484

28
kfg
View File

@@ -138,18 +138,22 @@ function install_rc_file {
}
function install_rc_download {
local _folder _filename _file _remote_file
_folder=$1
_filename=$2
_remote_file=3
# This is the config file
_file="$CONFIG_PATH/$_folder/$_filename.rc"
if [ -z "$P_RC" ]; then return 0; fi
# Make sure the directory exists
mkdir -p "$CONFIG_PATH/$1/"
mkdir -p "$CONFIG_PATH/$_folder/"
# This is the config file
local _file="$CONFIG_PATH/$1/.$1.rc"
# Does the file already exist? or does the user want to overwrite it?
if [ ! -e "$_file" ] || user_confirm_overwrite "$_file"; then
# Download the file and save it
download "$2" "$_file"
#wget -O "$FILE" "$2" > /dev/null 2>&1
download "$_filename" "$_file"
log_add "Added $_file"
fi
@@ -512,7 +516,7 @@ function p_tmux {
download_config tmux tmux.theme "https://git.cbeck.tech/kamu/dotfiles/raw/branch/main/.config/tmux/tmux.theme"
download_config tmux myip.sh "https://git.cbeck.tech/kamu/dotfiles/raw/branch/main/.config/tmux/myip.sh"
sudo chmod +x "${CONFIG_PATH}/tmux/myip.sh"
install_rc_download tmux "https://git.cbeck.tech/kamu/dotfiles/raw/branch/main/.config/tmux/tmux.rc"
install_rc_download "tmux" "tmux.rc" "https://git.cbeck.tech/kamu/dotfiles/raw/branch/main/.config/tmux/tmux.rc"
git_clone "https://github.com/tmux-plugins/tpm" "${CONFIG_PATH}/tmux/plugins/tpm"
}
@@ -530,7 +534,7 @@ function p_bat {
# -----------------
github_install bat "sharkdp/bat"
#install_deb_github bat "sharkdp/bat" "bat_VERSION_ARCH.deb"
install_rc_download bat "https://git.cbeck.tech/kamu/dotfiles/raw/branch/main/.config/bat/bat.rc"
install_rc_download bat "bat.rc" "https://git.cbeck.tech/kamu/dotfiles/raw/branch/main/.config/bat/bat.rc"
}
function p_lsd {
@@ -546,7 +550,7 @@ function p_lsd {
function p_zoxide {
github_install "zoxide" "ajeetdsouza/zoxide"
install_rc_download zoxide "https://git.cbeck.tech/kamu/dotfiles/raw/branch/main/.config/zoxide/zoxide.rc"
install_rc_download zoxide "zoxide.rc" "https://git.cbeck.tech/kamu/dotfiles/raw/branch/main/.config/zoxide/zoxide.rc"
}
function p_omp {
@@ -581,7 +585,7 @@ function p_fzf {
p_fzf_tab
fi
install_rc_download fzf "https://git.cbeck.tech/kamu/dotfiles/raw/branch/main/.config/fzf/fzf.rc"
install_rc_download fzf "fzf.rc" "https://git.cbeck.tech/kamu/dotfiles/raw/branch/main/.config/fzf/fzf.rc"
#download_config "fzf" "omp.json" "https://git.cbeck.tech/kamu/dotfiles/raw/branch/main/.omp.json"
#install_rc "fzf" "https://git.cbeck.tech/kamu/dotfiles/raw/branch/main/.omp.rc"
@@ -610,9 +614,9 @@ function install {
# -----------------
install_rc "export KHOME=$HOME_PATH"
install_rc "export XDG_CONFIG_HOME=$CONFIG_PATH"
install_rc_download "sh" "https://git.cbeck.tech/kamu/dotfiles/raw/branch/main/.config/sh/_kfg.rc"
install_rc_download "sh" "https://git.cbeck.tech/kamu/dotfiles/raw/branch/main/.config/sh/keybindings.rc"
install_rc_download "sh" "https://git.cbeck.tech/kamu/dotfiles/raw/branch/main/.config/sh/util.rc"
install_rc_download "sh" "_kfg.rc" "https://git.cbeck.tech/kamu/dotfiles/raw/branch/main/.config/sh/_kfg.rc"
install_rc_download "sh" "keybindings.rc" "https://git.cbeck.tech/kamu/dotfiles/raw/branch/main/.config/sh/keybindings.rc"
install_rc_download "sh" "util.rc" "https://git.cbeck.tech/kamu/dotfiles/raw/branch/main/.config/sh/util.rc"
while :
do