From 4048e16bbe9c3d172b07dad919df29f4d760c345 Mon Sep 17 00:00:00 2001 From: thek4n Date: Mon, 10 Nov 2025 00:28:45 +0300 Subject: [PATCH] refactor --- home/user/.config/zsh/.zprofile | 17 +++++++++++++---- home/user/.zshenv | 1 + 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/home/user/.config/zsh/.zprofile b/home/user/.config/zsh/.zprofile index c20bdb0..50f7bac 100644 --- a/home/user/.config/zsh/.zprofile +++ b/home/user/.config/zsh/.zprofile @@ -1,9 +1,18 @@ -if [[ "$TTY" =~ /dev/tty* ]]; then +if [[ "${TTY}" =~ /dev/tty* ]]; then setterm -blength=0 setfont cyr-sun16 fi -if [[ "$TTY" = "/dev/tty1" ]] && [[ $XDG_VTNR -eq 1 ]] && [[ -z $DISPLAY ]] && systemctl -q is-active graphical.target; then - exec startx >> ~/.xlogs 2>&1 -fi \ No newline at end of file +if [ "${TTY}" = "/dev/tty1" ] && [ "${XDG_VTNR}" -eq 1 ] && [ -z "${DISPLAY}" ] && systemctl -q is-active graphical.target; then + x11_dir="${XDG_STATE_HOME:-${HOME}/.local/state}/x11" + mkdir -p "${x11_dir}" + exec startx >> "${x11_dir}/x11.log" 2>&1 + +fi + +# if [ "${TTY}" = "/dev/tty1" ] && systemctl -q is-active graphical.target; then +# wayland_dir="${XDG_STATE_HOME:-${HOME}/.local/state}/wayland" +# mkdir -p "${wayland_dir}" +# exec sway --unsupported-gpu >> "${wayland_dir}/sway.log" 2>&1 +# fi diff --git a/home/user/.zshenv b/home/user/.zshenv index 4bcc927..82b62b2 100644 --- a/home/user/.zshenv +++ b/home/user/.zshenv @@ -6,6 +6,7 @@ umask 022 export XDG_RUNTIME_DIR="/run/user/$(id -u)" export XDG_CONFIG_HOME="${HOME}/.config" export XDG_DATA_HOME="${HOME}/.local/share" +export XDG_STATE_HOME="${HOME}/.local/state" export ZDOTDIR="${XDG_CONFIG_HOME}/zsh" for TMPDIR in "${TMPDIR}" "${TMP}" /tmp /var/tmp