dotfiles/home/.config/shell/profile

29 lines
889 B
Plaintext
Raw Normal View History

2023-04-10 13:50:01 +00:00
#!/bin/zsh
2022-10-29 18:25:42 +00:00
# User .profile definition.
# This file is only sourced once, after login, Unlike
# .zshrc/.bashrc, which will run whenever a new terminal
# is opened.
# Add all folders in ~/.local/bin into PATH
# Some window managers require this line to be in profile
# not in .zshenv
PATH+=":${$(find -L ~/.local/bin -type d | tr '\n' ':')%%:}"
2022-10-29 18:25:42 +00:00
if [ -d "$HOME/.local/share/pyenv/shims" ]; then
PATH+=":$HOME/.local/share/pyenv/shims"
fi
2023-07-22 22:14:23 +00:00
if [ -d "$HOME/.local/share/npm/bin" ]; then
PATH+=":$HOME/.local/share/npm/bin"
fi
# Start graphical session automatically on tty1 if Hyprland or startx is available
2022-10-29 18:25:42 +00:00
if [ "$(tty)" = "/dev/tty1" ] && [ "$UID" != 0 ]; then
if command -v Hyprland >/dev/null; then
! pidof -s Hyprland >/dev/null 2>&1 && launch-hypr
elif command -v startx >/dev/null; then
! pidof -s Xorg >/dev/null 2>&1 && exec startx "$XINITRC"
2022-10-29 18:25:42 +00:00
fi
fi