From 0bd8ffd2973923830507f55e03bc03ed8dbb1939 Mon Sep 17 00:00:00 2001 From: Nicola Belluti Date: Mon, 22 Sep 2025 20:24:02 +0200 Subject: [PATCH] Added the dotfiles for the Fish shell --- .chezmoiroot | 1 + .../fish/completions/.gitkeep | 0 .../fish/conf.d/greeting.fish | 2 ++ .../fish/functions/.gitkeep | 0 .../fish/remove_config.fish | 0 home/run_onchange_before_archlinux.sh.tmpl | 32 +++++++++++++++++++ 6 files changed, 35 insertions(+) create mode 100644 .chezmoiroot create mode 100644 home/private_dot_config/fish/completions/.gitkeep create mode 100644 home/private_dot_config/fish/conf.d/greeting.fish create mode 100644 home/private_dot_config/fish/functions/.gitkeep create mode 100644 home/private_dot_config/fish/remove_config.fish create mode 100644 home/run_onchange_before_archlinux.sh.tmpl diff --git a/.chezmoiroot b/.chezmoiroot new file mode 100644 index 0000000..05280cb --- /dev/null +++ b/.chezmoiroot @@ -0,0 +1 @@ +/home diff --git a/home/private_dot_config/fish/completions/.gitkeep b/home/private_dot_config/fish/completions/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/home/private_dot_config/fish/conf.d/greeting.fish b/home/private_dot_config/fish/conf.d/greeting.fish new file mode 100644 index 0000000..0c3c1f8 --- /dev/null +++ b/home/private_dot_config/fish/conf.d/greeting.fish @@ -0,0 +1,2 @@ +# Don't greet the user every time they open the shell +set fish_greeting diff --git a/home/private_dot_config/fish/functions/.gitkeep b/home/private_dot_config/fish/functions/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/home/private_dot_config/fish/remove_config.fish b/home/private_dot_config/fish/remove_config.fish new file mode 100644 index 0000000..e69de29 diff --git a/home/run_onchange_before_archlinux.sh.tmpl b/home/run_onchange_before_archlinux.sh.tmpl new file mode 100644 index 0000000..c35074d --- /dev/null +++ b/home/run_onchange_before_archlinux.sh.tmpl @@ -0,0 +1,32 @@ +#!/bin/bash + +{{ if false -}} +echo "This script must be run in Arch Linux" +exit 1 +{{ end -}} + +set -eu + +{{ if ne .chezmoi.osRelease.id "arch" -}} +echo "You're not running Arch Linux. Skipping..." +exit 0 +{{ end -}} + +while true; do + read -p "Do you want to run the Arch Linux configuration script? [Y/n] " REPLY + + # Treat an empty response as the default "Y" + REPLY=${REPLY:-Y} + + case "$REPLY" in + y|Y) break ;; + n|N) exit 0 ;; + *) echo "Unrecognized option. Please answer Y or n." ;; + esac +done + +set -x + +# Install the Fish shell +sudo pacman --noconfirm -S fish +sudo chsh -s "$(which fish)" $USER