feat: more profile things.

This commit is contained in:
Andrey Parhomenko 2024-07-12 20:40:54 +05:00
parent b2d1620bbe
commit 498303dcc7
3 changed files with 22 additions and 8 deletions

View file

@ -14,7 +14,7 @@ jctl(){
journalctl $@
}
export_loop(){
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
@ -28,18 +28,26 @@ export_loop(){
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 \
export-loop \
ETC '$HOME/etc' \
ENV '$HOME/.shrc' \
PROMPT '"; "' \
PS1 '"$PROMPT"' \
SUDO_PROMPT '"# "' \
EDITOR '`bb which vim vi ed`' \
VISUAL 'bb which nvim-qt $EDITOR' \
EDITOR '`bb which nvim vim vi ed`' \
VISUAL '$EDITOR' \
GIT_EDITOR '$VISUAL' \
PAGER '`bb which less more`' \
MANPAGER '$PAGER' \
@ -74,11 +82,14 @@ export_loop \
XFILE_MANAGER 'thunar' \
XRESOURCE_MONITOR '$XTERMINAL -e htop' \
XCALENDAR '$XTERMINAL -e calcurse' \
XPUSH_NOTIFICATION_DAEMON 'dunst' \
XNOTIFY 'dunstify' \
SSH_ASKPASS ''\
echo dick
source-if-exist "$ETC/script/lf.sh"
echo suck
test -r $SETENV && . "$SETENV" && setenv profile
test -r $HOME/lib/script/lf.sh && . $HOME/lib/script/lf.sh
# Visual editor.
if which bb ; then

View file

@ -179,6 +179,7 @@ riverctl focus-follows-cursor normal
# Only first time, no reloading.
if test -z "$RIVER_RELOAD" ; then
rivertile -view-padding 0 -outer-padding 0 &
eval $XPUSH_NOTIFICATION_DAEMON &
eval $XOUTPUT_DAEMON &
eval $XBAR &

View file

@ -1,13 +1,14 @@
if test $OS = "Windows_NT" ; then
if test "$OS" = "Windows_NT" ; then
lf() {
winpty lf
}
fi
lfcd () {
tmp="$(mktemp)"
# `command` is needed in case `lfcd` is aliased to `lf`
command lf -last-dir-path="$tmp" "$@"
if [ -f "$tmp" ]; then
if test -f "$tmp" ; then
dir="$(cat "$tmp")"
rm -f "$tmp"
if [ -d "$dir" ]; then
@ -16,4 +17,5 @@ lfcd () {
fi
fi
fi
pwd
}