X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=.bashrc;h=814c9af63136b822811da9ba20c1af02beaa1ff4;hb=refs%2Fheads%2Fmaster;hp=0376fd6796dc15e51b99e49d3360c43761e473c8;hpb=f27b67a1dfa58b5f101bba607b2f91a73e65299e;p=distro-setup diff --git a/.bashrc b/.bashrc index 0376fd6..ac78814 100644 --- a/.bashrc +++ b/.bashrc @@ -55,6 +55,17 @@ HISTIGNORE='pass *:otp *:oathtool *:histrm *' umask 022 +if [[ $EUID == 1000 && $TERM == linux && ! $DISPLAY && $(tty) = /dev/tty1 && -x /usr/bin/startx ]]; then + if tmp=$(systemctl status |& head) && \ + grep -qi '^ *state: running' <<<"$tmp" && grep -qi '^ *failed: 0' <<<"$tmp" && grep -qi '^ *jobs: 0' <<<"$tmp"; then + startx + else + echo "systemctl status |& head:" + printf "%s\n" "$tmp" + echo: systemctl list-jobs: + systemctl list-jobs + fi +fi #### if (in # noninteractive ssh shells or tty). tty because often i use it when @@ -129,7 +140,7 @@ return 0 # Automatically added by the Guix install script. if [ -n "$GUIX_ENVIRONMENT" ]; then - if [[ $PS1 =~ (.*)"\\$" ]]; then - PS1="${BASH_REMATCH[1]} [env]\\\$ " - fi + if [[ $PS1 =~ (.*)"\\$" ]]; then + PS1="${BASH_REMATCH[1]} [env]\\\$ " + fi fi