summaryrefslogtreecommitdiff
path: root/dotfiles/system/.profile
diff options
context:
space:
mode:
Diffstat (limited to 'dotfiles/system/.profile')
-rw-r--r--dotfiles/system/.profile89
1 files changed, 59 insertions, 30 deletions
diff --git a/dotfiles/system/.profile b/dotfiles/system/.profile
index 861ec48..fe3b583 100644
--- a/dotfiles/system/.profile
+++ b/dotfiles/system/.profile
@@ -1,44 +1,73 @@
# .profile - Bourne Shell startup script for login shells
-#
-# see also sh(1), environ(7).
-#
+# Craig Jennings <c@cjennings.net>
-# These are normally set through /etc/login.conf. You may override them here
-# if wanted.
-# PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:$HOME/bin; export PATH
+# The path is normally set through /etc/login.conf. Override it here if wanted.
+# export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:$HOME/bin
-# Setting TERM is normally done through /etc/ttys. Do only override
-# if you're sure that you'll never log in via telnet or xterm or a
-# serial line.
-# TERM=xterm; export TERM
+# Let sh(1) know it's at home, despite /home being a symlink.
+if [ "$PWD" != "$HOME" ] && [ "$PWD" -ef "$HOME" ] ; then cd ; fi
-EDITOR=vim; export EDITOR
-PAGER=less; export PAGER
-TERM=foot; export TERM
+# Terminal
+export TERMINAL="$(which foot)"
+#export TERM="vt100"
+export TERM="xterm-256color"
+export COLORTERM=truecolor
+if [ -x /usr/bin/resizewin ] ; then /usr/bin/resizewin -z ; fi # query terminal size; useful for serial lines.
-STOW_DIR=~/code/bsdsetup/dotfiles; export STOW_DIR
+# Text Editor
+export ALTERNATE_EDITOR=""
+export EDITOR="$(which emacs)"
+export VISUAL="$(which emacs)"
+export SUDO_EDITOR="$(which vi)"
+# Browser
+export BROWSER="$(which firefox)"
-# set ENV to a file invoked each time sh is started for interactive use.
-ENV=$HOME/.shrc; export ENV
+# XDG
+# export XDG_RUNTIME_DIR=/tmp
+export XDG_CONFIG_HOME="$HOME/.config/"
+export XDG_SESSION_TYPE=wayland
+export XDG_CURRENT_DESKTOP=sway
+export XDG_DATA_DIRS="$XDG_DATA_DIRS:/usr/share"
+ # setting up XDG_RUNTIME_DIR is a requirement for sway/wayland
+if [ -z "$XDG_RUNTIME_DIR" ]; then
+ export XDG_RUNTIME_DIR="$HOME/.local/xdg/runtime"
+ if [ ! -d "$XDG_RUNTIME_DIR" ]; then
+ mkdir -p "$XDG_RUNTIME_DIR"
+ chmod 0700 "$XDG_RUNTIME_DIR"
+ fi
+fi
-# Let sh(1) know it's at home, despite /home being a symlink.
-if [ "$PWD" != "$HOME" ] && [ "$PWD" -ef "$HOME" ] ; then cd ; fi
+# misc
+export STOW_DIR=~/code/bsdsetup/dotfiles
+export PAGER=less
+export ENV=$HOME/.shrc # set ENV to a file invoked each time sh is started for interactive use.
-# Query terminal size; useful for serial lines.
-if [ -x /usr/bin/resizewin ] ; then /usr/bin/resizewin -z ; fi
+##### ALIASES
-# Display a random cookie on each login.
-# if [ -x /usr/bin/fortune ] ; then /usr/bin/fortune freebsd-tips ; fi
+# cd to common directories
+alias cdb="cd ~/code/bsdsetup/"
+alias cdot="cd ~/code/bsdsetup/dotfiles"
+alias cdr='. ranger' # ranger leaves you in destination directory
-# must be here for sway/wayland
-# export XDG_RUNTIME_DIR=/var/run/user/`id -u`
-export XDG_RUNTIME_DIR=/tmp
+# sorting aliases for ls
+alias lt="ls -lthAF"
+alias ll="ls -lhAF"
-##### ALIASES
+# ranger
+alias r='. ranger'
-alias cdb="cd ~/code/bsdsetup/"
-alias cdd="cd ~/code/bsdsetup/dotfiles"
+# miscellaneous
+alias myip='curl -4 https://chroot-me.in/ip/ 2> /dev/null || w3m -4 -dump https://chroot-me.in/ip'
+alias weather="curl -s wttr.in"
+alias ducks='du -cksh * | sort -rh | head -n11'
+alias open="xdg-open"
+alias stow="stow --target=/home/cjennings" # required as dotfiles in non-standard location
-# allows stow to work from dotfile directories in non-standard locations
-alias stow="stow --target=/home/cjennings"
+# source sh files in .profile.d
+PROFILE_D="$HOME/.profile.d/"
+if [ -d "$PROFILE_D" ]; then
+ for file in $(find "$PROFILE_D" -name "*.sh"); do
+ source "$file"
+ done
+fi