a7f5170d68c0b75a9864763a90ac11e51ec67c81

Author
Marc Cornellà <marc.cornella@live.com>
Committer
Marc Cornellà <marc.cornella@live.com>
Date

Message

Remove perl dependency

Diff

 1diff --git a/plugins/timer/timer.plugin.zsh b/plugins/timer/timer.plugin.zsh
 2index 1be7516a3a82b4424d5007b5095ae154aeaf9f17..b261f71c58ddfdd9eb80de14546d63f783d8b91a 100644
 3--- a/plugins/timer/timer.plugin.zsh
 4+++ b/plugins/timer/timer.plugin.zsh
 5@@ -1,5 +1,8 @@
 6+zmodload zsh/datetime
 7+
 8 __timer_current_time() {
 9-  perl -MTime::HiRes=time -e'print time'
10+  zmodload zsh/datetime
11+  echo $EPOCHREALTIME
12 }
13 
14 __timer_format_duration() {
15diff --git a/themes/fishy.zsh-theme b/themes/fishy.zsh-theme
16index 00a60f45b15777abcff847669a602bb0c164d797..f6dae61818022742de53528c38bd7111919252bb 100644
17--- a/themes/fishy.zsh-theme
18+++ b/themes/fishy.zsh-theme
19@@ -1,12 +1,15 @@
20 # ZSH Theme emulating the Fish shell's default prompt.
21 
22 _fishy_collapsed_wd() {
23-  echo $(pwd | perl -pe '
24-   BEGIN {
25-      binmode STDIN,  ":encoding(UTF-8)";
26-      binmode STDOUT, ":encoding(UTF-8)";
27-   }; s|^$ENV{HOME}|~|g; s|/([^/.])[^/]*(?=/)|/$1|g; s|/\.([^/])[^/]*(?=/)|/.$1|g
28-')
29+  local -a pwd=("${(s:/:)PWD/#$HOME/~}")
30+  for i in {1..$(($#pwd-1))}; do
31+    if [[ "$pwd[$i]" = .* ]]; then
32+      pwd[$i]="${${pwd[$i]}[1,2]}"
33+    else
34+      pwd[$i]="${${pwd[$i]}[1]}"
35+    fi
36+  done
37+  echo "${(j:/:)pwd}"
38 }
39 
40 local user_color='green'; [ $UID -eq 0 ] && user_color='red'
41diff --git a/themes/trapd00r.zsh-theme b/themes/trapd00r.zsh-theme
42index 7a589a699f47820893a49bf9850b6e8cda307d59..4e32383939b87267370b7d1edab12d5ea3c3da19 100644
43--- a/themes/trapd00r.zsh-theme
44+++ b/themes/trapd00r.zsh-theme
45@@ -2,7 +2,7 @@
46 #
47 # This theme needs a terminal supporting 256 colors as well as unicode.
48 # In order to avoid external dependencies, it also has a zsh version of
49-# the perl script at https://github.com/trapd00r/utils/blob/master/zsh_path,
50+# the previously used perl script https://github.com/trapd00r/utils/blob/master/zsh_path,
51 # which splits up the current path and makes it fancy.
52 #
53 # By default it spans over two lines like so: