function __fish_setup_on_tty_login --description "Set up environment on tty login" for extra_path in ~/.{local,nix-profile,cargo,cabal,ghcup}/bin if test -d "$extra_path" set -gxp PATH "$extra_path" end end if test -d {$HOME}/.nix-defexpr/channels set -gx NIX_PATH {$HOME}/.nix-defexpr/channels set -gx NIX_SSL_CERT_FILE '/etc/ssl/certs/ca-certificates.crt' end if test -d /var/lib/flatpak # https://github.com/fish-shell/fish-shell/issues/7485#issuecomment-728984689 # https://wiki.archlinux.org/title/Flatpak#Adding_Flatpak_.desktop_files_to_your_menu set -l xdg_data_home $XDG_DATA_HOME ~/.local/share set -gx --path XDG_DATA_DIRS $xdg_data_home[1]/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share for flatpakdir in ~/.local/share/flatpak/exports/bin /var/lib/flatpak/exports/bin if test -d $flatpakdir contains $flatpakdir $PATH; or set -a PATH $flatpakdir end end end if type -qf fnm fnm env --shell=fish --log-level=quiet | source end # Temporary directory for GStreamer dot files mkdir -p /tmp/gst-dot # Needed for silencing some warnings from Sway. Will not work with systemd # environment.d. set -gx WLR_NO_HARDWARE_CURSORS 1 # Needed for work set -gx ENV qa-tunnel # Required for all environment variables to be set correctly, especially # in tmux session service. dbus-update-activation-environment --systemd --all end # Instead of tty check, we would have liked to do this using status is-login # check but for some reason that does not work? set --local TTY1 (tty) [ "$TTY1" = /dev/tty1 ] && __fish_setup_on_tty_login