2021-12-27 07:27:49 +01:00
|
|
|
function __fish_setup_on_tty_login --description "Set up environment on tty login"
|
2022-01-12 13:09:10 +01:00
|
|
|
set -qx XDG_CONFIG_HOME; or set -Ux XDG_CONFIG_HOME $HOME/.config
|
|
|
|
set -qx XDG_CACHE_HOME; or set -Ux XDG_CACHE_HOME $HOME/.cache
|
|
|
|
set -qx XDG_DATA_HOME; or set -Ux XDG_DATA_HOME $HOME/.local/share
|
|
|
|
set -qx XDG_STATE_HOME; or set -Ux XDG_STATE_HOME $HOME/.local/state
|
2022-01-28 07:14:21 +01:00
|
|
|
set -qx SSH_AUTH_SOCK; or set -Ux SSH_AUTH_SOCK $XDG_RUNTIME_DIR/ssh-agent.socket
|
2022-01-12 13:09:10 +01:00
|
|
|
|
2022-01-28 16:22:47 +01:00
|
|
|
# Wayland session
|
|
|
|
set -qx XDG_SESSION_TYPE; or set -Ux XDG_SESSION_TYPE wayland
|
|
|
|
set -qx XDG_SESSION_DESKTOP; or set -Ux XDG_SESSION_DESKTOP wayland
|
|
|
|
set -qx XDG_CURRENT_DESKTOP; or set -Ux XDG_CURRENT_DESKTOP wayland
|
|
|
|
|
|
|
|
# Firefox
|
|
|
|
set -qx MOZ_ENABLE_WAYLAND; or set -Ux MOZ_ENABLE_WAYLAND 1
|
|
|
|
set -qx MOZ_DBUS_REMOTE; or set -Ux MOZ_DBUS_REMOTE 1
|
|
|
|
|
|
|
|
# QT
|
|
|
|
set -qx QT_QPA_PLATFORM; or set -Ux QT_QPA_PLATFORM wayland
|
|
|
|
set -qx QT_QPA_PLATFORMTHEME; or set -Ux QT_QPA_PLATFORMTHEME qt5ct
|
|
|
|
|
2021-12-27 07:27:49 +01:00
|
|
|
for extra_path in ~/.{local,nix-profile,cargo,cabal,ghcup}/bin
|
|
|
|
if test -d "$extra_path"
|
|
|
|
set -gxp PATH "$extra_path"
|
2022-04-12 14:11:50 +02:00
|
|
|
end
|
2021-12-27 07:27:49 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
if type -qf nvim
|
|
|
|
set -gx EDITOR nvim
|
|
|
|
set -gx VISUAL nvim
|
|
|
|
set -gx MANPAGER 'nvim +Man!'
|
|
|
|
else
|
|
|
|
if type -qf vim
|
|
|
|
set -gx EDITOR vim
|
|
|
|
set -gx VISUAL vim
|
2022-04-12 14:11:50 +02:00
|
|
|
end
|
2021-12-27 07:27:49 +01:00
|
|
|
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
|
2022-04-12 14:11:50 +02:00
|
|
|
end
|
2021-12-27 07:27:49 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
if type -qf fnm
|
2022-01-03 07:42:53 +01:00
|
|
|
fnm env --shell=fish --log-level=quiet | source
|
2021-12-27 07:27:49 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
set -gx CLICOLOR 1
|
|
|
|
set -gx LSCOLORS gxfxcxdxbxegedabaggxgx
|
2022-03-17 04:44:06 +01:00
|
|
|
|
2022-03-27 14:48:08 +02:00
|
|
|
set -Ux GST_DEBUG_NO_COLOR 1
|
|
|
|
set -Ux GST_DEBUG_COLOR_MODE off
|
|
|
|
|
2022-04-03 05:56:07 +02:00
|
|
|
mkdir -p /tmp/gst-dot
|
|
|
|
set -Ux GST_DEBUG_DUMP_DOT_DIR /tmp/gst-dot
|
2022-08-03 17:01:14 +02:00
|
|
|
|
|
|
|
set -Ux GHCUP_USE_XDG_DIRS 1
|
2021-12-27 07:27:49 +01:00
|
|
|
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
|