From d96ef0af90a6530975bbc29b2851860008b7daa9 Mon Sep 17 00:00:00 2001 From: Martin Blazik Date: Thu, 9 Oct 2025 10:35:20 +0200 Subject: [PATCH] Basic settings for fish shell --- fishrc | 11 +++++++++++ install.sh | 31 +++++++++++++++++++++++-------- rc/01-init.fish | 0 3 files changed, 34 insertions(+), 8 deletions(-) create mode 100644 fishrc create mode 100644 rc/01-init.fish diff --git a/fishrc b/fishrc new file mode 100644 index 0000000..ffaccff --- /dev/null +++ b/fishrc @@ -0,0 +1,11 @@ +# ~/.config/fish/config.fish +# echo "source $LWS/fishrc" > $__fish_config_dir/conf.d/lws.fish + +# $__fish_config_dir/conf.d (by default, ~/.config/fish/conf.d/) +# $__fish_sysconf_dir/conf.d (by default, /etc/fish/conf.d/) + +set -gx PAGER less +set -g fish_prompt_pwd_dir_length 0 + +# set -g fish_autosuggestion_enabled 0 +# fish_config theme choose "fish default" diff --git a/install.sh b/install.sh index 6c3577f..b1fb030 100755 --- a/install.sh +++ b/install.sh @@ -2,11 +2,26 @@ set -E -o errexit -o nounset -o pipefail -if grep -q -e 'source\s+.*/linux-workspace/bashrc\s*$' $HOME/.bashrc; then - echo "Linux Workspace configuration already exists in .bashrc !" - exit 1 -else - readonly SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P) - echo "Adding to $HOME/.bashrc" - echo "source '$SCRIPT_DIR/bashrc'" >> "$HOME/.bashrc" -fi +function install_lws() { + local LWS_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P) + + if grep -q -e "source.*$LWS_DIR/bashrc" $HOME/.bashrc; then + echo "SKIP: Linux Workspace configuration already exists in .bashrc !" + else + echo "Adding to $HOME/.bashrc" + echo "source '$LWS_DIR/bashrc'" >> "$HOME/.bashrc" + fi + + if [[ -d $HOME/.config/fish/ ]]; then + if [[ -f $HOME/.config/fish/config.fish ]]; then + echo "SKIP: Linux Workspace configuration already exists in fish config !" + else + echo "Adding to $HOME/.config/fish/conf.d/lws.fish" + echo "source $LWS_DIR/fishrc" > $__fish_config_dir/conf.d/lws.fish + fi + else + echo "Fish configuration directory not found, skipping fish setup." + fi +} + +install_lws diff --git a/rc/01-init.fish b/rc/01-init.fish new file mode 100644 index 0000000..e69de29