more fixed environment and simplify prompt

This commit is contained in:
Felix Van der Jeugt 2020-12-04 14:39:48 +01:00
parent 3ef84f0e1e
commit 60402f641f
No known key found for this signature in database
GPG Key ID: 58B209295023754D
2 changed files with 5 additions and 14 deletions

View File

@ -7,6 +7,7 @@ export XDG_CACHE_HOME="$HOME/.cache"
export XDG_RUNTIME_DIR="/tmp/runtime-$(whoami)"
mkdir -p "$XDG_RUNTIME_DIR"
chmod 0700 "$XDG_RUNTIME_DIR"
export XDG_DOWNLOAD_DIR="/tmp"
# Local scripts
export CABAL_HOME="$HOME/.cabal"
@ -25,6 +26,7 @@ export FZF_DEFAULT_COMMAND='(git ls-files -co --exclude-standard || rg --files)
export SKIM_DEFAULT_COMMAND='(git ls-files -co --exclude-standard || rg --files) 2> /dev/null'
export LC_ALL=en_US.utf8
export BOGOFILTER_DIR="$XDG_DATA_HOME/bogofilter"
export TERMINAL=st
# Select Dock sound card if it's there
#(it's broken)
@ -33,10 +35,3 @@ if [ -e /proc/asound/Dock ]; then
fi
#stty -ixon # disable <C-s>
# Start X if we're in tty1
if tty | grep -q '/dev/tty1'; then
startx 2>&1 || vlock
#sudo poweroff
#sleep infinity
fi

10
yashrc
View File

@ -21,8 +21,8 @@ prompt_git() {
porcelain="$(git status --branch --porcelain 2>/dev/null)"
if test "$?" = 0; then
local branch="$(printf '%s' "$porcelain" | sed -n 's/\.\.\..*//;1s/## //p')"
local behind="$(printf '%s' "$porcelain" | sed -n '1s/## .*behind \([0-9]*\).*/\1/p')"
local ahead="$(printf '%s' "$porcelain" | sed -n '1s/## .*ahead \([0-9]*\).*/\1/p')"
local behind="$(printf '%s' "$porcelain" | sed -n '1s/## .*behind \([0-9]*\).*/-\1/p')"
local ahead="$(printf '%s' "$porcelain" | sed -n '1s/## .*ahead \([0-9]*\).*/+\1/p')"
local status="$({ echo OK; printf '%s' "$porcelain" | sed '/##/d;s/\(..\).*/\1/'; } | tail -1)"
echo " (${branch}${behind}${ahead}|${status})"
@ -34,10 +34,6 @@ prompt_pwd() {
prompt_agent() {
[ -z "$SSH_AGENT_PID" ] || echo " (A)"
}
prompt_mail() {
unread="$(notmuch count tag:unread)"
[ "$unread" = "0" ] || echo " ($unread mails)"
}
prompt_status() {
if [ "$?" = "0" ]
then echo "$"
@ -50,7 +46,7 @@ prompt_date() {
BOLD="\fo."
GREEN="\fg."
RESET="\fD."
PS1="$BOLD[\$(ks prompt_date)]$RESET $GREEN\$(ks prompt_pwd)$RESET\$(ks prompt_git)\$(ks prompt_agent)\$(ks prompt_mail) \$(prompt_status) "
PS1="$BOLD[\$(ks prompt_date)]$RESET $GREEN\$(ks prompt_pwd)$RESET\$(ks prompt_git)\$(ks prompt_agent) \$(prompt_status) "
unset BOLD
unset GREEN
unset RESET