Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- # ~/.config/fish/config.fish
- #
- set fish_greeting #suppresses the Fish intro message
- #Ibus settings if needed
- #to start the daemon and change settings: type ibus-setup
- #delete the hashtags in the next 3 lines and restart
- #export GTK_IM_MODULE=ibus
- #export XMODIFIERS=@im=dbus
- #export QT_IM_MODULE=ibus
- #sets paths of stuff
- set PS1 '[\u@\h \W]\$ '
- if [ -d "HOME/.bin" ] ;
- then PATH="HOME/.bin:PATH"
- end
- if [ -d "HOME/.local/bin" ] ;
- then PATH="HOME/.local/bin:PATH"
- end
- ##Eden Prompt
- function _git_branch_name
- echo (command git symbolic-ref HEAD 2> /dev/null | sed -e 's|^refs/heads/||')
- end
- function _is_git_dirty
- echo (command git status -s --ignore-submodules=dirty 2> /dev/null)
- end
- ## Function to show a segment
- function _prompt_segment -d "Function to show a segment"
- # Get colors
- set -l bg $argv[1]
- set -l fg $argv[2]
- # Set 'em
- set_color -b $bg
- set_color $fg
- # Print text
- if [ -n "$argv[3]" ]
- echo -n -s $argv[3]
- end
- # Reset
- set_color -b normal
- set_color normal
- # Print padding
- if [ (count $argv) = 4 ]
- echo -n -s $argv[4]
- end
- end
- function show_ssh_status -d "Function to show the ssh tag"
- if test "$THEME_EDEN_HIDE_SSH_TAG" != 'yes'
- if [ -n "$SSH_CLIENT" ]
- if [ (id -u) = "0" ]
- _prompt_segment red white "-SSH-" ' '
- else
- _prompt_segment blue white "-SSH-" ' '
- end
- end
- end
- end
- function show_host -d "Show host & user name"
- # Display [user & host] info
- if test "$THEME_EDEN_SHOW_HOST" = 'yes'
- if [ (id -u) = "0" ]
- echo -n (set_color red)
- else
- echo -n (set_color blue)
- end
- echo -n ''(hostname|cut -d . -f 1)ˇ$USER' ' (set color normal)
- end
- end
- function show_cwd -d "Function to show the current working directory"
- if test "$theme_short_path" != 'yes' -a (prompt_pwd) != '~' -a (prompt_pwd) != '/'
- set -l cwd (dirname (prompt_pwd))
- test $cwd != '/'; and set cwd $cwd'/'
- _prompt_segment normal cyan $cwd
- end
- set_color -o cyan
- echo -n (basename (prompt_pwd))' '
- set_color normal
- end
- function show_git_info -d "Show git branch and dirty state"
- if [ (_git_branch_name) ]
- set -l git_branch '['(_git_branch_name)']'
- set_color -o
- if [ (_is_git_dirty) ]
- set_color -o red
- echo -ne "$git_branch× "
- else
- set_color -o green
- echo -ne "$git_branch "
- end
- set_color normal
- end
- end
- function show_prompt_char -d "Terminate with a nice prompt char"
- set -q THEME_EDEN_PROMPT_CHAR
- or set -U THEME_EDEN_PROMPT_CHAR '»'
- echo -n -s $normal $THEME_EDEN_PROMPT_CHAR ' '
- end
- function fish_prompt
- set fish_greeting
- # The newline before prompts
- echo ''
- show_ssh_status
- show_host
- show_cwd
- show_git_info
- show_prompt_char
- end
- ## END of Eden Prompt
- #list
- alias ls='exa -al --color=always --group-directories-first'
- alias la='ls -a'
- alias ll='ls -la'
- alias l='ls'
- alias l.='ls -A | egrep "^\."'
- #fix typos
- alias cd..='cd ..'
- alias pdw="pwd"
- alias udpate='sudo pacman -Syyu'
- alias upate='sudo pacman -Syyu'
- alias pas="ps auxf"
- #Colorize grep command output
- 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 ulk="sudo rm /var/lib/pacman/db.lck"
- #free
- alias free="free -mt"
- #use all cores
- alias uac="sh ~/.bin/main/000*"
- #continue an interrupted download
- alias wget="wget -c"
- #userlist
- alias userlist="cut -d: -f1 /etc/passwd/"
- #merge new settings
- alias merge="xrdb -merge ~/.Xresources"
- #Aliases for software management
- #pacman or pm
- alias pacman='sudo pacman --color auto'
- alias up='sudo pacman -Syyu'
- #yay - updates all AUR packages
- alias aurup="yay -Sua"
- #updates everything
- alias pksyua="yay -Syu --noconfirm"
- alias all="yay -Syu --noconfirm"
- #ps
- alias psa="ps auxf"
- alias psgrep="ps aux | grep -v grep | grep -i -e VSZ -e"
- #grub update
- alias update-grub="sudo grub-mkconfig -o /boot/grub/grub.cfg"
- #add new fonts
- alias update-fc='sudo fc-cache -fv'
- #copy/paste all content of /etc/skel over to home folder - backup of config created - beware
- alias skel='cp -Rf ~/.config ~/.config-backup-(date) && cp -rf /etc/skel/* ~'
- #backup contents of /etc/skel to hidden backup folder in home/user
- alias bupskel='cp -Rf /etc/skel ~/.skel-backup-(date)'
- #copy bashrc-latest over on bashrc - cb= copy bashrc
- alias cb='sudo cp /etc/skel/.bashrc ~/.bashrc && source ~/.bashrc'
- #copy /etc/skel/.zshrc over on ~/.zshrc - cz= copy zshrc
- #alias cz='sudo cp /etc/skel/.zshrc ~/.zshrc && source ~/.zshrc'
- #copy /etc/skel/config.fish over on ~/.config/fish - cf = copy config.fish
- #alias cf='sudo cp /etc/skel/config.fish ~/.config/fish && source ~/.config/fish/config.fish
- #switch between bash, zsh, and fish
- 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.'"
- #quickly kill conkies
- alias kc='killall conky'
- #hardware info --short
- alias hw="hwinfo --short"
- #skip integrity check
- alias yayskip='yay -S --mflags --skipinteg'
- alias trizenskip='trizen -S --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 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"
- alias mirrora="sudo reflector --latest 50 --number 20 --sort age --save /etc/pacman.d/mirrorlist"
- #mounting the folder Public for exchange between host and guest on virtualbox
- alias vbm="sudo mount -t vboxsf -o rw,uid=1000,gid=1000 Public /home/$USER/Public"
- #youtube-dl
- alias yta-aac="youtube-dl --extract-audio --audio-format aac "
- alias yta-best="youtube-dl --extract-audio --audio-format best "
- alias yta-flac="youtube-dl --extract-audio --audio-format flac "
- alias yta-m4a="youtube-dl --extract-audio --audio-format m4a "
- alias yta-mp3="youtube-dl --extract-audio --audio-format mp3 "
- alias yta-opus="youtube-dl --extract-audio --audio-format opus "
- alias yta-vorbis="youtube-dl --extract-audio --audio-format vorbis "
- alias yta-wav="youtube-dl --extract-audio --audio-format wav "
- alias ytb="youtube-dl -f bestvideo+bestaudio "
- #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"
- #Cleanup orphaned packages
- alias cleanup='sudo pacman -Rns (pacman -Qtdq)'
- #get the error messages from journalctl
- alias jctl="journalctl -p 3 -xb"
- #some other developer things
- alias bootmsg="dmesg > /home/$USER/dmesg.log"
- alias ply-splashshow="sudo plymouthd && sudo plymouth --show-splash"
- #nano for important configuration files
- #know what you do in these files
- alias nlightdm="sudo nano /etc/lightdm/lightdm.conf"
- alias npacman="sudo nano /etc/pacman.conf"
- alias ngrub="sudo nano /etc/default/grub"
- alias nmkinitcpio="sudo nano /etc/mkinitcpio.conf"
- alias nslim="sudo nano /etc/slim.conf"
- alias noblogout="sudo nano /etc/oblogout.conf"
- alias nmirrorlist="sudo nano /etc/pacman.d/mirrorlist"
- alias nconfgrub="sudo nano /boot/grub/grub.cfg"
- #gpg
- #verify signature for isos
- alias 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"
- #shutdown or reboot
- alias ssn="sudo shutdown now"
- alias sr="sudo reboot"
- #Poetician Aliases
- alias cl="clear"
- alias up='sudo pacman -Syyu'
- alias all="yay -Syu --noconfirm"
- alias rs="redshift &"
- ##ex = EXtractor for all kinds of archives
- ##usage: ex <file>
- function ex -a FILE
- set ext1 (string split -r -m2 . $FILE)[2]
- set ext2 (string split -r -m2 . $FILE)[3]
- if test -z "$ext2"
- set ext $ext1
- else
- set ext $ext1.$ext2
- end
- switch $ext
- case "tar.bz2"
- tar xjf $FILE
- case "tar.gz"
- tar xzf $FILE
- case "bz2"
- bunzip2 $FILE
- case "rar"
- unrar x $FILE
- case "gz"
- gunzip $FILE
- case "tar"
- tar xf $FILE
- case "tbz2"
- tar xjf $FILE
- case "tgz"
- tar xzf $FILE
- case "zip"
- unzip $FILE
- case "Z"
- uncompress $FILE
- case "7z"
- 7z x $FILE
- case "deb"
- ar x $FILE
- case "tar.xz"
- tar xf $FILE
- case "tar.zst"
- unzstd $FILE
- case "*"
- echo "'$FILE' cannot be extracted via ex"
- end
- end
- #place other functions in a functions subdirectory. They will not be overwritten.
- #run neofetch
- neofetch
Advertisement
Add Comment
Please, Sign In to add comment