summaryrefslogtreecommitdiff
path: root/etc/functions
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-05-03 17:12:27 +0200
committerDaniel Friesel <derf@finalrewind.org>2011-05-03 17:12:27 +0200
commit4c905dfd1f0c754da7aff5e8bc01c1254b92f99f (patch)
treeb8b1503ea78978da98df55e1967500a444f5211e /etc/functions
parent0cfbfed70a9f7ec242957ec1dd95dd753859948d (diff)
Add invert-colours function
Diffstat (limited to 'etc/functions')
-rw-r--r--etc/functions/invert-colours5
1 files changed, 5 insertions, 0 deletions
diff --git a/etc/functions/invert-colours b/etc/functions/invert-colours
new file mode 100644
index 0000000..cf2a909
--- /dev/null
+++ b/etc/functions/invert-colours
@@ -0,0 +1,5 @@
+if [[ ${PS1} == '%F{black}'* ]] {
+ PS1=${${${PS1//\%K/%F}//white/default}#\%K\{black\}}
+} else {
+ PS1='%F{black}'${${PS1//\%F/%K}//default/white}
+}