cbf662744ffcf998829cabbd7b2550861c13d1d8

Author
fox <fox91@anche.no>
Committer
fox <fox91@anche.no>
Date

Message

fixed theme chooser + options + list available themes + show all themes

Diff

This diff is truncated to protect this page.

 1diff --git a/tools/theme_chooser.sh b/tools/theme_chooser.sh
 2index ea5191afed52e951b670f1bebb66ece8bdfa3bab..4d7047444c4073d2e84215ced93b7952c56f8f40 100755
 3--- a/tools/theme_chooser.sh
 4+++ b/tools/theme_chooser.sh
 5@@ -1,4 +1,4 @@
 6-#!/bin/sh
 7+#!/bin/zsh
 8 
 9 # Zsh Theme Chooser by fox (fox91 at anche dot no)
10 # This program is free software. It comes without any warranty, to
11@@ -9,9 +9,10 @@
12 
13 THEMES_DIR="$ZSH/themes"
14 FAVLIST="${HOME}/.zsh_favlist"
15+source $ZSH/oh-my-zsh.sh
16 
17 function noyes() {
18-    read -p "$1 [y/N] " a
19+    read "a?$1 [y/N] "
20     if [[ $a == "N" || $a == "n" || $a = "" ]]; then
21         return 0
22     fi
23@@ -20,29 +21,76 @@ function noyes() {
24 
25 function theme_preview() {
26     THEME=$1
27-    THEME_NAME=`echo $THEME | sed s/\.zsh-theme//`
28-    export ZDOTDIR="$(mktemp -d tmp.zshXXXX)"
29-
30-cat <<-EOF >"$ZDOTDIR/.zshrc"
31-    ZSH_THEME="$THEME_NAME"
32-    source $ZSH/oh-my-zsh.sh
33-EOF
34-    zsh
35-    rm -rf "$ZDOTDIR"
36+    THEME_NAME=`echo $THEME | sed s/\.zsh-theme$//`
37+    print "$fg[blue]${(l.((${COLUMNS}-${#THEME_NAME}-5))..─.)}$reset_color $THEME_NAME $fg[blue]───$reset_color"
38+    source "$THEMES_DIR/$THEME"
39+    print -P $PROMPT
40+}
41 
42+function banner() {
43     echo
44-    noyes "Do you want to add it to your favourite list ($FAVLIST)?" || \
45-          echo $THEME_NAME >> $FAVLIST