From 79eff7c7dceec168cdeb23c894df43bff4c17d13 Mon Sep 17 00:00:00 2001 From: Mehdi Sadeghi Date: Wed, 9 Jun 2021 18:34:27 +0200 Subject: Update prompt. Switch to firefox. --- .bashrc | 7 ++++++- .local/bin/prompt | 2 +- .local/bin/xdg-open | 3 +-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.bashrc b/.bashrc index 40db5eb..59e36f0 100644 --- a/.bashrc +++ b/.bashrc @@ -1,7 +1,7 @@ [ -n "$ENV" ] && . "$ENV" || [ -e ~/.env ] && . ~/.env # Prompt for Bash -export PS1="\[\033[1;33m\]\u@\h:\W\$ \[\033[0m\]" +export PS1='\[\033[1;33m\]$(prompt)\[\033[0m\]' # Verify before running history command shopt -s histverify @@ -29,3 +29,8 @@ _direnv_hook() { if ! [[ "${PROMPT_COMMAND:-}" =~ _direnv_hook ]]; then PROMPT_COMMAND="_direnv_hook${PROMPT_COMMAND:+;$PROMPT_COMMAND}" fi + +alias gl='git pull' +alias gcm='git checkout master' +alias gco='git checkout' +alias gst='git status' diff --git a/.local/bin/prompt b/.local/bin/prompt index 90e3a17..0118ae8 100755 --- a/.local/bin/prompt +++ b/.local/bin/prompt @@ -1,7 +1,7 @@ #!/bin/sh BRANCH=$(git branch --show-current 2>/dev/null) BRANCH=$(test -d .git && test -n $BRANCH && echo "($BRANCH)") -PROMPT="[$(hostname):$(basename "$PWD")$BRANCH]" +PROMPT="$USER@$(hostname):$( test $PWD = $HOME && echo '~' || basename "$PWD")$BRANCH" case $(id -u) in 0) echo "$PROMPT# " ;; *) echo "$PROMPT$ " ;; diff --git a/.local/bin/xdg-open b/.local/bin/xdg-open index 206fb96..be0f8e1 100755 --- a/.local/bin/xdg-open +++ b/.local/bin/xdg-open @@ -1,8 +1,7 @@ #!/bin/sh -# Courtesy of https://drewdevault.com/2019/12/30/dotfiles.html case "${1%%:*}" in http|https|*.pdf) - exec qutebrowser "$1" + exec firefox "$1" ;; mailto) exec aerc "$1" -- cgit v1.2.3