Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ###
- # https://fishshell.com/docs/current/index.html
- # https://github.com/jorgebucaran/cookbook.fish
- # themes
- # https://github.com/oh-my-fish/oh-my-fish/blob/master/docs/Themes.md
- # Plugins
- # https://github.com/jethrokuan/fzf
- # https://github.com/IlanCosman/tide.git - fisher install IlanCosman/tide@v5
- # https://github.com/jhillyerd/plugin-git
- # tools
- # https://github.com/jorgebucaran/fisher
- # https://github.com/oh-my-fish/oh-my-fish
- # https://github.com/danhper/fundle
- #set VIRTUAL_ENV_DISABLE_PROMPT "1"
- if not status --is-interactive
- exit
- end
- # Load private config
- if [ -f $HOME/.config/fish/private.fish ]
- source $HOME/.config/fish/private.fish
- end
- # Git
- if [ -f $HOME/.config/fish/git.fish ]
- source $HOME/.config/fish/git.fish
- end
- # Aliases
- if [ -f $HOME/.config/fish/alias.fish ]
- source $HOME/.config/fish/alias.fish
- end
- # reload fish config
- function reload
- exec fish
- set -l config (status -f)
- echo "reloading: $config"
- end
- # User paths
- set -e fish_user_paths
- set -U fish_user_paths $HOME/.bin $HOME/.local/bin $HOME/Applications $fish_user_paths
- # Starship prompt
- #if command -sq starship
- # starship init fish | source
- #end
- # sets tools
- set -x EDITOR nano
- set -x VISUAL nano
- #set -x TERM alacritty
- # Sets the terminal type for proper colors
- set TERM "xterm-256color"
- # Suppresses fish's intro message
- set fish_greeting
- #function fish_greeting
- # fish_logo
- #end
- # Prevent directories names from being shortened
- set fish_prompt_pwd_dir_length 0
- set -x FZF_DEFAULT_OPTS "--color=16,header:13,info:5,pointer:3,marker:9,spinner:1,prompt:5,fg:7,hl:14,fg+:3,hl+:9 --inline-info --tiebreak=end,length --bind=shift-tab:toggle-down,tab:toggle-up"
- # "bat" as manpager
- set -x MANPAGER "sh -c 'col -bx | bat -l man -p'"
- set -g theme_nerd_fonts yes
- if status --is-login
- set -gx PATH $PATH ~/.bin
- end
- if status --is-login
- set -gx PATH $PATH ~/.local/bin
- end
- if type -q bat
- alias cat="bat --paging=never"
- end
- if command -sq fzf && type -q fzf_configure_bindings
- fzf_configure_bindings --directory=\ct
- end
- if not set -q -g fish_user_abbreviations
- set -gx fish_user_abbreviations
- end
- #if type -f fortune >/dev/null
- # set -l fortune "fortune -a"
- # if type -f lolcat >/dev/null
- # set fortune "$fortune | lolcat"
- # end
- # eval $fortune
- # echo
- #end
- if test tree >/dev/null
- function l1; tree --dirsfirst -ChFL 1 $argv; end
- function l2; tree --dirsfirst -ChFL 2 $argv; end
- function l3; tree --dirsfirst -ChFL 3 $argv; end
- function ll1; tree --dirsfirst -ChFupDaL 1 $argv; end
- function ll2; tree --dirsfirst -ChFupDaL 2 $argv; end
- function ll3; tree --dirsfirst -ChFupDaL 3 $argv; end
- end
- if type -q direnv
- eval (direnv hook fish)
- end
- ### FUNCTIONS ###
- # Fish command history
- function history
- builtin history --show-time='%F %T ' | sort
- end
- # Make a backup file
- function backup --argument filename
- cp $filename $filename.bak
- end
- # recently installed packages
- function ripp --argument length -d "List the last n (100) packages installed"
- if test -z $length
- set length 100
- end
- expac --timefmt='%Y-%m-%d %T' '%l\t%n' | sort | tail -n $length | nl
- end
- function gl
- git log --graph --color=always --format="%C(auto)%h%d %s %C(black)%C(bold)%cr" $argv | fzf --ansi --no-sort --reverse --tiebreak=index --toggle-sort=\` --bind "ctrl-m:execute: echo '{}' | grep -o '[a-f0-9]\{7\}' | head -1 | xargs -I % sh -c 'git show --color=always % | less -R'"
- end
- function ex --description "Extract bundled & compressed files"
- if test -f "$argv[1]"
- switch $argv[1]
- case '*.tar.bz2'
- tar xjf $argv[1]
- case '*.tar.gz'
- tar xzf $argv[1]
- case '*.bz2'
- bunzip2 $argv[1]
- case '*.rar'
- unrar $argv[1]
- case '*.gz'
- gunzip $argv[1]
- case '*.tar'
- tar xf $argv[1]
- case '*.tbz2'
- tar xjf $argv[1]
- case '*.tgz'
- tar xzf $argv[1]
- case '*.zip'
- unzip $argv[1]
- case '*.Z'
- uncompress $argv[1]
- case '*.7z'
- 7z $argv[1]
- case '*.deb'
- ar $argv[1]
- case '*.tar.xz'
- tar xf $argv[1]
- case '*.tar.zst'
- tar xf $argv[1]
- case '*'
- echo "'$argv[1]' cannot be extracted via ex"
- end
- else
- echo "'$argv[1]' is not a valid file"
- end
- end
- function less
- command less -R $argv
- end
- function cd
- builtin cd $argv; and ls
- end
- ### ALIASES ###
- #list
- alias ls='exa -al --color=always --group-directories-first' # my preferred listing
- alias la='exa -a --color=always --group-directories-first' # all files and dirs
- alias ll='exa -l --color=always --group-directories-first' # long format
- alias lt='exa -aT --color=always --group-directories-first' # tree listing
- alias l.='exa -a | egrep "^\."'
- ## Colorize the grep command output for ease of use (good for log files)##
- alias grep='grep --color=auto'
- alias egrep='egrep --color=auto'
- alias fgrep='fgrep --color=auto'
- #readable output
- alias df='df -h'
- #pacman unlock
- alias unlock="sudo rm /var/lib/pacman/db.lck"
- alias rmpacmanlock="sudo rm /var/lib/pacman/db.lck"
- #arcolinux logout unlock
- alias rmlogoutlock="sudo rm /tmp/arcologout.lock"
- #which graphical card is working
- alias whichvga="/usr/local/bin/arcolinux-which-vga"
- #free
- alias free="free -mt"
- #continue download
- alias wget="wget -c"
- #userlist
- alias userlist="cut -d: -f1 /etc/passwd | sort"
- #merge new settings
- alias merge="xrdb -merge ~/.Xresources"
- # Aliases for software managment
- # pacman
- alias pac='sudo pacman --color auto'
- alias up='sudo pacman -Syyu'
- # paru as aur helper - updates everything
- alias pksyua="paru -Syu --noconfirm"
- alias pal="paru -Syu --noconfirm"
- #ps
- alias psa="ps auxf"
- alias psgrep="ps aux | grep -v grep | grep -i -e VSZ -e"
- #grub update
- alias upgrub="sudo grub-mkconfig -o /boot/grub/grub.cfg"
- #grub issue 08/2022
- alias install-grub-efi="sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi"
- #add new fonts
- alias upfc='sudo fc-cache -fv'
- #copy/paste all content of /etc/skel over to home folder - backup of config created - beware
- #skel alias has been replaced with a script at /usr/local/bin/skel
- #backup contents of /etc/skel to hidden backup folder in home/user
- alias bupskel='cp -Rf /etc/skel ~/.skel-backup-$(date +%Y.%m.%d-%H.%M.%S)'
- #copy shell configs
- alias cb='cp /etc/skel/.bashrc ~/.bashrc && echo "Copied."'
- alias cz='cp /etc/skel/.zshrc ~/.zshrc && exec zsh'
- alias cf='cp /etc/skel/.config/fish/config.fish ~/.config/fish/config.fish && echo "Copied."'
- #switch between bash and zsh
- alias tobash="sudo chsh $USER -s /bin/bash && echo 'Now log out.'"
- alias tozsh="sudo chsh $USER -s /bin/zsh && echo 'Now log out.'"
- alias tofish="sudo chsh $USER -s /bin/fish && echo 'Now log out.'"
- #switch between lightdm and sddm
- alias tolightdm="sudo pacman -S lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings --noconfirm --needed ; sudo systemctl enable lightdm.service -f ; echo 'Lightm is active - reboot now'"
- alias tosddm="sudo pacman -S sddm --noconfirm --needed ; sudo systemctl enable sddm.service -f ; echo 'Sddm is active - reboot now'"
- alias toly="sudo pacman -S ly --noconfirm --needed ; sudo systemctl enable ly.service -f ; echo 'Ly is active - reboot now'"
- alias togdm="sudo pacman -S gdm --noconfirm --needed ; sudo systemctl enable gdm.service -f ; echo 'Gdm is active - reboot now'"
- alias tolxdm="sudo pacman -S lxdm --noconfirm --needed ; sudo systemctl enable lxdm.service -f ; echo 'Lxdm is active - reboot now'"
- # kill commands
- # quickly kill conkies
- alias kc='killall conky'
- # quickly kill polybar
- alias kp='killall polybar'
- # quickly kill picom
- alias kpi='killall picom'
- #hardware info --short
- alias hw="hwinfo --short"
- #audio check pulseaudio or pipewire
- alias audio="pactl info | grep 'Server Name'"
- #skip integrity check
- alias paruskip='paru -S --mflags --skipinteg'
- #check vulnerabilities microcode
- alias microcode='grep . /sys/devices/system/cpu/vulnerabilities/*'
- #get fastest mirrors in your neighborhood
- alias mr="sudo reflector -f 30 -l 30 --number 10 --verbose --save /etc/pacman.d/mirrorlist"
- alias mrd="sudo reflector --latest 30 --number 10 --sort delay --save /etc/pacman.d/mirrorlist"
- alias mrs="sudo reflector --latest 30 --number 10 --sort score --save /etc/pacman.d/mirrorlist"
- alias mra="sudo reflector --latest 30 --number 10 --sort age --save /etc/pacman.d/mirrorlist"
- #our experimental - best option for the moment
- alias mirrorx="sudo reflector --age 6 --latest 20 --fastest 20 --threads 5 --sort rate --protocol https --save /etc/pacman.d/mirrorlist"
- alias mirrorxx="sudo reflector --age 6 --latest 20 --fastest 20 --threads 20 --sort rate --protocol https --save /etc/pacman.d/mirrorlist"
- alias ram='rate-mirrors --allow-root --disable-comments arch | sudo tee /etc/pacman.d/mirrorlist'
- alias rams='rate-mirrors --allow-root --disable-comments --protocol https arch | sudo tee /etc/pacman.d/mirrorlist'
- #shopt
- #shopt -s autocd # change to named directory
- #shopt -s cdspell # autocorrects cd misspellings
- #shopt -s cmdhist # save multi-line commands in history as single line
- #shopt -s dotglob
- #shopt -s histappend # do not overwrite history
- #shopt -s expand_aliases # expand aliases
- #youtube download
- alias yta-aac="yt-dlp --extract-audio --audio-format aac "
- alias yta-best="yt-dlp --extract-audio --audio-format best "
- alias yta-flac="yt-dlp --extract-audio --audio-format flac "
- alias yta-mp3="yt-dlp --extract-audio --audio-format mp3 "
- alias ytv-best="yt-dlp -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/bestvideo+bestaudio' --merge-output-format mp4 "
- #Recent Installed Packages
- alias rip="expac --timefmt='%Y-%m-%d %T' '%l\t%n %v' | sort | tail -200 | nl"
- alias riplong="expac --timefmt='%Y-%m-%d %T' '%l\t%n %v' | sort | tail -3000 | nl"
- #iso and version used to install ArcoLinux
- alias iso="cat /etc/dev-rel | awk -F '=' '/ISO/ {print $2}'"
- alias isoo="cat /etc/dev-rel"
- #Cleanup orphaned packages
- alias cleanup='sudo pacman -Rns $(pacman -Qtdq)'
- #clear
- alias clean="clear; seq 1 $(tput cols) | sort -R | sparklines | lolcat"
- #search content with ripgrep
- alias rg="rg --sort path"
- #get the error messages from journalctl
- alias jctl="journalctl -p 3 -xb"
- #nano for important configuration files
- #know what you do in these files
- alias nlxdm="sudo $EDITOR /etc/lxdm/lxdm.conf"
- alias nlightdm="sudo $EDITOR /etc/lightdm/lightdm.conf"
- alias npacman="sudo $EDITOR /etc/pacman.conf"
- alias ngrub="sudo $EDITOR /etc/default/grub"
- alias nconfgrub="sudo $EDITOR /boot/grub/grub.cfg"
- alias nmkinitcpio="sudo $EDITOR /etc/mkinitcpio.conf"
- alias nmirrorlist="sudo $EDITOR /etc/pacman.d/mirrorlist"
- alias narcomirrorlist="sudo $EDITOR /etc/pacman.d/arcolinux-mirrorlist"
- alias nsddm="sudo $EDITOR /etc/sddm.conf"
- alias nsddmk="sudo $EDITOR /etc/sddm.conf.d/kde_settings.conf"
- alias nfstab="sudo $EDITOR /etc/fstab"
- alias nnsswitch="sudo $EDITOR /etc/nsswitch.conf"
- alias nsamba="sudo $EDITOR /etc/samba/smb.conf"
- alias ngnupgconf="sudo $EDITOR /etc/pacman.d/gnupg/gpg.conf"
- alias nhosts="sudo $EDITOR /etc/hosts"
- alias nhostname="sudo $EDITOR /etc/hostname"
- alias nb="$EDITOR ~/.bashrc"
- alias nz="$EDITOR ~/.zshrc"
- alias nf="$EDITOR ~/.config/fish/config.fish"
- alias nneofetch="$EDITOR ~/.config/neofetch/config.conf"
- #reading logs with bat
- alias lcalamares="bat /var/log/Calamares.log"
- alias lpacman="bat /var/log/pacman.log"
- alias lxorg="bat /var/log/Xorg.0.log"
- alias lxorgo="bat /var/log/Xorg.0.log.old"
- #gpg
- #verify signature for isos
- alias gpg-check="gpg2 --keyserver-options auto-key-retrieve --verify"
- alias fix-gpg-check="gpg2 --keyserver-options auto-key-retrieve --verify"
- #receive the key of a developer
- alias gpg-retrieve="gpg2 --keyserver-options auto-key-retrieve --receive-keys"
- alias fix-gpg-retrieve="gpg2 --keyserver-options auto-key-retrieve --receive-keys"
- alias fix-keyserver="[ -d ~/.gnupg ] || mkdir ~/.gnupg ; cp /etc/pacman.d/gnupg/gpg.conf ~/.gnupg/ ; echo 'done'"
- #fixes
- alias fix-perms="sudo chown -R $USER:$USER ~/.config ~/.local"
- alias keyfix="/usr/local/bin/arcolinux-fix-pacman-databases-and-keys"
- alias key-fix="/usr/local/bin/arcolinux-fix-pacman-databases-and-keys"
- alias keys-fix="/usr/local/bin/arcolinux-fix-pacman-databases-and-keys"
- alias fixkey="/usr/local/bin/arcolinux-fix-pacman-databases-and-keys"
- alias fixkeys="/usr/local/bin/arcolinux-fix-pacman-databases-and-keys"
- alias fix-key="/usr/local/bin/arcolinux-fix-pacman-databases-and-keys"
- alias fix-keys="/usr/local/bin/arcolinux-fix-pacman-databases-and-keys"
- alias fix-pacman-conf="/usr/local/bin/arcolinux-fix-pacman-conf"
- alias fix-pacman-keyserver="/usr/local/bin/arcolinux-fix-pacman-gpg-conf"
- #maintenance
- alias big="expac -H M '%m\t%n' | sort -h | nl"
- alias dgrada="sudo downgrade --ala-url https://ant.seedhost.eu/arcolinux/"
- #hblock (stop tracking with hblock)
- #use unhblock to stop using hblock
- alias unhblock="hblock -S none -D none"
- #systeminfo
- alias probe="sudo -E hw-probe -all -upload"
- alias sysfailed="systemctl list-units --failed"
- #shutdown or reboot
- alias ssn="sudo shutdown now"
- alias sr="sudo reboot"
- #update betterlockscreen images
- alias bls="betterlockscreen -u /usr/share/backgrounds/arcolinux/"
- #give the list of all installed desktops - xsessions desktops
- alias xd="ls /usr/share/xsessions"
- alias xdw="ls /usr/share/wayland-sessions"
- #wayland aliases
- alias wsimplescreenrecorder="wf-recorder -a"
- #btrfs aliases
- alias btrfsfs="sudo btrfs filesystem df /"
- alias btrfsli="sudo btrfs su li / -t"
- #snapper aliases
- alias snapcroot="sudo snapper -c root create-config /"
- alias snapchome="sudo snapper -c home create-config /home"
- alias snapli="sudo snapper list"
- alias snapcr="sudo snapper -c root create"
- alias snapch="sudo snapper -c home create"
- #Leftwm aliases
- alias lti="leftwm-theme install"
- alias ltu="leftwm-theme uninstall"
- alias lta="leftwm-theme apply"
- alias ltupd="leftwm-theme update"
- alias ltupg="leftwm-theme upgrade"
- #arcolinux applications
- #att is a symbolic link now
- #alias att="archlinux-tweak-tool"
- alias adt="arcolinux-desktop-trasher"
- alias abl="arcolinux-betterlockscreen"
- alias agm="arcolinux-get-mirrors"
- alias amr="arcolinux-mirrorlist-rank-info"
- alias aom="arcolinux-osbeck-as-mirror"
- alias ars="arcolinux-reflector-simple"
- alias atm="arcolinux-tellme"
- alias avs="arcolinux-vbox-share"
- alias awa="arcolinux-welcome-app"
- #remove
- alias rmgitcache="rm -r ~/.cache/git"
- #moving your personal files and folders from /personal to ~
- function personal
- cp -rf /personal/ ~
- cp -rf /personal/.* ~
- end
- # git
- # using plugin
- # omf install https://github.com/jhillyerd/plugin-git
- alias undopush "git push -f origin HEAD^:master"
- # reporting tools - install when not installed
- #neofetch
- #screenfetch
- #alsi
- #paleofetch
- #fetch
- #hfetch
- #sfetch
- #ufetch
- #ufetch-arco
- #pfetch
- #sysinfo
- #sysinfo-retro
- #cpufetch
- colorscript random
- # colors to set or unset
- #set fish_color_autosuggestion "#969896"
- #set fish_color_cancel -r
- #set fish_color_command "#0782DE"
- #set fish_color_comment "#f0c674"
- #set fish_color_cwd "#008000"
- #set fish_color_cwd_root red
- #set fish_color_end "#b294bb"
- #set fish_color_error "#fb4934"
- #set fish_color_escape "#fe8019"
- #set fish_color_history_current --bold
- #set fish_color_host "#85AD82"
- #set fish_color_host_remote yellow
- #set fish_color_match --background=brblue
- #set fish_color_normal normal
- #set fish_color_operator "#fe8019"
- #set fish_color_param "#81a2be"
- #set fish_color_quote "#b8bb26"
- #set fish_color_redirection "#d3869b"
- #set fish_color_search_match bryellow background=brblack
- #set fish_color_selection white --bold background=brblack
- #set fish_color_status red
- #set fish_color_user brgreen
- #set fish_color_valid_path --underline
- #set fish_pager_color_completion normal
- #set fish_pager_color_description "#B3A06D" yellow
- #set fish_pager_color_prefix normal --bold underline
- #set fish_pager_color_prefix white --bold --underline
- #set fish_pager_color_progress brwhite --background=cyan
- #set fish_color_search_match --background="#60AEFF"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement