]> arthur.barton.de Git - ax-zsh.git/blobdiff - default_plugins/byebye/byebye.zlogout
Don't hardcode default plugins, read them from ./default_plugins/
[ax-zsh.git] / default_plugins / byebye / byebye.zlogout
diff --git a/default_plugins/byebye/byebye.zlogout b/default_plugins/byebye/byebye.zlogout
new file mode 100644 (file)
index 0000000..06df9c5
--- /dev/null
@@ -0,0 +1,15 @@
+# AX-ZSH: Alex' Modular ZSH Configuration
+# byebye.zlogout -- Say goodbye to interactive users
+
+[[ -o interactive ]] || return
+
+# Clear the console if it is a local terminal
+case `tty` in
+    /dev/tty[0-9]*|/dev/ttyS[0-9]*)
+       [[ -x /usr/bin/clear_console ]] \
+               && /usr/bin/clear_console --quiet \
+               || clear
+       ;;
+    *)
+       echo "Bye, bye, $LOGNAME!"
+esac