etc/dot/file/profile

107 lines
2 KiB
Bash
Executable file

#!/bin/sh
#
# Profile of Surdeus.
#
reload-profile(){
. $PROFILE
}
no-output() {
$@ &> /dev/null
}
sctl(){
systemctl $@
}
jctl(){
journalctl $@
}
export-loop(){
# Chore, because I'm lazy to type "export" so many times.
# Standard "export" command takes arguments
# from variables from the start, but I want to
# use other variables in definition for next of them.
while test -n "$1" ; do
# Doing until we have arguments.
value="$(eval echo $2)"
name="$1"
export "$name"="$value"
shift 2
done
}
source-if-exist() {
for i in $@ ; do
if test -r "$i" ; then
. "$i"
fi
done
}
if test "$OS" != "Windows_NT" ; then
PATH="$HOME/exe:$HOME/.local/bin:$PATH"
fi
# Standard variables.
export-loop \
ETC '$HOME/etc' \
ENV '$HOME/.shrc' \
PROMPT '"; "' \
PS1 '"$PROMPT"' \
SUDO_PROMPT '"# "' \
EDITOR '`bb which nvim vim vi ed`' \
VISUAL '$EDITOR' \
GIT_EDITOR '$VISUAL' \
PAGER '`bb which less more`' \
MANPAGER '$PAGER' \
\
CDHIST '$ETC/cds' \
CDHISTMAX '50' \
\
CMDHIST '$ETC/cmds' \
CMDHISTMAX '100' \
PROFILE '$HOME/.profile' \
ENVDIR '$HOME/env' \
SETENV '$ETCsetenv/sh' \
LOGIN '$ETC/login/sh' \
INDENT '" "'\
\
GOPATH '$HOME/app/go' \
GOBIN '$HOME/exe'\
XDG_UTILS_DEBUG_LEVEL '3'\
XDG_CONFIG_HOME '$HOME/.config' \
XDG_DATA_HOME '$HOME/dat' \
GIT 'https://surdeus.su' \
PERSONAL_SHELL 'sh' \
VIMRC '$HOME/.vimrc'\
XKB_DEFAULT_OPTIONS 'caps:escape' \
\
XCOMPOSER 'river' \
XTERMINAL 'wayst' \
XRUNNER 'fuzzel' \
XBAR 'waybar' \
XBLUETOOTH_MANAGER 'blueman-manager' \
XOUTPUT_DAEMON 'kanshi' \
XSOUND_CONTROL 'pavucontrol' \
XFILE_MANAGER 'thunar' \
XRESOURCE_MONITOR '$XTERMINAL -e htop' \
XCALENDAR '$XTERMINAL -e calcurse' \
XPUSH_NOTIFICATION_DAEMON 'dunst' \
XNOTIFY 'dunstify' \
XLOCKER 'swaylock' \
SSH_ASKPASS ''\
source-if-exist "$ETC/script/lf.sh"
test -r $SETENV && . "$SETENV" && setenv profile
# Visual editor.
if no-output which bb ; then
ve() {
`bb which nvim vim vi` $@
}
fi
export GPG_TTY=$(tty)
export SSH_TTY=$(tty)