diff options
author | Robby Russell <robby@planetargon.com> | 2012-12-02 12:50:40 -0800 |
---|---|---|
committer | Robby Russell <robby@planetargon.com> | 2012-12-02 12:50:40 -0800 |
commit | d19e01b14086319abae80e7624a8192025e88572 (patch) | |
tree | 32d1358247b1b832f0515bf53567adfbccb0d3e5 /plugins/themes/themes.plugin.zsh | |
parent | 275e7cba8f2d02a650ff723f1c1e200e43a6dabb (diff) | |
parent | f7b1615b7cd6cd2088050a29f43650098eaba514 (diff) | |
download | zsh-d19e01b14086319abae80e7624a8192025e88572.tar.gz zsh-d19e01b14086319abae80e7624a8192025e88572.tar.bz2 zsh-d19e01b14086319abae80e7624a8192025e88572.zip |
Merge pull request #1191 from r-darwish/themes-plugin
Themes plugin
Diffstat (limited to 'plugins/themes/themes.plugin.zsh')
-rw-r--r-- | plugins/themes/themes.plugin.zsh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/plugins/themes/themes.plugin.zsh b/plugins/themes/themes.plugin.zsh new file mode 100644 index 000000000..8bab257ea --- /dev/null +++ b/plugins/themes/themes.plugin.zsh @@ -0,0 +1,24 @@ +function theme +{ + if [ "$1" = "random" ]; then + themes=($ZSH/themes/*zsh-theme) + N=${#themes[@]} + ((N=(RANDOM%N)+1)) + RANDOM_THEME=${themes[$N]} + source "$RANDOM_THEME" + echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..." + else + if [ -f "$ZSH_CUSTOM/$1.zsh-theme" ] + then + source "$ZSH_CUSTOM/$1.zsh-theme" + else + source "$ZSH/themes/$1.zsh-theme" + fi + fi +} + +function lstheme +{ + cd $ZSH/themes + ls *zsh-theme | sed 's,\.zsh-theme$,,' +} |