poetician

.zshrc May Update

Oct 12th, 2021 (edited)
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.62 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 paru -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. # if you installed the package oh-my-zsh-powerline-theme-git then you type here "powerline" as zsh theme
  15. ZSH_THEME="xiong-chiamiov-plus"
  16.  
  17. # Set list of themes to pick from when loading at random
  18. # Setting this variable when ZSH_THEME=random will cause zsh to load
  19. # a theme from this variable instead of looking in ~/.oh-my-zsh/themes/
  20. # If set to an empty array, this variable will have no effect.
  21.  
  22. # ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
  23.  
  24. # ZSH_THEME_RANDOM_IGNORED=(pygmalion tjkirch_mod)
  25.  
  26. # Uncomment the following line to use case-sensitive completion.
  27. # CASE_SENSITIVE="true"
  28.  
  29. # Uncomment the following line to use hyphen-insensitive completion.
  30. # Case-sensitive completion must be off. _ and - will be interchangeable.
  31. # HYPHEN_INSENSITIVE="true"
  32.  
  33. # Uncomment the following line to disable bi-weekly auto-update checks.
  34. # DISABLE_AUTO_UPDATE="true"
  35.  
  36. # Uncomment the following line to automatically update without prompting.
  37. # DISABLE_UPDATE_PROMPT="true"
  38.  
  39. # Uncomment the following line to change how often to auto-update (in days).
  40. # export UPDATE_ZSH_DAYS=13
  41.  
  42. # Uncomment the following line if pasting URLs and other text is messed up.
  43. # DISABLE_MAGIC_FUNCTIONS=true
  44.  
  45. # Uncomment the following line to disable colors in ls.
  46. # DISABLE_LS_COLORS="true"
  47.  
  48. # Uncomment the following line to disable auto-setting terminal title.
  49. # DISABLE_AUTO_TITLE="true"
  50.  
  51. # Uncomment the following line to enable command auto-correction.
  52. # ENABLE_CORRECTION="true"
  53.  
  54. # Uncomment the following line to display red dots whilst waiting for completion.
  55. # COMPLETION_WAITING_DOTS="true"
  56.  
  57. # Uncomment the following line if you want to disable marking untracked files
  58. # under VCS as dirty. This makes repository status check for large repositories
  59. # much, much faster.
  60. # DISABLE_UNTRACKED_FILES_DIRTY="true"
  61.  
  62. # Uncomment the following line if you want to change the command execution time
  63. # stamp shown in the history command output.
  64. # You can set one of the optional three formats:
  65. # "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
  66. # or set a custom format using the strftime function format specifications,
  67. # see 'man strftime' for details.
  68. # HIST_STAMPS="mm/dd/yyyy"
  69.  
  70. # Would you like to use another custom folder than $ZSH/custom?
  71. # ZSH_CUSTOM=/path/to/new-custom-folder
  72.  
  73. # Which plugins would you like to load?
  74. # Standard plugins can be found in ~/.oh-my-zsh/plugins/*
  75. # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
  76. # Example format: plugins=(rails git textmate ruby lighthouse)
  77. # Add wisely, as too many plugins slow down shell startup.
  78. plugins=(git)
  79.  
  80. source $ZSH/oh-my-zsh.sh
  81.  
  82. # User configuration
  83.  
  84. # export MANPATH="/usr/local/man:$MANPATH"
  85.  
  86. # You may need to manually set your language environment
  87. # export LANG=en_US.UTF-8
  88.  
  89. # Preferred editor for local and remote sessions
  90. # if [[ -n $SSH_CONNECTION ]]; then
  91. # export EDITOR='vim'
  92. # else
  93. # export EDITOR='nvim'
  94. # fi
  95.  
  96. # Compilation flags
  97. # export ARCHFLAGS="-arch x86_64"
  98.  
  99.  
  100. #### Arch Linux, ArcoLinux, and Poetician Settings ####
  101.  
  102.  
  103. source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
  104.  
  105. setopt GLOB_DOTS
  106. #share commands between terminal instances or not
  107. unsetopt SHARE_HISTORY
  108. #setopt SHARE_HISTORY
  109.  
  110. # If not running interactively, don't do anything
  111. [[ $- != *i* ]] && return
  112.  
  113. export HISTCONTROL=ignoreboth:erasedups
  114.  
  115. # Make NVim the default editor
  116.  
  117. export EDITOR='nvim'
  118. export VISUAL='nvim'
  119.  
  120. #PS1='[\u@\h \W]\$ '
  121.  
  122. if [ -d "$HOME/.bin" ] ;
  123. then PATH="$HOME/.bin:$PATH"
  124. fi
  125.  
  126. if [ -d "$HOME/.local/bin" ] ;
  127. then PATH="$HOME/.local/bin:$PATH"
  128. fi
  129.  
  130. #list
  131. alias ls='exa -al --color=always --group-directories-first' # my preferred listing
  132. alias la='exa -a --color=always --group-directories-first' # all files and dirs
  133. alias ll='exa -l --color=always --group-directories-first' # long format
  134. alias lt='exa -aT --color=always --group-directories-first' # tree listing
  135. alias l.='exa -a | egrep "^\."'
  136.  
  137. ## Colorize the grep command output for ease of use (good for log files)##
  138. alias grep='grep --color=auto'
  139. alias egrep='egrep --color=auto'
  140. alias fgrep='fgrep --color=auto'
  141.  
  142. #readable output
  143. alias df='df -h'
  144.  
  145. #pacman unlock
  146. alias unlock="sudo rm /var/lib/pacman/db.lck"
  147. alias rmpaclock="sudo rm /var/lib/pacman/db.lck"
  148.  
  149. #Archlinux logout unlock
  150. alias rmoutlock="sudo rm /tmp/archlogout.lock"
  151.  
  152. #which graphical card is working
  153. alias whichvga="/usr/local/bin/arcolinux-which-vga"
  154.  
  155. #free
  156. alias free="free -mt"
  157.  
  158. #continue download
  159. alias wget="wget -c"
  160.  
  161. #userlist
  162. alias userlist="cut -d: -f1 /etc/passwd"
  163.  
  164. #merge new settings
  165. alias merge="xrdb -merge ~/.Xresources"
  166.  
  167. # Aliases for software managment
  168. # pacman or pm
  169. alias pac='sudo pacman --color auto'
  170. alias up='sudo pacman -Syyu'
  171.  
  172. # paru as aur helper - updates everything
  173. alias pksyua="paru -Syu --noconfirm"
  174. alias pal="paru -Syu --noconfirm"
  175.  
  176. #ps
  177. alias psa="ps auxf"
  178. alias psgrep="ps aux | grep -v grep | grep -i -e VSZ -e"
  179.  
  180. #grub update
  181. alias upgrub="sudo grub-mkconfig -o /boot/grub/grub.cfg"
  182.  
  183. #add new fonts
  184. alias upfc='sudo fc-cache -fv'
  185.  
  186. #copy/paste all content of /etc/skel over to home folder - backup of config created - beware
  187. alias skel='[ -d ~/.config ] || mkdir ~/.config && cp -Rf ~/.config ~/.config-backup-$(date +%Y.%m.%d-%H.%M.%S) && cp -rf /etc/skel/* ~'
  188. #backup contents of /etc/skel to hidden backup folder in home/user
  189. alias bupskel='cp -Rf /etc/skel ~/.skel-backup-$(date +%Y.%m.%d-%H.%M.%S)'
  190.  
  191. #copy bashrc-latest over on bashrc - cb= copy bashrc
  192. #alias cb='sudo cp /etc/skel/.bashrc ~/.bashrc && source ~/.bashrc'
  193. #copy /etc/skel/.zshrc over on ~/.zshrc - cb= copy zshrc
  194. alias cz='sudo cp /etc/skel/.zshrc ~/.zshrc && exec zsh'
  195.  
  196. #switch between bash and zsh
  197. alias tobash="sudo chsh $USER -s /bin/bash && echo 'Now log out.'"
  198. alias tozsh="sudo chsh $USER -s /bin/zsh && echo 'Now log out.'"
  199.  
  200. #switch between lightdm and sddm
  201. alias toldm="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'"
  202. alias tosddm="sudo pacman -S sddm --noconfirm --needed ; sudo systemctl enable sddm.service -f ; echo 'Sddm is active - reboot now'"
  203.  
  204. # kill commands
  205. # quickly kill conkies
  206. alias kc='killall conky'
  207. # quickly kill polybar
  208. alias kp='killall polybar'
  209.  
  210. #hardware info --short
  211. alias hw="hwinfo --short"
  212.  
  213. #skip integrity check
  214. alias paruskip='paru -S --mflags --skipinteg'
  215.  
  216. #check vulnerabilities microcode
  217. alias microcode='grep . /sys/devices/system/cpu/vulnerabilities/*'
  218.  
  219. #get fastest mirrors in your neighborhood
  220. alias mr="sudo reflector -f 30 -l 30 --number 10 --verbose --save /etc/pacman.d/mirrorlist"
  221. alias mrd="sudo reflector --latest 30 --number 10 --sort delay --save /etc/pacman.d/mirrorlist"
  222. alias mrs="sudo reflector --latest 30 --number 10 --sort score --save /etc/pacman.d/mirrorlist"
  223. alias mra="sudo reflector --latest 30 --number 10 --sort age --save /etc/pacman.d/mirrorlist"
  224.  
  225. #our experimental - best option for the moment
  226. alias mirrorx="sudo reflector --age 6 --latest 20 --fastest 20 --threads 5 --sort rate --protocol https --save /etc/pacman.d/mirrorlist"
  227. alias mirrorxx="sudo reflector --age 6 --latest 20 --fastest 20 --threads 20 --sort rate --protocol https --save /etc/pacman.d/mirrorlist"
  228. alias ram='rate-mirrors --allow-root arch | sudo tee /etc/pacman.d/mirrorlist'
  229.  
  230. #mounting the folder Public for exchange between host and guest on virtualbox
  231. alias vbm="sudo /usr/local/bin/arcolinux-vbox-share"
  232.  
  233. #shopt
  234. #shopt -s autocd # change to named directory
  235. #shopt -s cdspell # autocorrects cd misspellings
  236. #shopt -s cmdhist # save multi-line commands in history as single line
  237. #shopt -s dotglob
  238. #shopt -s histappend # do not overwrite history
  239. #shopt -s expand_aliases # expand aliases
  240.  
  241. #youtube download
  242. alias yta-aac="yt-dlp --extract-audio --audio-format aac "
  243. alias yta-best="yt-dlp --extract-audio --audio-format best "
  244. alias yta-flac="yt-dlp --extract-audio --audio-format flac "
  245. alias yta-mp3="yt-dlp --extract-audio --audio-format mp3 "
  246. alias ytv-best="yt-dlp -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/bestvideo+bestaudio' --merge-output-format mp4 "
  247.  
  248. #Recent Installed Packages
  249. alias rip="expac --timefmt='%Y-%m-%d %T' '%l\t%n %v' | sort | tail -200 | nl"
  250. alias riplong="expac --timefmt='%Y-%m-%d %T' '%l\t%n %v' | sort | tail -3000 | nl"
  251.  
  252. #iso and version used to install ArcoLinux
  253. alias iso="cat /etc/dev-rel | awk -F '=' '/ISO/ {print $2}'"
  254.  
  255. #Cleanup orphaned packages
  256. alias cleanup='sudo pacman -Rns $(pacman -Qtdq)'
  257.  
  258. #search content with ripgrep
  259. alias rg="rg --sort path"
  260.  
  261. #get the error messages from journalctl
  262. alias jctl="journalctl -p 3 -xb"
  263.  
  264. #nano for important configuration files
  265. #know what you do in these files
  266. alias nlightdm="sudo $EDITOR /etc/lightdm/lightdm.conf"
  267. alias npacman="sudo $EDITOR /etc/pacman.conf"
  268. alias ngrub="sudo $EDITOR /etc/default/grub"
  269. alias nconfgrub="sudo $EDITOR /boot/grub/grub.cfg"
  270. alias nmkinitcpio="sudo $EDITOR /etc/mkinitcpio.conf"
  271. alias nmirrorlist="sudo $EDITOR /etc/pacman.d/mirrorlist"
  272. alias narcomirrorlist='sudo nano /etc/pacman.d/arcolinux-mirrorlist'
  273. alias nsddm="sudo $EDITOR /etc/sddm.conf"
  274. alias nfstab="sudo $EDITOR /etc/fstab"
  275. alias nnsswitch="sudo $EDITOR /etc/nsswitch.conf"
  276. alias nsamba="sudo $EDITOR /etc/samba/smb.conf"
  277. alias ngnupgconf="sudo nano /etc/pacman.d/gnupg/gpg.conf"
  278. alias nb="$EDITOR ~/.bashrc"
  279. alias nz="$EDITOR ~/.zshrc"
  280.  
  281. #gpg
  282. #verify signature for isos
  283. alias gpg-check="gpg2 --keyserver-options auto-key-retrieve --verify"
  284. alias fix-gpg-check="gpg2 --keyserver-options auto-key-retrieve --verify"
  285. #receive the key of a developer
  286. alias gpg-retrieve="gpg2 --keyserver-options auto-key-retrieve --receive-keys"
  287. alias fix-gpg-retrieve="gpg2 --keyserver-options auto-key-retrieve --receive-keys"
  288. alias fix-keyserver="[ -d ~/.gnupg ] || mkdir ~/.gnupg ; cp /etc/pacman.d/gnupg/gpg.conf ~/.gnupg/ ; echo 'done'"
  289.  
  290. #fixes
  291. alias fix-perms="sudo chown -R $USER:$USER ~/.config ~/.local"
  292. alias keyfix="/usr/local/bin/arcolinux-fix-pacman-databases-and-keys"
  293. alias key-fix="/usr/local/bin/arcolinux-fix-pacman-databases-and-keys"
  294. alias keys-fix="/usr/local/bin/arcolinux-fix-pacman-databases-and-keys"
  295. alias fixkey="/usr/local/bin/arcolinux-fix-pacman-databases-and-keys"
  296. alias fixkeys="/usr/local/bin/arcolinux-fix-pacman-databases-and-keys"
  297. alias fix-key="/usr/local/bin/arcolinux-fix-pacman-databases-and-keys"
  298. alias fix-keys="/usr/local/bin/arcolinux-fix-pacman-databases-and-keys"
  299. alias fix-sddm-config="/usr/local/bin/arcolinux-fix-sddm-config"
  300. alias fix-pacman-conf="/usr/local/bin/arcolinux-fix-pacman-conf"
  301. alias fix-pacman-keyserver="/usr/local/bin/arcolinux-fix-pacman-gpg-conf"
  302.  
  303. #maintenance
  304. alias big="expac -H M '%m\t%n' | sort -h | nl"
  305. alias dgrada="sudo downgrade --ala-url https://ant.seedhost.eu/arcolinux/"
  306.  
  307. #hblock (stop tracking with hblock)
  308. #use unhblock to stop using hblock
  309. alias unhblock="hblock -S none -D none"
  310.  
  311. #systeminfo
  312. alias probe="sudo -E hw-probe -all -upload"
  313. alias sysfailed="systemctl list-units --failed"
  314.  
  315. #shutdown or reboot
  316. alias ssn="sudo shutdown now"
  317. alias sr="sudo reboot"
  318.  
  319. #update betterlockscreen images
  320. alias bls="betterlockscreen -u /usr/share/backgrounds/arcolinux/"
  321.  
  322. #give the list of all installed desktops - xsessions desktops
  323. alias xd="ls /usr/share/xsessions"
  324.  
  325. # # ex = EXtractor for all kinds of archives
  326. # # usage: ex <file>
  327. ex ()
  328. {
  329. if [ -f $1 ] ; then
  330. case $1 in
  331. *.tar.bz2) tar xjf $1 ;;
  332. *.tar.gz) tar xzf $1 ;;
  333. *.bz2) bunzip2 $1 ;;
  334. *.rar) unrar x $1 ;;
  335. *.gz) gunzip $1 ;;
  336. *.tar) tar xf $1 ;;
  337. *.tbz2) tar xjf $1 ;;
  338. *.tgz) tar xzf $1 ;;
  339. *.zip) unzip $1 ;;
  340. *.Z) uncompress $1;;
  341. *.7z) 7z x $1 ;;
  342. *.deb) ar x $1 ;;
  343. *.tar.xz) tar xf $1 ;;
  344. *.tar.zst) tar xf $1 ;;
  345. *) echo "'$1' cannot be extracted via ex()" ;;
  346. esac
  347. else
  348. echo "'$1' is not a valid file"
  349. fi
  350. }
  351.  
  352. #Leftwm aliases
  353. alias lti="leftwm-theme install"
  354. alias ltu="leftwm-theme uninstall"
  355. alias lta="leftwm-theme apply"
  356. alias ltupd="leftwm-theme update"
  357. alias ltupg="leftwm-theme upgrade"
  358.  
  359. #arcolinux applications
  360. alias att="archlinux-tweak-tool"
  361. alias adt="arcolinux-desktop-trasher"
  362. alias abl="arcolinux-betterlockscreen"
  363. alias agm="arcolinux-get-mirrors"
  364. alias amr="arcolinux-mirrorlist-rank-info"
  365. alias aom="arcolinux-osbeck-as-mirror"
  366. alias ars="arcolinux-reflector-simple"
  367. alias atm="arcolinux-tellme"
  368. alias avs="arcolinux-vbox-share"
  369. alias awa="arcolinux-welcome-app"
  370.  
  371. #remove
  372. alias rmgitcache="rm -r ~/.cache/git"
  373.  
  374. #moving your personal files and folders from /personal to ~
  375. alias personal='cp -Rf /personal/* ~'
  376.  
  377. #create a file called .zshrc-personal and put all your personal aliases
  378. #in there. They will not be overwritten by skel.
  379.  
  380. [[ -f ~/.zshrc-personal ]] && . ~/.zshrc-personal
  381.  
  382. # reporting tools - install when not installed
  383.  
  384. #neofetch
  385. #screenfetch
  386. #alsi
  387. #paleofetch
  388. #fetch
  389. #hfetch
  390. #sfetch
  391. #ufetch
  392. #ufetch-arco
  393. #pfetch
  394. #sysinfo
  395. #sysinfo-retro
  396. #cpufetch
  397. colorscript random
  398.  
Advertisement
Add Comment
Please, Sign In to add comment