# 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 ]]; 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
# 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