From 61fd643c0882db49ffc9acc24246f90dfbf72d7d Mon Sep 17 00:00:00 2001 From: Ryan Kes Date: Mon, 17 Feb 2020 14:13:34 +0100 Subject: [PATCH] Replace zsh with fish --- README.org | 62 +++++----- .../.config/alacritty/alacritty.yml.desktop | 2 +- bspwm/.config/bspwm/bspwmrc | 65 ++++++----- bspwm/.xinitrc | 12 +- fish/.config/omf/init.fish | 107 ++++++++++++++++++ install | 100 ++++++++++------ polybar/.local/bin/polybar-desktop | 6 +- polybar/.local/bin/polybar-laptop | 6 +- sxhkd/.config/sxhkd/sxhkdrc | 2 +- tmux/.tmux.conf | 2 +- zsh/.zprofile | 3 - zsh/.zshenv | 57 ---------- zsh/.zshrc | 81 ------------- 13 files changed, 243 insertions(+), 262 deletions(-) create mode 100644 fish/.config/omf/init.fish delete mode 100644 zsh/.zprofile delete mode 100644 zsh/.zshenv delete mode 100644 zsh/.zshrc diff --git a/README.org b/README.org index 06d9082..21f4176 100644 --- a/README.org +++ b/README.org @@ -8,14 +8,14 @@ - [[#maintainers][Maintainers]] - [[#prerequisites][Prerequisites]] - [[#configured-applications][Configured Applications]] -- [[#zsh][Zsh]] - - [[#theme][Theme]] - - [[#plugin-manager][Plugin Manager]] - - [[#plugins][Plugins]] +- [[#fish][Fish]] + - [[#theme][Theme]] + - [[#package-manager][Package Manager]] + - [[#packages][Packages]] - [[#neovim][Neovim]] - [[#theme-1][Theme]] - - [[#plugin-manager-1][Plugin Manager]] - - [[#plugins-1][Plugins]] + - [[#plugin-manager][Plugin Manager]] + - [[#plugins][Plugins]] - [[#general][General]] - [[#programming][Programming]] - [[#ui][UI]] @@ -31,17 +31,25 @@ A repository of my personal configuration files. + [[https://github.com/alrayyes][@alrayyes]] * Prerequisites +- [[https://brave.com/][brave]] +- [[https://github.com/baskerville/bspwm][bspwm]] +- [[https://the.exa.website/][exa]] +- [[https://github.com/junegunn/fzf][fzf]] +- [[https://git-scm.com/][git]] - [[http://www.gnu.org/software/stow/][stow]] - [[https://www.python.org/][Python]] +- [[https://fishshell.com/][fish]] +- [[https://github.com/baskerville/sxhkd][sxhkd]] +- [[https://github.com/freedesktop/xcompmgr][xcompmgr]] +- [[https://github.com/stoeckmann/xwallpaper][xwallpaper]] * Configured Applications - [[https://github.com/alacritty/][alacritty]] -- [[https://brave.com/][brave]] - [[https://github.com/baskerville/bspwm][bspwm]] - [[https://github.com/hlissner/doom-emacs][Doom Emacs]] - [[https://dunst-project.org/][dunst]] -- [[https://the.exa.website/][exa]] - [[https://firejail.wordpress.com/][firejail]] +- [[https://fishshell.com/][fish]] - [[https://git-scm.com/][git]] - [[https://gnupg.org/][gnupg]] - [[https://www.gtk.org/][gtk]] @@ -54,32 +62,20 @@ A repository of my personal configuration files. - [[https://tmux.github.io/][tmux]] - [[https://vifm.info/][vifm]] - [[https://weechat.org/][weechat]] -- [[https://github.com/freedesktop/xcompmgr][xcompmgr]] -- [[https://github.com/stoeckmann/xwallpaper][xwallpaper]] -* Zsh -** Theme -- [[https://github.com/denysdovhan/spaceship-prompt][spaceship zsh]] -** Plugin Manager -- [[https://github.com/zplug/zplug][zplug]] -** Plugins -- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/archlinux][archlinux]] -- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/composer][composer]] -- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/docker][docker]] -- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/docker-compose][docker-compose]] -- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/extract][extract]] -- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/fzf][fzf]] -- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/git][git]] -- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/gitignore][gitignore]] -- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/pass][pass]] -- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/ripgrep][ripgrep]] -- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/rsync][rsync]] -- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/sudo][sudo]] -- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/systemd][systemd]] -- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/tmux][tmux]] -- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/vi-mode][vi-mode]] -- [[https://github.com/zsh-users/zsh-autosuggestions][zsh-autosuggestions]] -- [[https://github.com/zsh-users/zsh-syntax-highlighting][zsh-syntax-highlighting]] +* Fish +*** Theme +- [[https://github.com/oh-my-fish/theme-bobthefish][bobthefish]] +*** Package Manager +- [[https://github.com/oh-my-fish/oh-my-fish][oh-my-fish]] +*** Packages +- [[https://github.com/patrickf3139/Colored-Man-Pages][colored-man-pages]] +- [[https://github.com/oh-my-fish/plugin-extract][extract]] +- [[https://github.com/jethrokuan/fzf][fzf]] +- [[https://github.com/oh-my-fish/plugin-gi][gi]] +- [[https://github.com/oh-my-fish/plugin-git-flow][git-flow]] +- [[https://github.com/oh-my-fish/plugin-sudope.git][sudope]] +- [[https://github.com/oh-my-fish/plugin-wttr][wttr]] * Neovim ** Theme diff --git a/alacritty/.config/alacritty/alacritty.yml.desktop b/alacritty/.config/alacritty/alacritty.yml.desktop index 0b6fba5..a204117 100644 --- a/alacritty/.config/alacritty/alacritty.yml.desktop +++ b/alacritty/.config/alacritty/alacritty.yml.desktop @@ -320,7 +320,7 @@ background_opacity: 0.8 #semantic_escape_chars: ",│`|:\"' ()[]{}<>\t" # When set to `true`, selected text will be copied to the primary clipboard. -#save_to_clipboard: false +save_to_clipboard: true # Allow terminal applications to change Alacritty's window title. #dynamic_title: true diff --git a/bspwm/.config/bspwm/bspwmrc b/bspwm/.config/bspwm/bspwmrc index c80b532..b048201 100755 --- a/bspwm/.config/bspwm/bspwmrc +++ b/bspwm/.config/bspwm/bspwmrc @@ -1,38 +1,37 @@ -#! /bin/sh +#!/usr/bin/env fish sxhkd & # Set screen orientation if second monitor is connected -SCREENCOUNT=$(xrandr | grep -c "\*") +set SCREENCOUNT (xrandr | grep -c "\*") # If multi screen add special mode for monitor so it supports 1440p over HDMI -if [ "$SCREENCOUNT" -eq 2 ]; then - bspc monitor DP-1 -d 2 3 4 5 6 7 8 9 10 - bspc monitor HDMI-2 -d 1 - if [ -f "$HOME/.local/bin/screen_desktop" ]; then - screen_desktop - fi - if [ -f "$HOME/.local/bin/polybar-desktop" ]; then - polybar-desktop - fi +if [ "$SCREENCOUNT" -eq 2 ] + bspc monitor DP-1 -d 2 3 4 5 6 7 8 9 10 + bspc monitor HDMI-2 -d 1 + if [ -f "$HOME/.local/bin/screen_desktop" ] + screen_desktop + end + if [ -f "$HOME/.local/bin/polybar-desktop" ] + polybar-desktop + end else - bspc monitor -d 1 2 3 4 5 6 7 8 9 0 - if [ -f "$HOME/.local/bin/screen" ]; then - screen - fi - if [ -f "$HOME/.local/bin/polybar-laptop" ]; then - polybar laptop-top & - polybar laptop-bottom & - fi -fi + bspc monitor -d 1 2 3 4 5 6 7 8 9 0 + if [ -f "$HOME/.local/bin/screen" ] + screen + end + if [ -f "$HOME/.local/bin/polybar-laptop" ] + polybar-laptop + end +end xcompmgr & -if [ -e ~/.cache/wall1.png ] && [ -e ~/.cache/wall2.png ]; then - xwallpaper --output HDMI-2 --zoom ~/.cache/wall2.png --output DP-1 --zoom ~/.cache/wall1.png & -elif [ -e ~/.cache/wall1.png ]; then - xwallpaper --output eDP1 --zoom ~/.cache/wall1.png & -fi +if [ -e ~/.cache/wall1.png ] && [ -e ~/.cache/wall2.png ] + xwallpaper --output HDMI-2 --zoom ~/.cache/wall2.png --output DP-1 --zoom ~/.cache/wall1.png & +else if [ -e ~/.cache/wall1.png ] + xwallpaper --output eDP1 --zoom ~/.cache/wall1.png & +end # switch off microphones amixer -c 2 set Mic nocap @@ -52,15 +51,15 @@ alacritty --class Spt,Spt -e spt & xss-lock -n ~/.local/bin/lock -- ~/.local/bin/lock & xautolock -time 10 -locker ~/.local/bin/lock & -if [ -e /usr/bin/brave ]; then - brave & +if [ -e /usr/bin/brave ] + brave & else - if [ -e /usr/bin/firefox ]; then - firefox & - elif [ -e /usr/bin/iceweasel ]; then - iceweasel & - fi -fi + if [ -e /usr/bin/firefox ] + firefox & + else if [ -e /usr/bin/iceweasel ] + iceweasel & + end +end bspc config border_width 2 bspc config window_gap 12 diff --git a/bspwm/.xinitrc b/bspwm/.xinitrc index e726a86..81cbc3d 100644 --- a/bspwm/.xinitrc +++ b/bspwm/.xinitrc @@ -1,14 +1,4 @@ setxkbmap -option caps:escape - -[[ -f ~/.Xresources ]] && xrdb -merge -I$HOME ~/.Xresources - -# Enable numberlock -if [ -x /usr/bin/numlockx ]; then - /usr/bin/numlockx on -fi - -export _JAVA_AWT_WM_NONREPARENTING=1 -export AWT_TOOLKIT=MToolkit -wmname LG3D +xrdb -merge -I$HOME ~/.Xresources exec bspwm diff --git a/fish/.config/omf/init.fish b/fish/.config/omf/init.fish new file mode 100644 index 0000000..ef4fd62 --- /dev/null +++ b/fish/.config/omf/init.fish @@ -0,0 +1,107 @@ +# Start X at login +if status is-login + if test -z "$DISPLAY" -a $XDG_VTNR = 1 + set -g -x SXHKD_SHELL '/usr/bin/sh' + + # Enable numberlock + if [ -x "/usr/bin/numlockx" ] + /usr/bin/numlockx on + end + + exec startx -- -keeptty + end +end + +function fish_greeting + neofetch +end + +function path_if_exists + if [ -d "$argv" ] + set PATH $PATH "$argv" + end +end + +# Add paths +path_if_exists ~/.config/yarn/global/node_modules/.bin +path_if_exists ~/.local/bin +path_if_exists ~/.emacs.d/bin + +# Set GPG TTY +set GPG_TTY (tty) + +# Set default browser +if [ -e "/usr/bin/brave" ] + set -g BROWSER "brave" +else + if [ -e "/usr/bin/firefox" ] + set -g BROWSER "firefox" + else if [ -e "/usr/bin/iceweasel" ] + set -g BROWSER "iceweasel" + end +end + +# Set default terminal +set -g TERMINAL "alacritty" + +# pkg editor +set -g VISUAL "nvim" + +# editor +set -g EDITOR "nvim" + +# Enable password store extensions +set -g PASSWORD_STORE_ENABLE_EXTENSIONS "true" + +# Use alternative muhome +set -g MU_HOME "/home/alrayyes/.cache/mu" + +# bobthefish +set -g theme_nerd_fonts yes +set -g theme_color_scheme gruvbox + +# sudope +set -g sudope_sequence \e\e + +# nvim alias +alias v="nvim" +alias sv="sudo nvim" + +# ls alias +alias ls="exa" +alias l="exa -al" + +# vifm alias +alias vifm="vifmrun" + +# pacman aliases +alias pacrmorphans="sudo pacman -Rs (pacman -Qtdq)" +alias pacrem="sudo pacman -Rns" +alias gpoat="git push origin --all && git push origin --tags" + +# Refresh gpg-agent tty in case user switches into an X session +gpg-connect-agent updatestartuptty /bye >/dev/null + +# Set fzf keybindings here for now as they don't work with stable version of omf https://github.com/jethrokuan/fzf/issues/109 +bind \co '__fzf_find_file' +bind \cr '__fzf_reverse_isearch' +bind \ec '__fzf_cd' +bind \eC '__fzf_cd --hidden' +bind \eO '__fzf_open' +bind \eo '__fzf_open --editor' + +if bind -M insert >/dev/null 2>/dev/null + bind -M insert \co '__fzf_find_file' + bind -M insert \cr '__fzf_reverse_isearch' + bind -M insert \ec '__fzf_cd' + bind -M insert \eC '__fzf_cd --hidden' + bind -M insert \eO '__fzf_open' + bind -M insert \eo '__fzf_open --editor' +end + +if set -q FZF_COMPLETE + bind \t '__fzf_complete' + if bind -M insert >/dev/null 2>/dev/null + bind -M insert \t '__fzf_complete' + end +end diff --git a/install b/install index ef90fec..b3df1dd 100755 --- a/install +++ b/install @@ -1,52 +1,78 @@ -#!/usr/bin/env sh +#!/usr/bin/env fish -# We need the environment to be able to symlink files accordingly -case "$1" in -desktop) - EXTENSION="desktop" - ;; -thinkpad) - EXTENSION="thinkpad" - ;; -esac +function mkdir_if_not_exist + if [ ! -d "$argv" ] + echo "Creating directory $argv" + mkdir -p "$argv" + end +end -# Create nvim config directory if it doesn't exist -if [ ! -d ~/.config/nvim ]; then - echo "Creating ~/.config/nvim" - mkdir -p ~/.config/nvim -fi +function install_omf_package_if_not_exist + if test (omf list | grep -c "$argv") -eq 0 + omf install "$argv" + end +end -for d in $(find -- */ -maxdepth 0 -type d | cut -f1 -d '/'); do - echo "Linking $d..." - (stow -t "$HOME" "$d") -done +# Create directories that need to exist +mkdir_if_not_exist ~/.cache/mpd +mkdir_if_not_exist ~/.config/alacritty +mkdir_if_not_exist ~/.config/nvim +mkdir_if_not_exist ~/.config/fish +mkdir_if_not_exist ~/.config/omf +mkdir_if_not_exist ~/.config/mpd +mkdir_if_not_exist ~/.weechat + +for d in (find -- */ -maxdepth 0 -type d | cut -f1 -d '/') + echo "Linking $d..." + stow -t "$HOME" "$d" +end # Refresh xgd -update-desktop-database ~/.local/share/applications/ -xdg-mime default org-protocol.desktop x-scheme-handler/org-protocol +if test (grep -c 'x-scheme-handler/org-protocol=org-protocol.desktop' ~/.config/mimeapps.list) -eq 0 + echo "Refreshing xgd to handle org-protocol" + update-desktop-database ~/.local/share/applications/ + xdg-mime default org-protocol.desktop x-scheme-handler/org-protocol +end -# Install zplug if it doesn't exist yet -if [ ! -d ~/.zplug ]; then - echo "Installing zplug" - curl -sL --proto-redir -all,https https://raw.githubusercontent.com/zplug/installer/master/installer.zsh | zsh -fi +# Install oh-my-fish if it isn't installed +if [ ! -d ~/.local/share/omf ] + curl -L https://get.oh-my.fish | fish +end + +# Install oh-my-fish plugins +install_omf_package_if_not_exist bobthefish +install_omf_package_if_not_exist colored-man-pages +install_omf_package_if_not_exist extract +install_omf_package_if_not_exist fzf +install_omf_package_if_not_exist gi +install_omf_package_if_not_exist git-flow +install_omf_package_if_not_exist sudope +install_omf_package_if_not_exist wttr # Install vim plugins & requirements -if [ ! "$(pip list --user | grep 'pynvim' | wc -l)" -ge 1 ]; then - pip install --user pynvim -fi +if test (pip list --user | grep -c 'pynvim') -ne 1 + pip install --user pynvim +end # Install plug package manager if it doesn't exist -if [ ! -d ~/.config/nvim/plugged ]; then - curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \ - https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim -fi +if [ ! -d ~/.config/nvim/plugged ] + curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \ + https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim +end # Install Neovim plugins nvim +PlugInstall +qall +# Setup broot if not done already +if [ ! -d ~/.local/share/broot ] + broot --install +end + +# Update fish completions (auto generated from man pages) +fish_update_completions + # Notify user to manually symlink files -if [ ! -z "$EXTENSION" ]; then - echo "\n\nDon't forget to symlink these files:\n\n" - find ~ \( -type l -o -type f \) -name "*.$EXTENSION" -exec ls -al {} \; -fi +if [ -n "$argv[1]" ] + printf "\n\nDon't forget to symlink these files:\n\n" + find ~ \( -type l -o -type f \) -name "*.$argv[1]" -exec ls -al {} \; +end diff --git a/polybar/.local/bin/polybar-desktop b/polybar/.local/bin/polybar-desktop index d258865..8f0ee4a 100755 --- a/polybar/.local/bin/polybar-desktop +++ b/polybar/.local/bin/polybar-desktop @@ -1,10 +1,12 @@ -#!/usr/bin/env bash +#!/usr/bin/env fish # Terminate already running bar instances killall -q polybar # Wait until the processes have been shut down -while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done +while pgrep -u $UID -x polybar >/dev/null + sleep 1 +end # Launch bar1 and bar2 polybar monitor1 & diff --git a/polybar/.local/bin/polybar-laptop b/polybar/.local/bin/polybar-laptop index 5e854d5..07619f5 100755 --- a/polybar/.local/bin/polybar-laptop +++ b/polybar/.local/bin/polybar-laptop @@ -1,10 +1,12 @@ -#!/usr/bin/env bash +#!/usr/bin/env fish # Terminate already running bar instances killall -q polybar # Wait until the processes have been shut down -while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done +while pgrep -u $UID -x polybar >/dev/null + sleep 1 +end # Launch bar1 and bar2 polybar laptop-top & diff --git a/sxhkd/.config/sxhkd/sxhkdrc b/sxhkd/.config/sxhkd/sxhkdrc index eb3bf75..d91b672 100644 --- a/sxhkd/.config/sxhkd/sxhkdrc +++ b/sxhkd/.config/sxhkd/sxhkdrc @@ -64,7 +64,7 @@ shift + XF86Eject # terminal emulator super + Return - $TERMINAL + alacritty # program launcher super + @space diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf index 5e33cec..d7a9a35 100644 --- a/tmux/.tmux.conf +++ b/tmux/.tmux.conf @@ -12,7 +12,7 @@ set -g @themepack 'powerline/double/magenta' set -g @resurrect-strategy-nvim 'session' # Set zsh as default command so profile etc is properly loaded -set-option -g default-command zsh +set-option -g default-command fish # Other examples: # set -g @plugin 'github_username/plugin_name' diff --git a/zsh/.zprofile b/zsh/.zprofile deleted file mode 100644 index 3304d79..0000000 --- a/zsh/.zprofile +++ /dev/null @@ -1,3 +0,0 @@ -if [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then - exec startx -fi diff --git a/zsh/.zshenv b/zsh/.zshenv deleted file mode 100644 index c00a533..0000000 --- a/zsh/.zshenv +++ /dev/null @@ -1,57 +0,0 @@ -path_if_exists() { - if [[ -d $1 ]]; then - export PATH="$1:$PATH" - fi -} - -# Stop tmux bitching about 256 colours -TERM="xterm-256color" - -# PATH -path_if_exists ~/.config/yarn/global/node_modules/.bin -path_if_exists ~/.local/bin -path_if_exists ~/.emacs.d/bin - -# Set GPG TTY -export GPG_TTY="$(tty)" - -# Set default browser -if [ -e "/usr/bin/brave" ]; then - export BROWSER="brave" -else - if [ -e "/usr/bin/firefox" ]; then - export BROWSER="firefox" - elif [ -e "/usr/bin/iceweasel" ]; then - export BROWSER="iceweasel" - fi -fi - -# Set default terminal -export TERMINAL="alacritty" - -# pkg editor -export VISUAL="nvim" - -# editor -export EDITOR="nvim" - -# Enable password store extensions -export PASSWORD_STORE_ENABLE_EXTENSIONS="true" - -# This needs to be set for bspwm to see config -export XDG_CONFIG_HOME="$HOME/.config" - -# Save history file in proper place -HISTFILE=~/.cache/zsh/history - -# Use alternative muhome -export MU_HOME="/home/alrayyes/.cache/mu" - -# Needed to get zsh to play nice with emacs vterm -if [[ "$INSIDE_EMACS" = 'vterm' ]]; then - alias clear='printf "\e]51;Evterm-clear-scrollback\e\\";tput clear' -fi -vterm_prompt_end() { - printf "\e]51;A$(whoami)@$(hostname):$(pwd)\e\\" -} -PROMPT=$PROMPT'%{$(vterm_prompt_end)%}' diff --git a/zsh/.zshrc b/zsh/.zshrc deleted file mode 100644 index ab63f2c..0000000 --- a/zsh/.zshrc +++ /dev/null @@ -1,81 +0,0 @@ -source_if_exists() { - if [[ -f $1 ]]; then - source $1 - fi -} - -# Check if zplug is installed -if [[ ! -d ~/.zplug ]]; then - git clone https://github.com/b4b4r07/zplug ~/.zplug -fi -source ~/.zplug/init.zsh - -# Spaceship theme -zplug "denysdovhan/spaceship-prompt", use:spaceship.zsh, from:github, as:theme - -# Oh my zsh lugins -# sudo must start after vi-mode for it to work properly -zplug "plugins/archlinux", from:oh-my-zsh -zplug "plugins/composer", from:oh-my-zsh -zplug "plugins/docker", from:oh-my-zsh -zplug "plugins/docker-compose", from:oh-my-zsh -zplug "plugins/extract", from:oh-my-zsh -zplug "plugins/fzf", from:oh-my-zsh -zplug "plugins/git", from:oh-my-zsh -zplug "plugins/gitignore", from:oh-my-zsh -zplug "plugins/pass", from:oh-my-zsh -zplug "plugins/ripgrep", from:oh-my-zsh -zplug "plugins/rsync", from:oh-my-zsh -zplug "plugins/systemd", from:oh-my-zsh -zplug "plugins/tmux", from:oh-my-zsh -zplug "plugins/vi-mode", from:oh-my-zsh -zplug "plugins/sudo", from:oh-my-zsh -zplug "plugins/yarn", from:oh-my-zsh -zplug "zsh-users/zsh-autosuggestions", from:github, defer:3 -zplug "zsh-users/zsh-syntax-highlighting", from:github, defer:3 - -# Install packages -if ! zplug check --verbose; then - printf "Install zplug plugins? [y/N]: " - if read -q; then - echo - zplug install - fi -fi - -zplug load - -# vim alias -alias v="nvim" -alias sv="sudo nvim" - -# ls alias -alias ls="exa" -alias l="exa -al" - -# vifm alias -alias vifm="vifmrun" - -# Use lf to switch directories and bind it to ctrl-o -lfcd() { - tmp="$(mktemp)" - lf -last-dir-path="$tmp" "$@" - if [ -f "$tmp" ]; then - dir="$(cat "$tmp")" - rm -f "$tmp" - [ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir" - fi -} - -bindkey -s '^o' 'lfcd\n' - -# Set GPG TTY -export GPG_TTY="$(tty)" - -# Refresh gpg-agent tty in case user switches into an X session -gpg-connect-agent updatestartuptty /bye >/dev/null - -# Needed for broot -source /home/alrayyes/.config/broot/launcher/bash/br - -neofetch