From 29f2f6f61a7a0b90518375da042b0343069a7d48 Mon Sep 17 00:00:00 2001
From: Alfred Burgess <aburgess@ucc.asn.au>
Date: Sun, 16 Jun 2024 14:45:55 +1000
Subject: [PATCH] Updated shell prompt and moved screenshot directory

---
 sway/config   |  3 ++-
 zsh/zsh_alias |  1 +
 zsh/zshrc     | 32 +++++++++++++++++++++++++++++---
 3 files changed, 32 insertions(+), 4 deletions(-)

diff --git a/sway/config b/sway/config
index 2ced693..bbd2141 100644
--- a/sway/config
+++ b/sway/config
@@ -26,6 +26,7 @@ set $lockscreen swaylock -F
 
 # Wallpaper Daemon
 exec --no-startup-id swww-daemon
+exec_always --no-startup-id swww-haven set
 
 # Notification Daemon
 exec --no-startup-id swaync
@@ -33,7 +34,7 @@ exec --no-startup-id swaync
 bindsym $mod+Shift+n exec swaync-client -t -sw
 
 # Take Screenshot
-set $screenshot grim $(xdg-user-dir PICTURES)/$(date +'%s_screenshot.png')
+set $screenshot grim $(xdg-user-dir PICTURES)/.screenshots/$(date +'%s_screenshot.png')
 bindsym Print exec $screenshot
 
 # Default Caps lock off and num-lock on
diff --git a/zsh/zsh_alias b/zsh/zsh_alias
index 50a58ea..2fd0d03 100644
--- a/zsh/zsh_alias
+++ b/zsh/zsh_alias
@@ -1,3 +1,4 @@
+alias cgrep='grep'
 alias grep='grep --color -n'
 
 alias ll='ls -l'
diff --git a/zsh/zshrc b/zsh/zshrc
index 0cd3c62..5ffac00 100644
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -5,6 +5,8 @@ alias ls='ls --color'
 
 alias cls="clear"
 
+CMD_PROMPT_TIME_SHOW=0
+
 # History Management
 HISTCONTROL=ignoreboth
 HISTFILE=~/.zsh_history
@@ -20,6 +22,7 @@ setopt HIST_IGNORE_SPACE         # Do not record an event starting with a space.
 setopt HIST_SAVE_NO_DUPS         # Do not write a duplicate event to the history file.
 setopt SHARE_HISTORY             # Share history between all sessions.
 setopt APPENDHISTORY		 # ensures that each command entered in the current session is appended to the history file immediately after execution
+setopt INC_APPEND_HISTORY_TIME   # ensure execution time is stored
 # END HISTORY
 
 # Command Completion
@@ -28,9 +31,28 @@ compinit
 zstyle ':completion:*' menu select
 
 # Prompt
-autoload -Uz promptinit
-promptinit
-prompt adam1
+autoload -Uz vcs_info
+function preexec() { timer=${timer:-$SECONDS} }
+precmd() {
+  vcs_info
+  if [ $vcs_info_msg_0_ ]; then
+    vcs_info_msg_0_="î‚ ${vcs_info_msg_0_}"
+  fi
+  
+  if [ $timer ]; then
+    timer_show=$(($SECONDS - $timer))
+    if [ $timer_show -ge $CMD_PROMPT_TIME_SHOW ]; then
+      export RPROMPT="%F{yellow}${timer_show}s %{$reset_color%}"
+    else
+      export RPROMPT="%{$reset_color%}"
+    fi
+    unset timer
+  fi
+}
+zstyle ':vcs_info:*' enable git svn hg
+setopt PROMPT_SUBST
+PROMPT=$'%F{green}%?%f %F{cyan}%B%~%b%f %F{red}${vcs_info_msg_0_}%f %# '
+
 
 # Make less more friendly for non-text files; see lesspipe(1)
 export PAGER=less
@@ -66,3 +88,7 @@ resource() { source $(xdg-user-dir)/.zshrc }
 
 # Created by `pipx` on 2024-06-03 12:10:22
 export PATH="$PATH:/home/aburgess/.local/bin"
+
+# Add KDE Wallet to manage SSH Keys
+export SSH_ASKPASS=/usr/bin/ksshaskpass
+export SSH_ASKPASS_REQUIRE=prefer
-- 
GitLab