aboutsummaryrefslogtreecommitdiff
path: root/runcoms/zlogin
diff options
context:
space:
mode:
Diffstat (limited to 'runcoms/zlogin')
-rw-r--r--runcoms/zlogin25
1 files changed, 25 insertions, 0 deletions
diff --git a/runcoms/zlogin b/runcoms/zlogin
new file mode 100644
index 0000000..8af0975
--- /dev/null
+++ b/runcoms/zlogin
@@ -0,0 +1,25 @@
+#
+# Executes commands at login post-zshrc.
+#
+# Authors:
+# Sorin Ionescu <sorin.ionescu@gmail.com>
+#
+
+# Execute code that does not affect the current session in the background.
+{
+ # Compile the completion dump to increase startup speed.
+ zcompdump="${ZDOTDIR:-$HOME}/.zcompdump"
+ if [[ -s "$zcompdump" && (! -s "${zcompdump}.zwc" || "$zcompdump" -nt "${zcompdump}.zwc") ]]; then
+ zcompile "$zcompdump"
+ fi
+} &!
+
+# Print a random, hopefully interesting, adage.
+if (( $+commands[fortune] )); then
+ echo -en "\033[30m"
+ if [[ -t 0 || -t 1 ]]; then
+ fortune -s
+ print
+ fi
+ echo -en "\033[m"
+fi