Extract zsh functions to standalone bash script files
This commit is contained in:
parent
ad894d1236
commit
9ccaee7f5e
8
home/scripts/git-sync-all.sh
Executable file
8
home/scripts/git-sync-all.sh
Executable file
|
@ -0,0 +1,8 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
for DIRECTORY in $HOME/.nixos $HOME/.emacs $HOME/.password-store $HOME/.elfeed $HOME/Documents/Org $HOME/Documents/References; do
|
||||||
|
echo "--- $DIRECTORY ---"
|
||||||
|
mkdir -p $DIRECTORY
|
||||||
|
cd $DIRECTORY && git-sync
|
||||||
|
cd -
|
||||||
|
done
|
22
home/scripts/rsync-local-config.sh
Executable file
22
home/scripts/rsync-local-config.sh
Executable file
|
@ -0,0 +1,22 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
HOST=$1
|
||||||
|
for TARGET in bat git starship.toml; do
|
||||||
|
SOURCE="$HOME/.config/$TARGET"
|
||||||
|
TMP_TARGET=/tmp/rsync-local-config
|
||||||
|
TMP_SOURCE=$TMP_TARGET
|
||||||
|
NIX_SED="sed -i 's|/nix/.*/bin/||g'"
|
||||||
|
NIX_REPLACE="$NIX_SED $TMP_TARGET"
|
||||||
|
if [[ -e $SOURCE ]]; then
|
||||||
|
if [[ -d $SOURCE ]]; then
|
||||||
|
SOURCE=$SOURCE/
|
||||||
|
TMP_SOURCE=$TMP_SOURCE/
|
||||||
|
NIX_REPLACE="fd -g '**' $TMP_TARGET -tfile -x $NIX_SED {};"
|
||||||
|
fi
|
||||||
|
rsync -avzL --exclude=".git*" $SOURCE $TMP_TARGET
|
||||||
|
chmod u+rw -R $TMP_SOURCE
|
||||||
|
sh -c "$NIX_REPLACE"
|
||||||
|
rsync -avzL --delete --exclude=".git*" $TMP_SOURCE $HOST:.config/$TARGET
|
||||||
|
rm -rf $TMP_SOURCE
|
||||||
|
fi
|
||||||
|
done
|
5
home/scripts/xdg-query-program.sh
Executable file
5
home/scripts/xdg-query-program.sh
Executable file
|
@ -0,0 +1,5 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
FILETYPE=$(xdg-mime query filetype $@)
|
||||||
|
DEFAULT=$(xdg-mime query default $FILETYPE)
|
||||||
|
echo "$FILETYPE -> $DEFAULT"
|
Loading…
Reference in a new issue