From 0146107851a7f6a05b1a2146e275b631edf20338 Mon Sep 17 00:00:00 2001
From: Timmy Keller <tjk@tjkeller.xyz>
Date: Thu, 3 Nov 2022 11:55:33 -0500
Subject: idk

---
 zsh/zscripts/aliasrc.zsh      | 7 ++++++-
 zsh/zscripts/termuxprompt.zsh | 8 ++++++++
 zsh/zscripts/zplug.zsh        | 6 +++---
 zsh/zshrc                     | 2 +-
 4 files changed, 18 insertions(+), 5 deletions(-)
 create mode 100755 zsh/zscripts/termuxprompt.zsh

(limited to 'zsh')

diff --git a/zsh/zscripts/aliasrc.zsh b/zsh/zscripts/aliasrc.zsh
index 308690d..8d2f86b 100755
--- a/zsh/zscripts/aliasrc.zsh
+++ b/zsh/zscripts/aliasrc.zsh
@@ -6,10 +6,11 @@ typeset -A repaliases=(
 	htop	htim
 	mutt	neomutt
 	vim	nvim
-	sudo	"$SUDO"
+	sudo	"${SUDO:- }"
 )
 for alias rep in ${(kv)repaliases}; do command -v $rep >/dev/null && alias $alias=$rep; done # Tests if replacement exists before creating alias
 
+
 # Shorten program names
 alias \
 	open="xdg-open" \
@@ -63,3 +64,7 @@ alias \
 	mbsync="mbsync --config $MBSYNCRC" \
 	startx="startx $X11CONFIG/xinitrc" \
 
+# Copy-pasting from internet
+alias \
+	\$="" \
+	\#="${SUDO-sudo}" \
diff --git a/zsh/zscripts/termuxprompt.zsh b/zsh/zscripts/termuxprompt.zsh
new file mode 100755
index 0000000..1442cc8
--- /dev/null
+++ b/zsh/zscripts/termuxprompt.zsh
@@ -0,0 +1,8 @@
+#!/usr/bin/env zsh
+
+if [ -n "$TERMUX_VERSION" ]; then
+	PS1="%B%F{green}[%F{blue}%U%~%u%F{green}]%f%b%(!.#.$) "
+	PS1OVERRIDE=1
+	export ZPLUGINSDIR=~/.local/share/zsh/zplugins
+	export ZPLUGNOROOT=1
+fi
diff --git a/zsh/zscripts/zplug.zsh b/zsh/zscripts/zplug.zsh
index 587a8c0..b3eff09 100755
--- a/zsh/zscripts/zplug.zsh
+++ b/zsh/zscripts/zplug.zsh
@@ -1,12 +1,12 @@
 #!/usr/bin/env zsh
 
 local zplugs="${ZDOTDIR:-~/.}${ZDOTDIR:+/}zplugs" # Declare all variables using `local` to keep them away from the interactive shell
-local zplugins="${ZPLUGINSDIR:-/usr/local/share/zsh/zplugins}"
-[[ $EUID != 0 ]] && local sudo=${SUDO-sudo}
+local zplugins="${ZPLUGINSDIR:-/usr/local/share/zsh/zplugins}" # TODO set default dir if zplugnoroot
+[[ $EUID != 0 ]] && [ -z "$ZPLUGNOROOT" ] && local sudo=${SUDO-sudo}
 
 function __zplugInstall() {
 	touch "$zplugs"
-	local pluglist=( `grep -v '#' "$zplugs"` )
+	local pluglist=( `\grep -v '#' "$zplugs"` )
 	local confirm plug
 	shift
 	for plug in "$@"; do; pluglist+=(${plug}); done
diff --git a/zsh/zshrc b/zsh/zshrc
index e57b70d..7f2c51c 100755
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -5,7 +5,7 @@ for zscript in "$XDG_CONFIG_HOME/zsh/zscripts"{/[^\!]*.zsh,/hosts/*.$HOST.zsh,/!
 
 # Colors! + Prompt
 autoload -U colors && colors
-PS1="%B%F{${colbr:-red}}[%F{${colname:-yellow}}%n%F{${colat:-green}}@%F{${colhost:-blue}}%m %F{${coldir:-magenta}}%U%~%u%F{${colbr:-red}}]%f%b%(!.#.$) "
+[ -z "$PS1OVERRIDE" ] && PS1="%B%F{${colbr:-red}}[%F{${colname:-yellow}}%n%F{${colat:-green}}@%F{${colhost:-blue}}%m %F{${coldir:-magenta}}%U%~%u%F{${colbr:-red}}]%f%b%(!.#.$) "
 
 # Cd settings
 setopt AUTO_CD			# `cd` is implied
-- 
cgit v1.2.3