#
# ~/.bashrc
#

# If not running interactively, don't do anything
[[ $- != *i* ]] && return

PS1='[\u@\h \W]\$ '

# Set the umask
umask 0077

# User Defined Functions & Variables
source /home/user/.config/user-overrides.source

# Variables
export GDK_DPI_SCALE=1.25
export QT_SCALE_FACTOR=1.25
export GSETTINGS_BACKEND=keyfile
export PATH=$PATH:$HOME/.scripts:/opt/jdk-21.0.5+11/bin:$HOME/bin/jdt-language-server-1.51.0/bin:$HOME/bin/platform-tools
export GPG_TTY=$(tty)
export EDITOR=nvim
export JAVA_HOME="/opt/jdk-21.0.5+11"
export NNN_FIFO=/tmp/nnn.fifo
export NNN_PLUG='f:preview_tui'
export NNN_TERMINAL="alacritty"
export DISTCC_ARGS="--allow-private --log-file /tmp/distccd.log"
export SSH_ASKPASS="/usr/lib/ssh/gnome-ssh-askpass3"

# Disable recording to .bash_history
unset HISTFILE

export \
	EGL_PLATFORM=wayland \
	QT_QPA_PLATFORM=xcb \
	QT_WAYLAND_DISABLE_WINDOWDECORATION=1 \
	WLR_DRM_NO_ATOMIC=1 \
	WLR_NO_HARDWARE_CURSORS=1 \
	XDG_SESSION_DESKTOP=sway \
	XDG_SESSION_TYPE=wayland \
	MOZ_ENABLE_WAYLAND=1 \
	MOZ_USE_XINPUT=2

# Originally: QT_QPA_PLATFORM=wayland
# But Issues came along and apparently xcb is the best alternative

# Sway launch on /dev/tty1
tty=$(echo "$GPG_TTY" | sed "s/\/dev\/tty//")
if [ -z "${WAYLAND_DISPLAY}" ] && [ "$tty" = "1" ]; then
	sway --unsupported-gpu
fi

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"                   # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion

source /home/user/.config/broot/launcher/bash/br
eval "$(zoxide init --cmd cd bash)"
