From 014f60da354ae1d7645ffb19fd670a43174d5f93 Mon Sep 17 00:00:00 2001 From: Georg Pfuetzenreuter Date: Tue, 29 Apr 2025 11:02:44 +0200 Subject: [PATCH] Add common fish Signed-off-by: Georg Pfuetzenreuter --- salt/common.sls | 1 + salt/files/etc/fish/conf.d/greeting.fish | 3 +++ .../files/home/georg/.config/fish/config.fish | 7 ++++++ .../.config/fish/functions/envsource.fish | 23 +++++++++++++++++++ .../.config/fish/functions/heroespass.fish | 3 +++ .../home/georg/.config/fish/functions/up.fish | 3 +++ salt/profile/fish.sls | 18 +++++++++++++++ 7 files changed, 58 insertions(+) create mode 100644 salt/files/etc/fish/conf.d/greeting.fish create mode 100644 salt/files/home/georg/.config/fish/config.fish create mode 100644 salt/files/home/georg/.config/fish/functions/envsource.fish create mode 100644 salt/files/home/georg/.config/fish/functions/heroespass.fish create mode 100644 salt/files/home/georg/.config/fish/functions/up.fish create mode 100644 salt/profile/fish.sls diff --git a/salt/common.sls b/salt/common.sls index 1ff68ad..333d453 100644 --- a/salt/common.sls +++ b/salt/common.sls @@ -1,4 +1,5 @@ include: - profile.zypper + - profile.fish - profile.quilt - profile.vim diff --git a/salt/files/etc/fish/conf.d/greeting.fish b/salt/files/etc/fish/conf.d/greeting.fish new file mode 100644 index 0000000..9576b9a --- /dev/null +++ b/salt/files/etc/fish/conf.d/greeting.fish @@ -0,0 +1,3 @@ +function fish_greeting + echo "<3" +end diff --git a/salt/files/home/georg/.config/fish/config.fish b/salt/files/home/georg/.config/fish/config.fish new file mode 100644 index 0000000..19c9a8c --- /dev/null +++ b/salt/files/home/georg/.config/fish/config.fish @@ -0,0 +1,7 @@ +if status is-interactive + fish_add_path -aP ~/bin + + set -x SSH_AUTH_SOCK "$(gpgconf --list-dirs agent-ssh-socket)" + + set -x QT_STYLE_OVERRIDE Adwaita-Dark +end diff --git a/salt/files/home/georg/.config/fish/functions/envsource.fish b/salt/files/home/georg/.config/fish/functions/envsource.fish new file mode 100644 index 0000000..da052f4 --- /dev/null +++ b/salt/files/home/georg/.config/fish/functions/envsource.fish @@ -0,0 +1,23 @@ +function envsource + if test "$argv[1]" = '-e' + set -f envfile "$argv[2]" + else + set -f envfile "$argv[1]" + end + if not test -f "$envfile" + echo "Unable to load $envfile" + return 1 + end + while read line + if not string match -qr '^#|^$' "$line" + set item (string split -m 1 '=' $line) + if test "$argv[1]" = '-e' + set -e $item[1] + echo "Deleted key $item[1]" + else + set -gx $item[1] $item[2] + echo "Exported key $item[1]" + end + end + end < "$envfile" +end diff --git a/salt/files/home/georg/.config/fish/functions/heroespass.fish b/salt/files/home/georg/.config/fish/functions/heroespass.fish new file mode 100644 index 0000000..318d82f --- /dev/null +++ b/salt/files/home/georg/.config/fish/functions/heroespass.fish @@ -0,0 +1,3 @@ +function heroespass -w 'PASSWORD_STORE_DIR=~/Work/git/pass-opensuse pass' -d 'Shared pass store' + PASSWORD_STORE_GPG_OPTS='--trust-model always' PASSWORD_STORE_DIR=~/Work/git/pass-opensuse pass $argv +end diff --git a/salt/files/home/georg/.config/fish/functions/up.fish b/salt/files/home/georg/.config/fish/functions/up.fish new file mode 100644 index 0000000..e767813 --- /dev/null +++ b/salt/files/home/georg/.config/fish/functions/up.fish @@ -0,0 +1,3 @@ +function up + curl -sT $argv https://hugz.io/ | sed s/http/https/ +end diff --git a/salt/profile/fish.sls b/salt/profile/fish.sls new file mode 100644 index 0000000..ac04c3a --- /dev/null +++ b/salt/profile/fish.sls @@ -0,0 +1,18 @@ +fish_package: + pkg.installed: + - name: fish + +fish_files: + file.recurse: + - clean: true + - names: + - /etc/fish/conf.d: + - source: salt://files/etc/fish/conf.d + - /home/georg/.config/fish: + - source: salt://files/home/georg/.config/fish + - exclude_pat: + # empty + - completions + - conf.d + # I set exported variables in config.fish, this hence mostly contains universal default variables + - fish_variables