From 498303dcc710b485fd4fbca73cf67da2603e646e Mon Sep 17 00:00:00 2001 From: surdeus Date: Fri, 12 Jul 2024 20:40:54 +0500 Subject: [PATCH] feat: more profile things. --- dot/file/profile | 23 +++++++++++++++++------ river/init | 1 + script/lf.sh | 6 ++++-- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/dot/file/profile b/dot/file/profile index b94e561..af9d348 100755 --- a/dot/file/profile +++ b/dot/file/profile @@ -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 diff --git a/river/init b/river/init index 82ec4fb..442094a 100755 --- a/river/init +++ b/river/init @@ -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 & diff --git a/script/lf.sh b/script/lf.sh index 6712883..a436eae 100644 --- a/script/lf.sh +++ b/script/lf.sh @@ -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 }