dotfiles/fish/.config/fish/conf.d/setup.fish

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

76 lines
2.7 KiB
Fish
Raw Normal View History

function __fish_setup_on_tty_login --description "Set up environment on tty login"
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
set -qx SSH_AUTH_SOCK; or set -Ux SSH_AUTH_SOCK $XDG_RUNTIME_DIR/ssh-agent.socket
# 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
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
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
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
end
end
if type -qf fnm
fnm env --shell=fish --log-level=quiet | source
end
set -gx CLICOLOR 1
set -gx LSCOLORS gxfxcxdxbxegedabaggxgx
2022-03-17 04:44:06 +01:00
set -Ux GST_DEBUG_NO_COLOR 1
set -Ux GST_DEBUG_COLOR_MODE off
mkdir -p /tmp/gst-dot
set -Ux GST_DEBUG_DUMP_DOT_DIR /tmp/gst-dot
set -Ux GHCUP_USE_XDG_DIRS 1
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