#!/bin/zsh # Source nix first if it exists #[[ -e $HOME/.nix-defexpr/channels ]] && export NIX_PATH=$HOME/.nix-defexpr/channels #[[ -e /nix/var/nix/profiles/per-user/root/channels ]] && export NIX_PATH=/nix/var/nix/profiles/per-user/root/channels${NIX_PATH:+:$NIX_PATH} [[ -f ${HOME}/.nix-profile/etc/profile.d/nix.sh ]] && source ${HOME}/.nix-profile/etc/profile.d/nix.sh if test -z "${XDG_RUNTIME_DIR}"; then export XDG_RUNTIME_DIR=/tmp/${UID}-runtime-dir if ! test -d "${XDG_RUNTIME_DIR}"; then mkdir "${XDG_RUNTIME_DIR}" chmod 0700 "${XDG_RUNTIME_DIR}" fi fi if test -z "${XDG_CONFIG_HOME}"; then export XDG_CONFIG_HOME="${HOME}/.config" fi if command -v nvim > /dev/null 2>&1; then export EDITOR=nvim elif command -v vim > /dev/null 2>&1; then export EDITOR=vim elif command -v emacs > /dev/null 2>&1; then export EDITOR=emacsnw fi export PAGER=less if [[ "$OSTYPE" == "linux"* ]]; then export LANG="en_US.UTF-8" export LC_CTYPE="en_US.UTF-8" export MOZ_USE_XINPUT2=1 # Pixel-perfect trackpads <3 export MOZ_ENABLE_WAYLAND=1 export MOZ_DBUS_REMOTE=1 export IBUS_ENABLE_CTRL_SHIFT_U=1 export XMODIFIERS="@im=fcitx" # This hack necessary for reasons I'll never understand. Under Wayland specifically, # GTK themes are evidently only configured through envvars? Whatever, this fixes it. [[ -f ~/.config/gtk-3.0/settings.ini ]] && export GTK_THEME=$(cat ~/.config/gtk-3.0/settings.ini | grep gtk-theme-name | cut -d'=' -f2) export GTK_CSD=0 export GTK2_RC_FILES="$HOME/.gtkrc-2.0" export GTK_IM_MODULE="fcitx" #export GDK_BACKEND=wayland export CLUTTER_BACKEND=wayland #export QT_QPA_PLATFORM=wayland-egl export QT_QPA_PLATFORMTHEME=qt5ct export QT_IM_MODULE="fcitx" export QT_WAYLAND_FORCE_DPI=physical export QT_WAYLAND_DISABLE_WINDOWDECORATION=1 #export SDL_VIDEODRIVER=wayland export XDG_CURRENT_DESKTOP=sway fi export SSH_AUTH_SOCK export PMM_WORLD="~/.config/worldedit/$(hostname)" export HOMEBREW_BREWFILE="~/.config/worldedit/$(hostname)" export AUTO_NOTIFY_THRESHOLD=30 export ZPLUG_LOADFILE=$HOME/.zpackages.zsh typeset -g POWERLEVEL9K_INSTANT_PROMPT=off # Do the initialization when the script is sourced (i.e. Initialize instantly) ZVM_INIT_MODE=sourcing # ZSH Tmux plugin settings TMUX_MOTD=false if [[ $(hostname) == "amy" ]] || [[ $(hostname) == "cubert" ]] ; then # Disable autostart on local machines TMUX_AUTOSTART=false fi