# # In ~/.config/fish/configs/alias_useful.fish # ################# STUFF YOU HAVE INSTALLED ##################################### alias remount='sudo mount -a' alias mount_config='sudo nano /etc/fstab' alias force_delete='sudo rm -rf' # Delete Folder/Files with included Folder/Files alias own='sudo chown -R "$USER":"$USER" themes' alias right='sudo chmod -R 755' alias reload='clear && omf reload' alias fish_config='nano $HOME/.config/fish/config.fish' # Open the fish Config in Text editor alias ip 'ip -color' alias psmem 'ps auxf | sort -nr -k 4' alias psmem10 'ps auxf | sort -nr -k 4 | head -10' alias jctl 'journalctl -p 3 -xb' # Common use alias ... 'cd ../..' alias .... 'cd ../../..' alias ..... 'cd ../../../..' alias ...... 'cd ../../../../..' alias dir 'dir --color=auto' alias vdir 'vdir --color=auto' alias tarnow 'tar -acf ' alias untar 'tar -zxvf ' ################# STUFF YOU MAY NOT HAVE ##################################### if test "$TERM" = "xterm-kitty" alias icat='kitty +kitten icat' end if test -e /usr/bin/python3 alias python='python3' alias py='python3' end # Easier Ollama Commands if test -e /usr/bin/ollama alias llama_start='ollama serve' # Start the LLama server alias llama3='ollama run llama3' # Start the LLama Chat end if test -e /usr/bin/btop alias tasks='btop' end if test -e /usr/bin/mpv alias uni_play='mpv --vo=tct' # Plays a video in terminal with Unicode alias asci_play='mpv --vo=caca' # Plays a video in terminal with ASCII else for cmd in uni_play asci_play function $cmd echo "You need to install mpv Inorder to use these commands: https://github.com/mpv-player/mpv" end end end function mkvenv if not type -q python3 echo "Python3 is not installed. Please install Python3 to use mkvenv." return 1 end if not python3 -c "import venv" ^/dev/null echo "Python3 'venv' module is not available. Please install it (e.g., 'python3-venv' on Debian/Ubuntu)." return 1 end if test (count $argv) -lt 1 echo "Usage: mkvenv {folder name}" return 1 end python3 -m venv $argv[1] if test -f $argv[1]/bin/activate.fish source $argv[1]/bin/activate.fish else echo "Error: Could not find activate.fish in $argv[1]/bin/" return 1 end end # Check if eza exists in either location if test -x /usr/bin/eza -o -x $HOME/.cargo/bin/eza function ls command eza -a --color=always --group-directories-first --icons $argv # Just more beautiful end function lr command eza -al --color=always --group-directories-first --icons $argv # With rights and Owner end function ll command eza -l --color=always --group-directories-first --icons $argv # Hidden Stuff is hidden end function lt command eza -aT --color=always --group-directories-first --icons $argv # Tree View may take some time end function l. command eza -ald --color=always --group-directories-first --icons .* $argv # Only Hidden Stuff end function lf command eza -aD --color=always --group-directories-first --icons $argv # Only Folder end else # Define dummy functions that remind user to install eza for cmd in lr ll lt l. lf function $cmd echo "The command 'eza' is not installed. Please install 'eza' to use this: https://github.com/eza-community/eza" end end end if test -e /usr/bin/ugrep alias grep 'ugrep --color=auto' alias egrep 'ugrep -E --color=auto' alias fgrep 'ugrep -F --color=auto' else for cmd in egrep fgrep function $cmd echo "The command 'ugrep' is not installed. Please install 'ugrep' to use this: https://github.com/Genivia/ugrep" end end end if test -e /usr/bin/wget alias wget 'wget -c ' end alias ocrmypdf 'ocrmypdf --deskew --clean --rotate-pages' function rcp if test (count $argv) -lt 2 echo "Usage: rcp SOURCE... DESTINATION" return 1 end rsync -avh --progress $argv end function rmv if test (count $argv) -lt 2 echo "Usage: rmv SOURCE... DESTINATION" return 1 end rsync -avh --progress --remove-source-files $arg end function nanorm if test (count $argv) -lt 1 echo "Usage: nanorm {FILE}" return 1 end set arg $argv[1] if test -f $arg rm $arg end nano $arg end if test -e /usr/bin/reflector alias mirror='sudo reflector -f 30 -l 30 --number 10 --verbose --save /etc/pacman.d/mirrorlist' alias mirrora='sudo reflector --latest 50 --number 20 --sort age --save /etc/pacman.d/mirrorlist' alias mirrord='sudo reflector --latest 50 --number 20 --sort delay --save /etc/pacman.d/mirrorlist' alias mirrors='sudo reflector --latest 50 --number 20 --sort score --save /etc/pacman.d/mirrorlist' end