Advertisement
poetician

.zshrc | Some minor tweaks

Nov 8th, 2020
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.76 KB | None | 0 0
  1. # If you come from bash you might have to change your $PATH.
  2. # export PATH=$HOME/bin:/usr/local/bin:$PATH
  3.  
  4. # Path to your oh-my-zsh installation.
  5. #installation via script from github
  6. #export ZSH="/home/$USER/.oh-my-zsh"
  7. #installation via yay -S oh-my-zsh-git
  8. export ZSH=/usr/share/oh-my-zsh/
  9.  
  10. # Set name of the theme to load --- if set to "random", it will
  11. # load a random theme each time oh-my-zsh is loaded, in which case,
  12. # to know which specific one was loaded, run: echo $RANDOM_THEME
  13. # See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
  14. ZSH_THEME="linuxonly"
  15.  
  16. # Set list of themes to pick from when loading at random
  17. # Setting this variable when ZSH_THEME=random will cause zsh to load
  18. # a theme from this variable instead of looking in ~/.oh-my-zsh/themes/
  19. # If set to an empty array, this variable will have no effect.
  20. # ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
  21.  
  22. # Uncomment the following line to use case-sensitive completion.
  23. # CASE_SENSITIVE="true"
  24.  
  25. # Uncomment the following line to use hyphen-insensitive completion.
  26. # Case-sensitive completion must be off. _ and - will be interchangeable.
  27. # HYPHEN_INSENSITIVE="true"
  28.  
  29. # Uncomment the following line to disable bi-weekly auto-update checks.
  30. # DISABLE_AUTO_UPDATE="true"
  31.  
  32. # Uncomment the following line to automatically update without prompting.
  33. # DISABLE_UPDATE_PROMPT="true"
  34.  
  35. # Uncomment the following line to change how often to auto-update (in days).
  36. # export UPDATE_ZSH_DAYS=13
  37.  
  38. # Uncomment the following line if pasting URLs and other text is messed up.
  39. # DISABLE_MAGIC_FUNCTIONS=true
  40.  
  41. # Uncomment the following line to disable colors in ls.
  42. # DISABLE_LS_COLORS="true"
  43.  
  44. # Uncomment the following line to disable auto-setting terminal title.
  45. # DISABLE_AUTO_TITLE="true"
  46.  
  47. # Uncomment the following line to enable command auto-correction.
  48. ENABLE_CORRECTION="true"
  49.  
  50. # Uncomment the following line to display red dots whilst waiting for completion.
  51. COMPLETION_WAITING_DOTS="true"
  52.  
  53. # Uncomment the following line if you want to disable marking untracked files
  54. # under VCS as dirty. This makes repository status check for large repositories
  55. # much, much faster.
  56. # DISABLE_UNTRACKED_FILES_DIRTY="true"
  57.  
  58. # Uncomment the following line if you want to change the command execution time
  59. # stamp shown in the history command output.
  60. # You can set one of the optional three formats:
  61. # "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
  62. # or set a custom format using the strftime function format specifications,
  63. # see 'man strftime' for details.
  64. # HIST_STAMPS="mm/dd/yyyy"
  65.  
  66. # Would you like to use another custom folder than $ZSH/custom?
  67. # ZSH_CUSTOM=/path/to/new-custom-folder
  68.  
  69. # Which plugins would you like to load?
  70. # Standard plugins can be found in ~/.oh-my-zsh/plugins/*
  71. # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
  72. # Example format: plugins=(rails git textmate ruby lighthouse)
  73. # Add wisely, as too many plugins slow down shell startup.
  74. plugins=(git)
  75.  
  76. source $ZSH/oh-my-zsh.sh
  77.  
  78. # User configuration
  79.  
  80. # export MANPATH="/usr/local/man:$MANPATH"
  81.  
  82. # You may need to manually set your language environment
  83. # export LANG=en_US.UTF-8
  84.  
  85. # Preferred editor for local and remote sessions
  86. # if [[ -n $SSH_CONNECTION ]]; then
  87. # export EDITOR='vim'
  88. # else
  89. # export EDITOR='mvim'
  90. # fi
  91.  
  92. # Compilation flags
  93. # export ARCHFLAGS="-arch x86_64"
  94.  
  95. #### ARCOLINUX SETTINGS ####
  96.  
  97. source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
  98.  
  99. setopt GLOB_DOTS
  100.  
  101. # If not running interactively, don't do anything
  102. [[ $- != *i* ]] && return
  103.  
  104. export HISTCONTROL=ignoreboth:erasedups
  105.  
  106. #PS1='[\u@\h \W]\$ '
  107.  
  108. if [ -d "$HOME/.bin" ] ;
  109. then PATH="$HOME/.bin:$PATH"
  110. fi
  111.  
  112. if [ -d "$HOME/.local/bin" ] ;
  113. then PATH="$HOME/.local/bin:$PATH"
  114. fi
  115.  
  116. #list
  117. alias ls='exa -al --color=always --group-directories-first'
  118. alias la='ls -a'
  119. alias ll='ls -la'
  120. alias l='ls'
  121. alias l.="ls -A | egrep '^\.'"
  122.  
  123. #fix obvious typo's
  124. alias cd..='cd ..'
  125. alias pdw="pwd"
  126. alias udpate='sudo pacman -Syyu'
  127. alias upate='sudo pacman -Syyu'
  128.  
  129. ## Colorize the grep command output for ease of use (good for log files)##
  130. alias grep='grep --color=auto'
  131. alias egrep='egrep --color=auto'
  132. alias fgrep='fgrep --color=auto'
  133.  
  134. #readable output
  135. alias df='df -h'
  136.  
  137. #pacman unlock
  138. alias unlock="sudo rm /var/lib/pacman/db.lck"
  139.  
  140. #free
  141. alias free="free -mt"
  142.  
  143. #use all cores
  144. alias uac="sh ~/.bin/main/000*"
  145.  
  146. #continue download
  147. alias wget="wget -c"
  148.  
  149. #userlist
  150. alias userlist="cut -d: -f1 /etc/passwd"
  151.  
  152. #merge new settings
  153. alias merge="xrdb -merge ~/.Xresources"
  154.  
  155. # Aliases for software managment
  156. # pacman or pm
  157. alias pacman='sudo pacman --color auto'
  158. alias up='sudo pacman -Syyu'
  159.  
  160. # yay as aur helper - updates everything
  161. alias pksyua="yay -Syu --noconfirm"
  162. alias all="yay -Syu --noconfirm"
  163.  
  164. #ps
  165. alias psa="ps auxf"
  166. alias psgrep="ps aux | grep -v grep | grep -i -e VSZ -e"
  167.  
  168. #grub update
  169. alias ugrub="sudo grub-mkconfig -o /boot/grub/grub.cfg"
  170.  
  171. #add new fonts
  172. alias up-fc='sudo fc-cache -fv'
  173.  
  174. #copy/paste all content of /etc/skel over to home folder - backup of config created - beware
  175. alias skel='cp -Rf ~/.config ~/.config-backup-$(date +%Y.%m.%d-%H.%M.%S) && cp -rf /etc/skel/* ~'
  176. #backup contents of /etc/skel to hidden backup folder in home/user
  177. alias bupskel='cp -Rf /etc/skel ~/.skel-backup-$(date +%Y.%m.%d-%H.%M.%S)'
  178.  
  179. #copy bashrc-latest over on bashrc - cb= copy bashrc
  180. #alias cb='sudo cp /etc/skel/.bashrc ~/.bashrc && source ~/.bashrc'
  181. #copy /etc/skel/.zshrc over on ~/.zshrc - cb= copy zshrc
  182. alias cz='sudo cp /etc/skel/.zshrc ~/.zshrc && source ~/.zshrc'
  183.  
  184. #switch between bash and zsh
  185. alias tobash="sudo chsh $USER -s /bin/bash && echo 'Now log out.'"
  186. alias tozsh="sudo chsh $USER -s /bin/zsh && echo 'Now log out.'"
  187. alias tofsh="sudo chsh $USER -s /bin/fish && echo 'Now log out.'"
  188.  
  189. #quickly kill conkies
  190. alias kc='killall conky'
  191.  
  192. #hardware info --short
  193. alias hw="hwinfo --short"
  194.  
  195. #skip integrity check
  196. alias yayskip='yay -S --mflags --skipinteg'
  197. alias trizenskip='trizen -S --skipinteg'
  198.  
  199. #check vulnerabilities microcode
  200. alias microcode='grep . /sys/devices/system/cpu/vulnerabilities/*'
  201.  
  202. #get fastest mirrors in your neighborhood
  203. alias mr="sudo reflector -f 30 -l 30 --number 10 --verbose --save /etc/pacman.d/mirrorlist"
  204. alias mrd="sudo reflector --latest 50 --number 20 --sort delay --save /etc/pacman.d/mirrorlist"
  205. alias mrs="sudo reflector --latest 50 --number 20 --sort score --save /etc/pacman.d/mirrorlist"
  206. alias mra="sudo reflector --latest 50 --number 20 --sort age --save /etc/pacman.d/mirrorlist"
  207.  
  208. #mounting the folder Public for exchange between host and guest on virtualbox
  209. alias vbm="sudo /usr/local/bin/arcolinux-vbox-share"
  210.  
  211. #shopt
  212. #shopt -s autocd # change to named directory
  213. #shopt -s cdspell # autocorrects cd misspellings
  214. #shopt -s cmdhist # save multi-line commands in history as single line
  215. #shopt -s dotglob
  216. #shopt -s histappend # do not overwrite history
  217. #shopt -s expand_aliases # expand aliases
  218.  
  219. #youtube-dl
  220. alias yta-aac="youtube-dl --extract-audio --audio-format aac "
  221. alias yta-best="youtube-dl --extract-audio --audio-format best "
  222. alias yta-flac="youtube-dl --extract-audio --audio-format flac "
  223. alias yta-m4a="youtube-dl --extract-audio --audio-format m4a "
  224. alias yta-mp3="youtube-dl --extract-audio --audio-format mp3 "
  225. alias yta-opus="youtube-dl --extract-audio --audio-format opus "
  226. alias yta-vorbis="youtube-dl --extract-audio --audio-format vorbis "
  227. alias yta-wav="youtube-dl --extract-audio --audio-format wav "
  228.  
  229. alias ytb="youtube-dl -f bestvideo+bestaudio "
  230.  
  231. #Recent Installed Packages
  232. alias rip="expac --timefmt='%Y-%m-%d %T' '%l\t%n %v' | sort | tail -200 | nl"
  233. alias riplong="expac --timefmt='%Y-%m-%d %T' '%l\t%n %v' | sort | tail -3000 | nl"
  234.  
  235. #iso and version used to install ArcoLinux
  236. alias iso="cat /etc/dev-rel | awk -F '=' '/ISO/ {print $2}'"
  237.  
  238. #Cleanup orphaned packages
  239. alias clean='sudo pacman -Rns $(pacman -Qtdq)'
  240.  
  241. #get the error messages from journalctl
  242. alias jctl="journalctl -p 3 -xb"
  243.  
  244. #nano for important configration files
  245. #know what you do in these files
  246. alias nlightdm="sudo nano /etc/lightdm/lightdm.conf"
  247. alias npacman="sudo nano /etc/pacman.conf"
  248. alias ngrub="sudo nano /etc/default/grub"
  249. alias nmkinitcpio="sudo nano /etc/mkinitcpio.conf"
  250. alias nslim="sudo nano /etc/slim.conf"
  251. alias noblogout="sudo nano /etc/oblogout.conf"
  252. alias nmirrorlist="sudo nano /etc/pacman.d/mirrorlist"
  253. alias nconfgrub="sudo nano /boot/grub/grub.cfg"
  254.  
  255. #gpg
  256. #verify signature for isos
  257. alias gpg-check="gpg2 --keyserver-options auto-key-retrieve --verify"
  258. #receive the key of a developer
  259. alias gpg-retrieve="gpg2 --keyserver-options auto-key-retrieve --receive-keys"
  260.  
  261. #shutdown or reboot
  262. alias ssn="sudo shutdown now"
  263. alias sr="sudo reboot"
  264.  
  265. #maintenance
  266. alias big="expac -H M '%m\t%n' | sort -h | nl"
  267. alias downgrada="sudo downgrade --ala-url https://bike.seedhost.eu/arcolinux/"
  268.  
  269. #systeminfo
  270. alias probe="sudo -E hw-probe -all -upload"
  271.  
  272. # # ex = EXtractor for all kinds of archives
  273. # # usage: ex <file>
  274. ex ()
  275. {
  276. if [ -f $1 ] ; then
  277. case $1 in
  278. *.tar.bz2) tar xjf $1 ;;
  279. *.tar.gz) tar xzf $1 ;;
  280. *.bz2) bunzip2 $1 ;;
  281. *.rar) unrar x $1 ;;
  282. *.gz) gunzip $1 ;;
  283. *.tar) tar xf $1 ;;
  284. *.tbz2) tar xjf $1 ;;
  285. *.tgz) tar xzf $1 ;;
  286. *.zip) unzip $1 ;;
  287. *.Z) uncompress $1;;
  288. *.7z) 7z x $1 ;;
  289. *.deb) ar x $1 ;;
  290. *.tar.xz) tar xf $1 ;;
  291. *) echo "'$1' cannot be extracted via ex()" ;;
  292. esac
  293. else
  294. echo "'$1' is not a valid file"
  295. fi
  296. }
  297.  
  298. #create a file called .zshrc-personal and put all your personal aliases
  299. #in there. They will not be overwritten by skel.
  300.  
  301. [[ -f ~/.zshrc-personal ]] && . ~/.zshrc-personal
  302.  
  303. #neofetch
  304.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement