config/shell: litle corrections, fix cs alias

This commit is contained in:
xeruf 2021-09-24 20:20:29 +02:00
parent a6381ef407
commit 3607708476
5 changed files with 15 additions and 11 deletions

View File

@ -29,11 +29,14 @@ mkcd() {
} }
cd() { cd() {
test -d "$DATA" && test "$1" != "-" -a ! -d "$1" -a $# -eq 1 && if test -d "$DATA" && test "$1" != "-" -a ! -d "$1" -a $# -eq 1
dir=$(f --glob "$1*" "$DATA" --maxdepth 2 --type d --max-results 1) && then
test -n "$dir" && cd "$dir" && return dir=$(fd --no-ignore --glob "$1*" "$DATA" --maxdepth 2 --type d --max-results 1)
builtin cd $1 && test -n "$dir" && cd "$dir"
else
builtin cd $1 &&
command ls --file-type --group-directories-first --color=always --format=vertical -w $COLUMNS | head -3 command ls --file-type --group-directories-first --color=always --format=vertical -w $COLUMNS | head -3
fi
} }
# ZOXIDE # ZOXIDE
@ -50,6 +53,6 @@ d() {
fi | zfz)" fi | zfz)"
} }
di() { di() {
test "$1" != "-" -a ! -d "$1" -a $# -eq 1 && local dir=$({ zf "$@"; locz "$@" } | zfz) test $# -eq 1 && test "$1" = "-" -o -d "$1" || local dir=$({ zf "$@"; locz "$@" } | zfz)
cd "${dir:-1}" cd "${dir:-1}"
} }

View File

@ -217,7 +217,7 @@ updateDeps() {
done done
echo name $name depth $depth pattern $oldversion version $version echo name $name depth $depth pattern $oldversion version $version
find -maxdepth $depth -type f -name $name | while read f find -maxdepth $depth -type f -name $name | while read f
do echo $f do highlight $f
sed -i "s/\($pattern\)$oldversion/\1$version/gw /dev/stdout" $f sed -i "s/\($pattern\)$oldversion/\1$version/gw /dev/stdout" $f
done done
} }

View File

@ -1,4 +1,3 @@
#!/bin/bash #!/bin/bash
# Extract the icon of a given page using duckduckgo # Extract the icon of a given page using duckduckgo
read -p URL? url xdg-open "https://icons.duckduckgo.com/ip2/$1.ico"
xdg-open "https://icons.duckduckgo.com/ip2/$url.ico"

View File

@ -2,11 +2,11 @@
# set given repository as upstream or add as a new remote # set given repository as upstream or add as a new remote
if test "$3" if test "$3"
then then
local name="$3" name="$3"
git remote remove "$3" 2>/dev/null git remote remove "$3" 2>/dev/null
else else
git remote get-url upstream 2>/dev/null && local name="$1" || local name="upstream" git remote get-url upstream 2>/dev/null && name="$1" || name="upstream"
fi fi
local origin="$(git remote get-url origin)" origin="$(git remote get-url origin)"
git remote add -f $name "$(echo $origin | cut -d':' -f1):$1/${2:-$(echo $origin | cut -d'/' -f2)}" git remote add -f $name "$(echo $origin | cut -d':' -f1):$1/${2:-$(echo $origin | cut -d'/' -f2)}"
git remote -v git remote -v

View File

@ -13,6 +13,7 @@ export GNUPGHOME="$XDG_DATA_HOME"/gnupg
export KDEHOME="$XDG_STATE_HOME"/kdehome export KDEHOME="$XDG_STATE_HOME"/kdehome
export GOPATH="$XDG_STATE_HOME"/go export GOPATH="$XDG_STATE_HOME"/go
export CARGO_HOME="$XDG_DATA_HOME"/cargo
export GTK2_RC_FILES="$XDG_CONFIG_HOME"/gtk-2.0/gtkrc export GTK2_RC_FILES="$XDG_CONFIG_HOME"/gtk-2.0/gtkrc
export RLWRAP_HOME="$XDG_STATE_HOME"/rlwrap export RLWRAP_HOME="$XDG_STATE_HOME"/rlwrap
@ -93,6 +94,7 @@ export CTEST_PROGRESS_OUTPUT=1
export CTEST_OUTPUT_ON_FAILURE=1 export CTEST_OUTPUT_ON_FAILURE=1
export CTEST_PARALLEL_LEVEL=3 export CTEST_PARALLEL_LEVEL=3
export JOURNAL="$DATA/2-standards/notes/journal" export JOURNAL="$DATA/2-standards/notes/journal"
if test -z "${DISPLAY}" && test "$XDG_VTNR" -eq 1 && test -d "$JOURNAL"; then if test -z "${DISPLAY}" && test "$XDG_VTNR" -eq 1 && test -d "$JOURNAL"; then