git clone failed on every run after the first, and ~/.fzf/install asks three questions - both stop an unattended run. The rc file is not touched because extra/zshrc sources ~/.fzf.zsh itself. ~/.zshrc was overwritten without a copy; the first one seen is kept as ~/.zshrc.bak. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
43 lines
1.4 KiB
Perl
Executable File
43 lines
1.4 KiB
Perl
Executable File
#!/usr/bin/perl
|
|
######################################################################################## extra setup (mwx'2025)
|
|
use Config;
|
|
|
|
$HOME=$ENV{"HOME"};
|
|
|
|
if (-x "/usr/bin/zsh") {
|
|
system("chsh root -s /usr/bin/zsh");
|
|
}
|
|
|
|
if ($Config{archname}=~/^darwin/) {
|
|
if ($Config{myuname}=~/arm64/) {
|
|
system("brew install eza");
|
|
}
|
|
} else {
|
|
system("./upd https://github.com/eza-community/eza -i /db/bin")
|
|
}
|
|
system("mkdir -p $HOME/.config");
|
|
system("cp -r extra/config/eza $HOME/.config");
|
|
|
|
system("./upd https://github.com/sxyazi/yazi -i /db/bin");
|
|
system("mkdir -p $HOME/.config");
|
|
system("cp -r extra/config/yazi $HOME/.config");
|
|
|
|
system("curl -s https://ohmyposh.dev/install.sh | bash -s -- -d /db/bin");
|
|
system("mkdir -p /db/etc");
|
|
system("cp extra/omp.json /db/etc/");
|
|
|
|
if (-d "$HOME/.fzf") {
|
|
system("cd $HOME/.fzf && git pull --ff-only");
|
|
} else {
|
|
system("git clone --depth 1 https://github.com/junegunn/fzf.git $HOME/.fzf");
|
|
}
|
|
# The flags are what makes it run without asking. No --update-rc: the zshrc
|
|
# below sources ~/.fzf.zsh itself.
|
|
system("$HOME/.fzf/install --key-bindings --completion --no-update-rc");
|
|
|
|
# Whatever zshrc is already there belongs to someone - keep the first one.
|
|
system("cp $HOME/.zshrc $HOME/.zshrc.bak") if (-f "$HOME/.zshrc" && !-f "$HOME/.zshrc.bak");
|
|
system("cp extra/zshrc $HOME/.zshrc");
|
|
|
|
########################################################################################################### END
|