summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Reichel <sre@ring0.de>2015-12-06 10:53:08 +0100
committerSebastian Reichel <sre@ring0.de>2015-12-06 10:53:08 +0100
commit0bea503b99cd203c9ababb23651abfaf3fb6ccc6 (patch)
treea150f78fc86c5ababe495b10b80f23cfd8be8da2
parentf8fdda1d88787e56fe5f1b711e3fa5300441eee2 (diff)
downloadzsh-config-0bea503b99cd203c9ababb23651abfaf3fb6ccc6.tar.bz2
modify terminal icon based on running command
-rw-r--r--zshrc41
1 files changed, 41 insertions, 0 deletions
diff --git a/zshrc b/zshrc
index 7d7b624..a6c3633 100644
--- a/zshrc
+++ b/zshrc
@@ -155,6 +155,47 @@ chpwd_functions=( ${chpwd_functions} chpwd_profiles )
function precmd {
vcs_info
title "%n@%m %~"
+
+ if [ $TMUX ] ; then
+ export `tmux showenv WINDOWID`
+ fi
+
+ if [[ "x$WINDOWID" != "x" ]] ; then
+ xseticon -id $WINDOWID "/usr/share/pixmaps/terminal-tango.png"
+ fi
+}
+
+function preexec {
+ title "$1"
+ if [ "x$WINDOWID" = "x" ] ; then
+ return 0
+ fi
+
+ if [[ "$1" == "mutt" ]] ; then
+ xseticon -id $WINDOWID "/usr/share/icons/Tango/22x22/apps/email.png"
+ elif [[ `echo "$1" | grep "vim"` != "" ]] ; then
+ xseticon -id $WINDOWID "/usr/share/pixmaps/vim-32.png"
+ elif [[ `echo "$1" | grep "ssh"` != "" ]] ; then
+ xseticon -id $WINDOWID "/usr/share/pixmaps/openssh.png"
+ elif [[ `echo "$1" | grep "apt-get "` != "" ]] ; then
+ xseticon -id $WINDOWID "/usr/share/icons/Tango/22x22/apps/system-installer.png"
+ elif [[ `echo "$1" | grep "mpv"` != "" ]] ; then
+ xseticon -id $WINDOWID "/usr/share/icons/hicolor/32x32/apps/mpv.png"
+ elif [[ `echo "$1" | grep "mpa "` != "" ]] ; then
+ xseticon -id $WINDOWID "/usr/share/icons/hicolor/32x32/apps/mpv.png"
+ elif [[ "$1" == "htop" ]] ; then
+ xseticon -id $WINDOWID "/usr/share/pixmaps/htop.png"
+ elif [[ `echo "$1" | grep "make"` != "" ]] ; then
+ xseticon -id $WINDOWID "/usr/share/icons/gnome/24x24/categories/package_development.png"
+ elif [[ `echo "$1" | grep "git-pbuilder"` != "" ]] ; then
+ xseticon -id $WINDOWID "/usr/share/icons/gnome/24x24/categories/package_development.png"
+ elif [[ `echo "$1" | grep "gbp buildpackage"` != "" ]] ; then
+ xseticon -id $WINDOWID "/usr/share/icons/gnome/24x24/categories/package_development.png"
+ elif [[ `echo "$1" | grep "git "` != "" ]] ; then
+ xseticon -id $WINDOWID "/usr/share/pixmaps/git.png"
+ elif [[ "$1" == "cusb" ]] ; then
+ xseticon -id $WINDOWID "/usr/share/pixmaps/serial.png"
+ fi
}
# menus for mutt and less