diff options
| author | Thomas Ulmer <thomasmulmer02@gmail.com> | 2026-07-25 10:17:46 -0700 |
|---|---|---|
| committer | Thomas Ulmer <thomasmulmer02@gmail.com> | 2026-07-25 10:17:46 -0700 |
| commit | 8af6534ab16cf0e8abd08849d6c6a77ec813b6b1 (patch) | |
| tree | 9964b1f2cd2513bbfd60e3eef04ddc1f68b0e8e7 /config | |
| parent | a2e0e8c46ef57b28c6a292dc969f7abbf4d5cdb8 (diff) | |
fix up profile and login setup stuff for ksh
Diffstat (limited to 'config')
| -rwxr-xr-x[-rw-r--r--] | config/profile | 107 | ||||
| -rw-r--r-- | config/xinitrc | 2 |
2 files changed, 65 insertions, 44 deletions
diff --git a/config/profile b/config/profile index e3d09f7..9a305c2 100644..100755 --- a/config/profile +++ b/config/profile @@ -1,69 +1,90 @@ +#!/bin/sh +case $- in + *l*) LOGIN=1 ;; + *) LOGIN=0 ;; +esac + case $- in *i*) INTERACTIVE=1 ;; *) INTERACTIVE=0 ;; esac -if [ -z "$XDG_RUNTIME_DIR" ]; then - XDG_RUNTIME_DIR=$(mktemp -d "/tmp/$(id -u)-runtime-dir.XXX") - export XDG_RUNTIME_DIR +if [ "$LOGIN" = 1 ]; then + if [ -z "$XDG_RUNTIME_DIR" ]; then + XDG_RUNTIME_DIR=$(mktemp -d "/tmp/$(id -u)-runtime-dir.XXX") + export XDG_RUNTIME_DIR + fi + + export ENV=${HOME}/.profile fi ######################################################################## -prepend_path() { - if [ -d "$1" ]; then - case ":$PATH:" in - *:"$1":*) ;; - *) PATH=$1:$PATH ;; - esac - fi -} - -prepend_path "$HOME/.ghcup/bin" -prepend_path "$HOME/.cabal/bin" -prepend_path "$HOME/.cargo/bin" -prepend_path "$HOME/.mcabal/bin" -prepend_path "$HOME/.local/musl/bin" -prepend_path "$HOME/.local/bin" - -export PATH +if [ "$LOGIN" = 1 ]; then + prepend_path() { + if [ -d "$1" ]; then + case ":$PATH:" in + *:"$1":*) ;; + *) PATH=$1:$PATH ;; + esac + fi + } + prepend_path "$HOME/.ghcup/bin" + prepend_path "$HOME/.cabal/bin" + prepend_path "$HOME/.cargo/bin" + prepend_path "$HOME/.mcabal/bin" + prepend_path "$HOME/.local/musl/bin" + prepend_path "$HOME/.local/bin" + export PATH +fi ######################################################################## -if [ -d /usr/local/lib/pkgconfig ]; then - if [ -n "$PKG_CONFIG_PATH" ]; then - PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH - else - PKG_CONFIG_PATH=/usr/local/lib/pkgconfig +if [ "$LOGIN" = 1 ]; then + if [ -d /usr/local/lib/pkgconfig ]; then + if [ -n "$PKG_CONFIG_PATH" ]; then + PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH + else + PKG_CONFIG_PATH=/usr/local/lib/pkgconfig + fi + export PKG_CONFIG_PATH fi - export PKG_CONFIG_PATH fi ######################################################################## -export EDITOR=vi -export ALTERNATE_EDITOR=vi -export VISUAL=vi +if [ "$LOGIN" = 1 ]; then + export EDITOR=vi + export ALTERNATE_EDITOR=vi + export VISUAL=vi -export MORE=FRX -export LESS=FRX -export EXINIT='set ai ic nu sw=4 ts=4 nofl magic' + export MORE=FRX + export LESS=FRX + export EXINIT='set ai ic nu sw=4 ts=4 nofl magic' -if command -v less >/dev/null 2>&1; then - PAGER=less -elif command -v more >/dev/null 2>&1; then - PAGER=more -else - PAGER=cat + if command -v less >/dev/null 2>&1; then + PAGER=less + elif command -v more >/dev/null 2>&1; then + PAGER=more + else + PAGER=cat + fi + export PAGER fi -export PAGER ######################################################################## -HISTCONTROL=ignoreboth -HISTSIZE=1000 -HISTFILESIZE=2000 -export HISTCONTROL HISTSIZE HISTFILESIZE +if [ "$LOGIN" = 1 ]; then + HISTCONTROL=ignoreboth + HISTSIZE=1000 + HISTFILESIZE=2000 + export HISTCONTROL HISTSIZE HISTFILESIZE +fi + +######################################################################## +if [ "$INTERACTIVE" = 1 ]; then + set -o emacs +fi ######################################################################## diff --git a/config/xinitrc b/config/xinitrc index ef8f797..90be822 100644 --- a/config/xinitrc +++ b/config/xinitrc @@ -19,4 +19,4 @@ slstatus & unclutter --timeout 3 & WM=${2:-dwm} -exec ${WM} +exec dbus-launch --exit-with-session ${WM} |
