Add a script for installing fish profile settings

This commit is contained in:
Manuel Thalmann 2024-03-20 22:37:34 +01:00
parent b81b034287
commit 49ab989d1e
5 changed files with 42 additions and 25 deletions

View file

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
pushd "${BASH_SOURCE%/*}" > /dev/null; pushd "${BASH_SOURCE%/*}" > /dev/null;
. "../bash/profile.sh"; . "../bash/profile.sh";
. "../fish/profile.sh";
NEXTCLOUD_DIR="${NEXTCLOUD_DIR}"; NEXTCLOUD_DIR="${NEXTCLOUD_DIR}";
themeDir="/usr/local/share/oh-my-posh/themes"; themeDir="/usr/local/share/oh-my-posh/themes";
install -d644 "$themeDir"; install -d644 "$themeDir";
@ -12,10 +13,9 @@ cat ~/.mnt/$NEXTCLOUD_DIR/.omp/manuel.omp.json | sudo tee "$themeDir/manuel.omp.
} | addBashProfile "oh-my-posh" "Oh My Posh!"; } | addBashProfile "oh-my-posh" "Oh My Posh!";
{ {
echo "# Oh My Posh!";
echo "oh-my-posh init fish | source"; echo "oh-my-posh init fish | source";
echo "oh-my-posh completion fish | source"; echo "oh-my-posh completion fish | source";
} | sudo tee /etc/fish/conf.d/oh-my-posh.fish; } | addFishProfile "oh-my-posh" "Oh My Posh!";
pwsh ./install.ps1; pwsh ./install.ps1;

View file

@ -0,0 +1,11 @@
#!/bin/bash
pushd "${BASH_SOURCE%/*}" > /dev/null;
. "../../Scripts/profile-base.sh";
function addFishProfile() {
name="$1";
title="$2";
addProfileStatement "$name" "$title" "/bin/fish" "/etc/fish/conf.d" "${@:3}";
}
popd > /dev/null;

View file

@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
configFile="/etc/fish/conf.d/logo-ls.fish"; pushd "${BASH_SOURCE%/*}" > /dev/null;
. "../bash/profile.sh";
. "../fish/profile.sh";
functionName="_PortValhalla_ls_"; functionName="_PortValhalla_ls_";
function dump_header() { function dump_header() {
@ -25,10 +27,8 @@ function dump_aliases() {
echo "end"; echo "end";
echo ""; echo "";
dump_aliases; dump_aliases;
} | sudo tee "$configFile" > /dev/null; } | addFishProfile "logo-ls" "logo-ls";
if ! grep "\blogo-ls\b" ~/.bashrc > /dev/null
then
{ {
echo ""; echo "";
dump_header; dump_header;
@ -42,5 +42,6 @@ then
echo "}"; echo "}";
echo ""; echo "";
dump_aliases; dump_aliases;
} | tee -a ~/.bashrc > /dev/null; } | addBashProfile "logo-ls" "logo-ls";
fi;
popd > /dev/null;

View file

@ -1,8 +1,13 @@
#!/bin/bash #!/bin/bash
pushd "${BASH_SOURCE%/*}" > /dev/null;
. "../fish/profile.sh";
. "../bash/profile.sh";
{ {
echo 'export PYENV_ROOT="$HOME/.pyenv"'; echo 'export PYENV_ROOT="$HOME/.pyenv"';
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"'; echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"';
echo 'eval "$(pyenv init -)"'; echo 'eval "$(pyenv init -)"';
} | sudo tee /etc/profile.d/pyenv.sh > /dev/null; } | addBashProfile "pyenv" "pyenv";
echo "pyenv init - | source" | sudo tee /etc/fish/conf.d/pyenv.fish > /dev/null; addFishProfile "pyenv" "pyenv" "pyenv init - | source";
popd > /dev/null;

View file

@ -3,6 +3,7 @@ pushd "${BASH_SOURCE%/*}" > /dev/null;
configPath="/etc/aliae/aliae.yml"; configPath="/etc/aliae/aliae.yml";
. "../../../Common/Config/aliae/install.sh"; . "../../../Common/Config/aliae/install.sh";
. "../../../Common/Config/fish/profile.sh";
sudo install -Dm644 "../../../Common/Config/aliae/aliae.yml" "$configPath"; sudo install -Dm644 "../../../Common/Config/aliae/aliae.yml" "$configPath";
function dump_header() { function dump_header() {
@ -20,9 +21,8 @@ function dump_bash() {
} | sudo tee /etc/profile.d/aliae.sh > /dev/null; } | sudo tee /etc/profile.d/aliae.sh > /dev/null;
{ {
dump_header;
echo "aliae init fish | source"; echo "aliae init fish | source";
echo "aliae completion fish | source"; echo "aliae completion fish | source";
} | sudo tee /etc/fish/conf.d/aliae.fish > /dev/null; } | addFishProfile "aliae" "aliae";
popd > /dev/null; popd > /dev/null;