From e292eb508413b9174684a8e75c93474a7f5351ee Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 23 Aug 2021 23:07:31 -0500 Subject: Initial --- profile/defaults.sh | 4 ++++ profile/etc.sh | 10 ++++++++++ profile/infopath.sh | 1 + profile/less.sh | 3 +++ profile/luarocks.sh | 4 ++++ profile/manpath.sh | 9 +++++++++ profile/path.sh | 30 ++++++++++++++++++++++++++++++ profile/xdg.sh | 27 +++++++++++++++++++++++++++ 8 files changed, 88 insertions(+) create mode 100644 profile/defaults.sh create mode 100644 profile/etc.sh create mode 100644 profile/infopath.sh create mode 100644 profile/less.sh create mode 100644 profile/luarocks.sh create mode 100644 profile/manpath.sh create mode 100644 profile/path.sh create mode 100644 profile/xdg.sh (limited to 'profile') diff --git a/profile/defaults.sh b/profile/defaults.sh new file mode 100644 index 0000000..8facc97 --- /dev/null +++ b/profile/defaults.sh @@ -0,0 +1,4 @@ +# Default programs + +export EDITOR="$(which vim)" # TODO: change to emacs +export VISUAL="$EDITOR" diff --git a/profile/etc.sh b/profile/etc.sh new file mode 100644 index 0000000..5458f02 --- /dev/null +++ b/profile/etc.sh @@ -0,0 +1,10 @@ +# etc. settings + +export GUILE_INSTALL_LOCALE=0 +export TZ=America/Chicago + +#export XINITRC="$XDG_CONFIG_HOME/X11/xinitrc" +#export XSERVERRC="$XDG_CONFIG_HOME/X11/xserverrc" +#export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority" +#export SVDIR="$HOME/.local/service" +#export INFOPATH="$INFOPATH:/usr/share/info" diff --git a/profile/infopath.sh b/profile/infopath.sh new file mode 100644 index 0000000..ad1ec3f --- /dev/null +++ b/profile/infopath.sh @@ -0,0 +1 @@ +export INFOPATH="/usr/share/info:${XDG_DATA_HOME:-$HOME/.local/share}/info" diff --git a/profile/less.sh b/profile/less.sh new file mode 100644 index 0000000..19a73ce --- /dev/null +++ b/profile/less.sh @@ -0,0 +1,3 @@ +# less settings + +export LESS="--mouse --RAW-CONTROL-CHARS" diff --git a/profile/luarocks.sh b/profile/luarocks.sh new file mode 100644 index 0000000..315c0b7 --- /dev/null +++ b/profile/luarocks.sh @@ -0,0 +1,4 @@ +# add luarocks stuff to $PATH + +command -v luarocks >/dev/null 2>&1 && + eval $(luarocks path) diff --git a/profile/manpath.sh b/profile/manpath.sh new file mode 100644 index 0000000..def1963 --- /dev/null +++ b/profile/manpath.sh @@ -0,0 +1,9 @@ +# $MANPATH shouldn't be too extra complicated (as opposed to $PATH), +# so I'm not going to include a whole other function. AT SOME POINT, +# I suppose I should generalize that function to set /any/ path-type +# variable, not just $PATH. +# $MANPATH ends with `:' so that manpath(1) will prepend it to its +# special thing. + +MANPATH="${XDG_DATA_HOME:-$HOME/.local/share}/man:" +export MANPATH diff --git a/profile/path.sh b/profile/path.sh new file mode 100644 index 0000000..56bdc39 --- /dev/null +++ b/profile/path.sh @@ -0,0 +1,30 @@ +# PATH + +# add a path to PATH, but only if it's not already there +path_add() { # path_add [-a] PATH... + # -a appends (default is prepend) + APPEND=false + if [ "x$1" = "x-a" ]; then + APPEND=true + shift + fi + + for p; do + case ":$PATH:" in + *:"$p":*) ;; + *) + if $APPEND; then + PATH="$PATH:$p" + else + PATH="$p:$PATH" + fi + ;; + esac + done + + unset APPEND +} + +path_add "$HOME/bin" "$HOME/usr/bin" + +command -v luarocks >/dev/null 2>&1 && path_add "$HOME/.luarocks/bin" diff --git a/profile/xdg.sh b/profile/xdg.sh new file mode 100644 index 0000000..caa1a9a --- /dev/null +++ b/profile/xdg.sh @@ -0,0 +1,27 @@ +# XDG compliance (miscellaneous) + +# If an XDG-complaint variable makes more sense somewhere else, it'll be +# moved there (e.g., HISTFILE is in history.bash). So variables might +# move /out/ of this directory, but they probably won't move /in/. + +# Readline +export INPUTRC="$XDG_CONFIG_HOME"/readline/inputrc + +# Less +export LESSKEY="$XDG_CONFIG_HOME"/less/lesskey +export LESSHISTFILE="$XDG_CACHE_HOME"/less/history +mkdir -p "$XDG_CACHE_HOME"/less + +# Vim +export VIMINIT="let \$MYVIMRC=\"$XDG_CONFIG_HOME/vim/vimrc\" | source \$MYVIMRC" + +# Weechat +export WEECHAT_HOME="$XDG_CONFIG_HOME/weechat" + +# Lynx +export LYNX_CFG="$XDG_CONFIG_HOME/lynx/lynx.cfg" + +# Xorg +export XINITRC="$XDG_CONFIG_HOME/X11/xinitrc" +export XSERVERRC="$XDG_CONFIG_HOME/X11/xserverrc" +export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority" -- cgit 1.4.1-21-gabe81