From 6467a4e60edc21439e7e2cc575c4e89697aa4e0e Mon Sep 17 00:00:00 2001 From: k1574 Date: Wed, 4 Nov 2020 04:24:45 +0500 Subject: [PATCH] Fixed some installation and environment setting issues. --- dot/file/profile | 28 +++++++++++++--------------- dot/file/rcrc | 2 +- dot/file/shrc | 12 ++---------- dot/file/winitrc | 9 --------- dot/install.rc | 2 +- dot/install.sh | 2 +- setenv/sh | 4 ++-- 7 files changed, 20 insertions(+), 39 deletions(-) delete mode 100644 dot/file/winitrc diff --git a/dot/file/profile b/dot/file/profile index 88e8497..8170ab1 100755 --- a/dot/file/profile +++ b/dot/file/profile @@ -18,6 +18,13 @@ export_loop(){ # Standard variables. export_loop \ ENV '$HOME/.shrc' \ + LIB '$HOME/lib' \ + IMG '$HOME/img' \ + SND '$HOME/snd' \ + DOC '$HOME/doc' \ + VID '$HOME/vid' \ + LOAD '$HOME/load' \ + TXT '$HOME/txt' \ SHPROMPT '"% "' \ PS1 '"$SHPROMPT"' \ SUDO_PROMPT '"#"' \ @@ -27,15 +34,12 @@ export_loop \ PAGER 'less' \ MANPAGER '$PAGER' \ PROFILE '$HOME/.profile' \ - TXT '$HOME/txt' \ TMPL '$HOME/tmpl' \ - APP '$HOME/APP' \ - ENVDIR '$LOCAL/env' \ - GIT '$LOCAL/git' \ - ETC '$LOCAL/etc' \ - SETENV '$ETC/env/setenv' \ - TMP '$LOCAL/tmp' \ - SHR '$LOCAL/shr' \ + APP '$HOME/app' \ + ENVDIR '$HOME/env' \ + SETENV '$LIB/setenv/sh' \ + TMP '$HOME/tmp' \ + SHR '$HOME/shr' \ MNT '$HOME/mnt' \ EXE '$EXE/bin' \ GOPATH '$APP/go' \ @@ -46,17 +50,11 @@ export_loop \ PLAN9PORT '$APP/plan9' \ PLAN9 '$PLAN9PORT' \ INFERNO '$APP/inferno' \ - LIB '$HOME/lib' \ - IMG '$HOME/img' \ - SND '$HOME/snd' \ - DOC '$HOME/doc' \ - VID '$HOME/vid' \ - LOAD '$HOME/load' \ XDG_CONFIG_HOME '$LIB' \ XDG_RUNTIME_DIR '$TMP' \ XDG_DATA_HOME '$APP' \ LOGIN '$LIB/login/sh' \ PATH '$EXE:$PATH:$GOEXE:$PLAN9BASE/bin:$PLAN9PORT/bin:$VEXE' \ -test -r $SETENV && . "$SETENV.sh" && setenv profile +test -r $SETENV && . "$SETENV" && setenv profile diff --git a/dot/file/rcrc b/dot/file/rcrc index a40e80b..47d6a3a 120000 --- a/dot/file/rcrc +++ b/dot/file/rcrc @@ -1 +1 @@ -../lib/profile \ No newline at end of file +../../profile \ No newline at end of file diff --git a/dot/file/shrc b/dot/file/shrc index 92a85fe..972e262 100644 --- a/dot/file/shrc +++ b/dot/file/shrc @@ -1,13 +1,5 @@ #!/bin/sh - -if test -r "$LOGIN.sh" ; then - . "$LOGIN.sh" -fi - - +test -r "$LOGIN" && . "$LOGIN" PS1="$SHPROMPT" +test -r "$SETENV" && . "$SETENV" && setenv sh -if test -r "$SETENV.sh" ; then - . "$SETENV.sh" - setenv sh -fi diff --git a/dot/file/winitrc b/dot/file/winitrc deleted file mode 100644 index 901c5a8..0000000 --- a/dot/file/winitrc +++ /dev/null @@ -1,9 +0,0 @@ -session=$(1:-sway) -shift -arg="$@" -# The same as xinitrc, but for Wayland programs. -case "$session" in - sway ) exec sway $arg;; - # Not found any specific. - * ) exec $session $arg ;; -esac diff --git a/dot/install.rc b/dot/install.rc index 4c279d9..97340c6 100755 --- a/dot/install.rc +++ b/dot/install.rc @@ -3,7 +3,7 @@ rpath = `{dirname `{readlink -f $0}} dot = $rpath/file for(i in $dot/*){ ln = $home/.`{basename $i} - rm -f $ln + rm -rf $ln echo $ln $i ln -s $i $ln } diff --git a/dot/install.sh b/dot/install.sh index 791f24f..537e7df 100755 --- a/dot/install.sh +++ b/dot/install.sh @@ -3,7 +3,7 @@ rpath="$(dirname `readlink -f $0`)" dot="$rpath/file" for i in $dot/* ; do ln="$HOME/.`basename $i`" - rm -f "$ln" + rm -rf "$ln" echo $ln $i ln -s "$i" "$ln" done diff --git a/setenv/sh b/setenv/sh index f6ae6a6..62fe04f 100644 --- a/setenv/sh +++ b/setenv/sh @@ -13,14 +13,14 @@ if [ -d "$ENVDIR" ] ; then # Set variables from files. sh="$1" - for i in "$ENVDIR/$sh/var"/* ; do + for i in "$ENVDIR/$sh/var"/* ; do if test -r "$i" ; then export "`basename \"$i\"`"="`cat \"$i\"`" fi done # Modules. - for i in "$ENVDIR/$sh"/*.sh ; do + for i in "$ENVDIR/$sh/rc"/*; do if test -r "$i" ; then . "$i" fi