Files
dotfiles/zsh/zprofile.j2

85 lines
1.9 KiB
Plaintext
Raw Normal View History

2021-10-03 22:33:28 +02:00
source /etc/profile
2024-04-22 14:11:19 +02:00
if [[ "$(passwd --status $USER | awk '{print $2}')" =~ ^(NP|L)$ ]] ; then
2024-04-25 08:01:17 +02:00
while ! sudo passwd $USER ; do ; done
2024-04-22 14:11:19 +02:00
fi
2021-10-03 22:33:28 +02:00
_path=(
"$HOME/bin"
2021-10-31 12:51:56 +01:00
"$HOME/.cargo/bin"
2021-10-03 22:33:28 +02:00
)
2017-09-09 14:39:39 +02:00
for part in ${_path[@]} ; do
2022-01-04 18:13:28 +01:00
PATH="${part}:$PATH"
2015-09-25 16:25:48 +02:00
done
export PATH
2014-11-07 17:37:04 +01:00
2024-04-10 14:41:54 +02:00
export EDITOR="helix"
export VISUAL="helix"
2018-01-29 13:15:50 +01:00
export BROWSER="firefox"
2014-11-07 17:37:04 +01:00
2016-05-10 11:58:20 +02:00
export PAGER="less"
export LESS="FRX"
2016-05-10 11:58:20 +02:00
2016-04-11 01:17:50 +02:00
export LANG=en_US.UTF-8
export LC_TIME=de_DE.UTF-8
2016-04-10 23:54:58 +02:00
export LC_COLLATE=C
2021-10-03 15:48:38 +02:00
export GOPATH=~/.go
2018-08-12 14:31:14 +02:00
export PATH=$PATH:$(go env GOPATH)/bin
2018-08-16 07:25:01 +02:00
export ACPI_LID_NAME=LID
2020-12-10 02:20:07 +01:00
export QT_QPA_PLATFORMTHEME=qt5ct
2024-04-14 01:06:55 +02:00
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_STATE_HOME="$HOME/.local/state"
2024-04-14 01:31:55 +02:00
export GNUPGHOME="$HOME/.gnupg"
2024-04-14 01:33:43 +02:00
export PASSWORD_STORE_DIR="$HOME/.password-store"
2024-04-14 02:24:41 +02:00
export GTK2_RC_FILES=${XDG_CONFIG_HOME}/gtkrc-2.0
2018-12-28 18:19:00 +01:00
umask 0022
2020-10-05 21:55:12 +02:00
{% set env = machine.environment | combine(user.environment) %}
{% for k, v in env.items() %}
export {{ k }}="{{ v }}"
{% endfor %}
2024-04-25 08:01:53 +02:00
feature_dir="${XDG_RUNTIME_DIR}/features/"
rm -rf "${feature_dir}"/
mkdir -p "${feature_dir}"
2021-01-27 16:38:00 +01:00
2024-04-25 08:01:53 +02:00
[[ $MACHINE_HAS_NEXTCLOUD == "true" ]] && touch "${feature_dir}"/nextcloud
[[ $MACHINE_HAS_KEEPASSX == "true" ]] && touch "${feature_dir}"/keepassx
[[ $MACHINE_HAS_STEAM == "true" ]] && touch "${feature_dir}"/steam
[[ $MACHINE_HAS_RESTIC_BACKUP == "true" ]] && touch "${feature_dir}"/restic_backup
2021-01-27 16:38:00 +01:00
2024-04-25 08:01:53 +02:00
[[ $MACHINE_TYPE == "laptop" ]] && touch "${feature_dir}"/machine_is_laptop
2021-01-27 16:38:00 +01:00
2021-10-02 11:03:02 +02:00
{% if user.gpg_agent %}
2024-04-25 08:01:53 +02:00
touch "${feature_dir}"/gpg_agent
2021-10-02 11:03:02 +02:00
{% endif %}
# Make important environment variables also usable in the systemd user instance
systemd_envs=(
DISPLAY
GNUPGHOME
PATH
ACPI_LID_NAME
)
systemctl --user import-environment "${systemd_envs[@]}"
2016-03-08 00:00:46 +01:00
# exec startx breaks some logind fuckery, without exec it works
2017-01-23 17:02:43 +01:00
if [[ -z $DISPLAY ]] ; then
2019-11-14 09:16:55 +01:00
if (( $XDG_VTNR == {{ user.vt }} )) ; then
2017-01-23 17:02:43 +01:00
startx
else
tmux new-session -A -s tmux-tty-$XDG_VTNR
fi
fi