From 4c905dfd1f0c754da7aff5e8bc01c1254b92f99f Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 3 May 2011 17:12:27 +0200 Subject: Add invert-colours function --- etc/.zshrc | 2 +- etc/functions/invert-colours | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 etc/functions/invert-colours diff --git a/etc/.zshrc b/etc/.zshrc index 8dad07a..cc3ea3b 100644 --- a/etc/.zshrc +++ b/etc/.zshrc @@ -398,7 +398,7 @@ alias remake='make clean; make && sudo make install' alias rsync-serve="rsync --daemon --port=10873 --no-detach --config=/dev/stdin"\ " --log-file=/dev/stdout -v <<< $'[.]\n\tpath = .\n\tuse chroot = no'" -alias scanto='convert =(sudo scanimage -p -d hp4200:libusb:002:002)' +alias scanto='convert =(sudo scanimage -p -d hp4200:libusb:003:003)' alias x='unsetopt bg_nice; startx &! exit' 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} +} -- cgit v1.2.3