aboutsummaryrefslogtreecommitdiff
path: root/config/fish/functions/fish_greeting.fish
diff options
context:
space:
mode:
authorWilliam Hergès <william@herges.fr>2025-08-12 15:25:14 +0200
committerWilliam Hergès <william@herges.fr>2025-08-12 15:25:14 +0200
commitab93bfa16d109a09d49e35e77e7fb2634f8bb0c1 (patch)
treeaa0efb33e3bc78b6612e3041b93cc9f58f593d38 /config/fish/functions/fish_greeting.fish
parent90fe253c51355e66f1a87c8478cf04c36a4d58f0 (diff)
feat(config): fish
Diffstat (limited to 'config/fish/functions/fish_greeting.fish')
-rw-r--r--config/fish/functions/fish_greeting.fish21
1 files changed, 21 insertions, 0 deletions
diff --git a/config/fish/functions/fish_greeting.fish b/config/fish/functions/fish_greeting.fish
new file mode 100644
index 0000000..8e20ca8
--- /dev/null
+++ b/config/fish/functions/fish_greeting.fish
@@ -0,0 +1,21 @@
+function fish_greeting
+ if not set -q fish_greeting
+ set -l line1 (printf (_ 'Welcome to %sanhgelus-void%s.') (set_color "#95d5b2" green) (set_color normal))
+ set -l line2 \n(printf (_ 'Workstation powered by the %svoid%s.') (set_color green) (set_color normal))
+ set -g fish_greeting "$line1$line2"
+ end
+
+ if set -q fish_private_mode
+ set -l line (_ "fish is running in private mode, history will not be persisted.")
+ if set -q fish_greeting[1]
+ set -g fish_greeting $fish_greeting\n$line
+ else
+ set -g fish_greeting $line
+ end
+ end
+
+ # The greeting used to be skipped when fish_greeting was empty (not just undefined)
+ # Keep it that way to not print superfluous newlines on old configuration
+ test -n "$fish_greeting"
+ and echo $fish_greeting
+end