summaryrefslogtreecommitdiff
path: root/.profile
diff options
context:
space:
mode:
authorBenjamin Chausse <benjamin@chausse.xyz>2024-05-12 03:27:14 -0400
committerBenjamin Chausse <benjamin@chausse.xyz>2024-05-12 03:27:14 -0400
commite53ab0e7e1f4b04e2339b5452e13df7081f0d189 (patch)
tree0b68d696a0fb98ed86b38e6e6ec664794052ae00 /.profile
parentf9e97c28c63f0a47922defb4b99765ea381fb35c (diff)
POSIX profile
Diffstat (limited to '.profile')
-rw-r--r--.profile103
1 files changed, 57 insertions, 46 deletions
diff --git a/.profile b/.profile
index b86c829..f15b4b8 100644
--- a/.profile
+++ b/.profile
@@ -1,60 +1,71 @@
-# Path
-export SCRIPTS=$HOME/.local/bin
-export PATH=$PATH$(find "$SCRIPTS/" -type d -printf ":%p")
-export GOPATH=$HOME/.go
-export PATH=$PATH:$GOPATH/bin
-export PATH=$PATH:$HOME/.cargo/bin
-export PATH=$PATH:/root/.local/bin
-export PATH=$PATH:$HOME/.local/bin
-export PATH=$PATH:/usr/local/go/bin
-export PATH=$PATH:/usr/local/go/bin
-
-# QT & GTK
-export QT_QPA_PLATFORMTHEME="qt5ct"
-export GTK2_RC_FILES="$HOME/.gtkrc-2.0"
-export QT_QPA_PLATFORMTHEME="qt5ct"
+#!/bin/sh
+# shellcheck disable=SC2155
+
+unsetopt PROMPT_SP 2>/dev/null
+
+# Applications
+export EDITOR=nvim
+export TERMINAL=st
+export TERMINAL_PROG=st
+export BROWSER=firefox
# Misc
+export XDG_CONFIG_HOME="$HOME/.config"
+export XDG_DATA_HOME="$HOME/.local/share"
+export XDG_CACHE_HOME="$HOME/.cache"
+export XINITRC="$XDG_CONFIG_HOME/x11/xinitrc"
+
+# Path
+export PATH="$PATH:$(find $HOME/.local/bin -type d | paste -sd ":" -)"
+export PATH="$PATH:$GOPATH/bin"
+export PATH="$PATH:$HOME/.cargo/bin"
+export PATH="$PATH:/root/.local/bin"
+export PATH="$PATH:$HOME/.local/bin"
+export PATH="$PATH:/usr/local/go/bin"
+export PATH="$PATH:/usr/local/go/bin"
+
export DISTRIB_ID=arch
-export DISTRIB_RELEASE=$(uname -r)
-export XDG_CONFIG_HOME=$HOME/.config
-export XDG_DATA_HOME=$HOME/.local/share
-export XDG_CACHE_HOME=$HOME/.cache
-export R_PROFILE_USER=$HOME/.config/R/Rprofile
-export ZDOTDIR=$XDG_CONFIG_HOME/zsh
-export TEXMFHOME=$XDG_DATA_HOME/texmf
-export TEXSRC=$HOME/.local/src/sherbrooke-tex
+export DISTRIB_RELEASE="$(uname -r)"
+export R_PROFILE_USER="$XDG_CONFIG_HOME/R/Rprofile"
+export ZDOTDIR="$XDG_CONFIG_HOME/zsh"
+export TEXMFHOME="$XDG_DATA_HOME/texmf"
+export GOPATH="$XDG_DATA_HOME/go"
+export GOMODCACHE="$XDG_CACHE_HOME/go/mod"
+export CARGO_HOME="$XDG_DATA_HOME/cargo"
+export TMUX_TMPDIR="$XDG_RUNTIME_DIR"
+export GTK2_RC_FILES="$XDG_CONFIG_HOME/gtk-2.0/gtkrc"
+export QT_QPA_PLATFORMTHEME="gtk2"
+export MOZ_USE_XINPUT2=1 # Mozilla smooth scrolling/touchpad
+export AWT_TOOLKIT="MToolkit wmname LG3D" # Fix for Java applications in dwm
+export _JAVA_AWT_WM_NONREPARENTING=1 # (this too)
+export WINEPREFIX="$XDG_DATA_HOME/wineprefixes/default"
+export HISTFILE="$XDG_CACHE_HOME/zsh_history"
+export HISTSIZE=1000
+export SAVEHIST=10000
-# Applications
-export EDITOR=/usr/bin/nvim
-export READER=/usr/bin/zathura
-export TERMINAL=/usr/local/bin/st
-export TERM=/usr/local/bin/st
-export BROWSER=/usr/bin/firefox
+# Set st as the default terminal when not connected via SSH
+# or xterm when connected via SSH
+[ -z "$SSH_CONNECTION" ] && export TERM=st || export TERM=xterm
# less/man colors
-export LESS=-R
-export LESS_TERMCAP_md=$'\e[01;36;74m' # begin bold
-export LESS_TERMCAP_mb=$'\e[01;31;4m' # begin blinking
-export LESS_TERMCAP_us=$'\e[04;32;146m' # begin underline
-export LESS_TERMCAP_so=$'\e[30;42;146m' # begin reverse video
-export LESS_TERMCAP_se=$'\e[0m' # end reverse video
-export LESS_TERMCAP_me=$'\e[0m' # end mode
-export LESS_TERMCAP_ue=$'\e[0m' # end underline
+export LESS="R"
+export LESS_TERMCAP_mb="$(printf '%b' '')"
+export LESS_TERMCAP_md="$(printf '%b' '')"
+export LESS_TERMCAP_me="$(printf '%b' '')"
+export LESS_TERMCAP_so="$(printf '%b' '')"
+export LESS_TERMCAP_se="$(printf '%b' '')"
+export LESS_TERMCAP_us="$(printf '%b' '')"
+export LESS_TERMCAP_ue="$(printf '%b' '')"
# Generate shortcuts and aliases
-shortcutgen
-aliasgen
-
-# Import shortcut ENV variables
-source "$XDG_CACHE_HOME/env-shortcuts"
+shortcutgen >/dev/null 2>&1
+aliasgen >/dev/null 2>&1
+[ -f "$XDG_CACHE_HOME/env-shortcuts" ] && source "$XDG_CACHE_HOME/env-shortcuts"
# Ensure XDG_RUNTIME_DIR is set
if test -z "$XDG_RUNTIME_DIR"; then
- export XDG_RUNTIME_DIR=$(mktemp -d /tmp/$(id -u)-runtime-dir.XXX)
+ export XDG_RUNTIME_DIR="$(mktemp -d /tmp/$(id -u)-runtime-dir.XXX)"
fi
# Start Desktop Environment if on the main TTY
-if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then
- startx
-fi
+[ "$(tty)" = "/dev/tty1" ] && ! pidof Xorg >/dev/null 2>&1 && exec startx "$XINITRC"