# See the License for the specific language governing permissions and
# limitations under the License.
+# shellcheck disable=SC2317
# to debug
#set -x
umask 022
+if [[ $EUID == 1000 && $TERM == linux && ! $DISPLAY && $(tty) = /dev/tty1 && -x /usr/bin/startx ]] && \
+ tmp=$(systemctl status |& head) && \
+ grep -qi '^ *state: running' <<<"$tmp" && grep -qi '^ *failed: 0' <<<"$tmp" && grep -qi '^ *jobs: 0' <<<"$tmp"; then
+ startx
+fi
#### if (in
# noninteractive ssh shells or tty). tty because often i use it when
# 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