lfcd has to be in bashrc
This commit is contained in:
		
							
								
								
									
										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"
 | 
					alias useage="du -h -d 1 2> /dev/null | sort -h"
 | 
				
			||||||
# For laptop multi-gpu offloading
 | 
					# For laptop multi-gpu offloading
 | 
				
			||||||
alias nvidia_gpu="DRI_PRIME=1 __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia"
 | 
					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 DENO_INSTALL="/home/oliver/.deno"
 | 
				
			||||||
export PATH="$DENO_INSTALL/bin:$PATH"
 | 
					export PATH="$DENO_INSTALL/bin:$PATH"
 | 
				
			||||||
@@ -28,3 +29,17 @@ export WINEPREFIX="$HOME/.wine/"
 | 
				
			|||||||
export DXVK_HUD="fps"
 | 
					export DXVK_HUD="fps"
 | 
				
			||||||
export EDITOR="nvim"
 | 
					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
 | 
					 | 
				
			||||||
		Reference in New Issue
	
	Block a user