-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot_profile
43 lines (36 loc) · 954 Bytes
/
dot_profile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/sh
export ENV="${HOME}/.shrc"
export XDG_CACHE_HOME="${HOME}/.cache"
export XDG_CONFIG_HOME="${HOME}/.config"
export XDG_STATE_HOME="${HOME}/.local/state"
export ZDOTDIR="${XDG_CONFIG_HOME}/zsh"
mkdir -p "${XDG_STATE_HOME}"
if [ -n "${SSH_CLIENT}" -a "${TERM}" = "foot" ]; then
export TERM="xterm-256color"
fi
has() {
command -v "$1" 1>/dev/null
}
if has ssh-agent && [ -z "${SSH_AGENT_PID}" ]; then
eval "$(ssh-agent -s)" > /dev/null
fi
try_exec_dbus() {
local _cmd=$1; shift
local _log="${XDG_STATE_HOME}/${_cmd##*/}.log"
has "$_cmd" || return 1
if has dbus-run-session; then
exec dbus-run-session -- "$_cmd" "$@" 1>"$_log" 2>&1
else
exec "$_cmd" "$@" 1>"$_log" 2>&1
fi
}
exec_sway() {
export MOZ_ENABLE_WAYLAND="1"
export QT_QPA_PLATFORM="wayland-egl"
export XDG_CURRENT_DESKTOP="sway"
try_exec_dbus "${HOME}/swayfx/build/sway/sway"
try_exec_dbus sway
}
case "$TTY" in
"/dev/tty1") exec_sway;;
esac