manual deletion
This commit is contained in:
parent
4edcbcbacd
commit
a5c3633875
8 changed files with 1 additions and 229 deletions
|
@ -1,3 +0,0 @@
|
|||
return {
|
||||
"andweeb/presence.nvim",
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
# Add individual files, ignoring symlinks
|
||||
[ ! -L "$HOME/.zshrc" ] && yadm add "$HOME/.zshrc"
|
||||
|
||||
# Directory navigation
|
||||
cd "$HOME/.config/" || exit
|
||||
|
||||
# List of config directories/files to add
|
||||
# TODO: add these to a text file instead and read from it for easy appending
|
||||
# could add a yadm alias to append stuff to this file?
|
||||
configs=(nvim btop dunst i3 kitty lazygit nushell polybar rofi tmux wal zathura starship.toml yadm)
|
||||
|
||||
# Loop through each item in configs array
|
||||
for config in "${configs[@]}"; do
|
||||
# Check if it's not a symlink before adding
|
||||
# [ ! -L "$config" ] && [ -n "$(find "$config" -type l)" ] && yadm add "$config"
|
||||
find "$config" -type f -exec yadm add {} +
|
||||
done
|
||||
|
||||
sshenv="$HOME/.ssh/environment-$(cat /etc/hostname)"
|
||||
|
||||
# Commit and push if there are changes
|
||||
if [[ -n $(yadm status --porcelain) ]]; then
|
||||
yadm commit -m "Auto commit: $(date +'%Y-%m-%d %H:%M:%S')"
|
||||
# Check if the ssh-agent env is present
|
||||
if [ -f "$sshenv" ]; then
|
||||
# source "$HOME/.ssh/environment-dpad"
|
||||
source "$sshenv"
|
||||
yadm push
|
||||
else
|
||||
echo "ERROR: ssh-agent environment not found, aborting push..."
|
||||
exit
|
||||
fi
|
||||
fi
|
|
@ -1,59 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# This script reads tracked paths
|
||||
# from a file and executes "yadm add"
|
||||
# on all of them, then creates a timestamped
|
||||
# commit and pushes the changes.
|
||||
|
||||
AYE="AutoYADM Error:"
|
||||
AYM="AutoYADM:"
|
||||
# We check not to overwrite the user's env setting
|
||||
if [ -z "$VAR" ]; then
|
||||
AUTOYADMPUSH=0
|
||||
fi
|
||||
|
||||
# Set hostname explicitly because it
|
||||
# may not be present in this shell environment
|
||||
if [ -z "$HOST" ]; then
|
||||
HOST="$(hostname)"
|
||||
fi
|
||||
|
||||
# First we read each path from "tracked"
|
||||
(while read -r path; do
|
||||
# we disable ignored warning for this subshell
|
||||
# Execute yadm add on each real file
|
||||
# if the path points to a directory
|
||||
# This ensures symlinks are not added
|
||||
if [ -d "$path" ]; then
|
||||
find "$path" -type f -exec yadm add {} +
|
||||
# If just a file, we add directly
|
||||
elif [ -f "$path" ]; then
|
||||
yadm add "$path"
|
||||
# If neither file nor dir, something is very wrong!
|
||||
else
|
||||
echo "$AYE Target must be a directory or a file!"
|
||||
exit 1
|
||||
fi
|
||||
done) <"$HOME/.config/yadm/tracked"
|
||||
|
||||
# Define the location of the ssh-agent environment
|
||||
sshenv="$HOME/.ssh/environment-$HOST"
|
||||
if [[ -n $(yadm status --porcelain) ]]; then
|
||||
yadm commit -m "AutoYADM commit: $(date +'%Y-%m-%d %H:%M:%S')"
|
||||
# Check if the ssh-agent env exists
|
||||
if [[ -f "$sshenv" ]]; then
|
||||
if ((!AUTOYADMPUSH)); then
|
||||
echo "$AYM Pushing disabled, aborting..."
|
||||
exit 1
|
||||
fi
|
||||
# Directive to suppress shellcheck warning
|
||||
# shellcheck source=/dev/null
|
||||
source "$sshenv"
|
||||
yadm push
|
||||
else
|
||||
echo "$AYE ssh-agent environment not found, aborting push..."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "$AYM Push successful!"
|
|
@ -1,32 +0,0 @@
|
|||
#!/bin/bash
|
||||
# Add individual files, ignoring symlinks
|
||||
[ ! -L "$HOME/.zshrc" ] && yadm add "$HOME/.zshrc"
|
||||
|
||||
# Directory navigation
|
||||
cd "$HOME/.config/" || exit
|
||||
|
||||
# List of config directories/files to add
|
||||
configs=(nvim btop dunst i3 kitty lazygit nushell polybar rofi tmux wal zathura starship.toml yadm)
|
||||
|
||||
# Loop through each item in configs array
|
||||
for config in "${configs[@]}"; do
|
||||
# Check if it's not a symlink before adding
|
||||
# [ ! -L "$config" ] && [ -n "$(find "$config" -type l)" ] && yadm add "$config"
|
||||
find "$config" -type f -exec yadm add {} +
|
||||
done
|
||||
|
||||
sshenv="$HOME/.ssh/environment-$(cat /etc/hostname)"
|
||||
|
||||
# Commit and push if there are changes
|
||||
if [[ -n $(yadm status --porcelain) ]]; then
|
||||
yadm commit -m "Auto commit: $(date +'%Y-%m-%d %H:%M:%S')"
|
||||
# Check if the ssh-agent env is present
|
||||
if [ -f "$sshenv" ]; then
|
||||
# shellcheck source=/dev/null
|
||||
source "$sshenv"
|
||||
yadm push
|
||||
else
|
||||
echo "ERROR: ssh-agent environment not found, aborting push..."
|
||||
exit
|
||||
fi
|
||||
fi
|
|
@ -1,16 +0,0 @@
|
|||
/home/fic/.config/yadm
|
||||
/home/fic/.config/nvim
|
||||
/home/fic/.config/btop
|
||||
/home/fic/.config/dunst
|
||||
/home/fic/.config/i3
|
||||
/home/fic/.config/kitty
|
||||
/home/fic/.config/lazygit
|
||||
/home/fic/.config/nushell
|
||||
/home/fic/.config/polybar
|
||||
/home/fic/.config/rofi
|
||||
/home/fic/.config/tmux
|
||||
/home/fic/.config/wal
|
||||
/home/fic/.config/zathura
|
||||
/home/fic/.config/starship.toml
|
||||
/home/fic/.zshrc
|
||||
/home/fic/.bashrc
|
|
@ -1,37 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# This script takes file or directories as
|
||||
# arguments and appends them to the "tracked"
|
||||
# file, for use by autoyadm.sh
|
||||
|
||||
YADMDIR="$HOME/.config/yadm"
|
||||
AYE="AutoYADM Error:"
|
||||
AYM="AutoYADM:"
|
||||
|
||||
# We check if any arguments have been provided
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "$AYE $0 <file_or_directory> [<file_or_directory> ...]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# We loop through arguments
|
||||
for arg in "$@"; do
|
||||
# check if current arg is a real path
|
||||
if [ ! -e "$arg" ]; then
|
||||
echo "$AYE '$arg' is not a valid path."
|
||||
continue
|
||||
fi
|
||||
# get its absolute path
|
||||
abs=$(realpath "$arg")
|
||||
# check if it's inside home dir
|
||||
if [[ "$abs" == "$HOME"* ]]; then
|
||||
# convert to path relative to ~
|
||||
rel=${abs#"$HOME/"}
|
||||
# append to tracked file
|
||||
echo "$HOME/$rel" >>"$YADMDIR/tracked"
|
||||
echo "$AYM Tracking $HOME/$rel"
|
||||
else
|
||||
echo "$AYM Path must be inside the home directory."
|
||||
exit 1
|
||||
fi
|
||||
done
|
Loading…
Add table
Add a link
Reference in a new issue