lfcd has to be in bashrc
This commit is contained in:
parent
4049eaec3e
commit
d9fe07f71a
15
.bashrc
15
.bashrc
@ -16,6 +16,7 @@ alias bell="paplay /usr/share/sounds/freedesktop/stereo/complete.oga"
|
||||
alias useage="du -h -d 1 2> /dev/null | sort -h"
|
||||
# For laptop multi-gpu offloading
|
||||
alias nvidia_gpu="DRI_PRIME=1 __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia"
|
||||
alias feh="swallow feh --force-aliasing --draw-exif --scale-down --draw-filename"
|
||||
|
||||
export DENO_INSTALL="/home/oliver/.deno"
|
||||
export PATH="$DENO_INSTALL/bin:$PATH"
|
||||
@ -28,3 +29,17 @@ export WINEPREFIX="$HOME/.wine/"
|
||||
export DXVK_HUD="fps"
|
||||
export EDITOR="nvim"
|
||||
|
||||
lfcd() {
|
||||
tmp="$(mktemp)"
|
||||
lfrun -last-dir-path="$tmp" "$@"
|
||||
if [ -f "$tmp" ]; then
|
||||
dir="$(cat "$tmp")"
|
||||
rm -f "$tmp"
|
||||
if [ -d "$dir" ]; then
|
||||
if [ "$dir" != "$(pwd)" ]; then
|
||||
# needs to be in the .bashrc so it can cd for us
|
||||
cd "$dir"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
@ -1,14 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
tmp="$(mktemp)"
|
||||
|
||||
lfrun -last-dir-path="$tmp" "$@"
|
||||
if [ -f "$tmp" ]; then
|
||||
dir="$(cat "$tmp")"
|
||||
rm -f "$tmp"
|
||||
if [ -d "$dir" ]; then
|
||||
if [ "$dir" != "$(pwd)" ]; then
|
||||
cd "$dir"
|
||||
fi
|
||||
fi
|
||||
fi
|
Loading…
Reference in New Issue
Block a user