Advertisement
poetician

.zshrc ArcoLinux December 2022 Overhaul

Dec 8th, 2022
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.56 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. if [ -f $ZSH/oh-my-zsh.sh ]; then
  81. source $ZSH/oh-my-zsh.sh
  82. fi
  83.  
  84. # User configuration
  85.  
  86. # export MANPATH="/usr/local/man:$MANPATH"
  87.  
  88. # You may need to manually set your language environment
  89. # export LANG=en_US.UTF-8
  90.  
  91. # Preferred editor for local and remote sessions
  92. # if [[ -n $SSH_CONNECTION ]]; then
  93. # export EDITOR='vim'
  94. # else
  95. # export EDITOR='nvim'
  96. # fi
  97.  
  98. # Compilation flags
  99. # export ARCHFLAGS="-arch x86_64"
  100.  
  101.  
  102. #### Poetician ArcoLinux Settings ####
  103. export PAGER='most'
  104.  
  105. if [ -f /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ]; then
  106. source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
  107. fi
  108.  
  109. setopt GLOB_DOTS
  110. #share commands between terminal instances or not
  111. unsetopt SHARE_HISTORY
  112. #setopt SHARE_HISTORY
  113.  
  114. # If not running interactively, don't do anything
  115. [[ $- != *i* ]] && return
  116.  
  117. export HISTCONTROL=ignoreboth:erasedups
  118.  
  119. # Make NVim the default editor
  120.  
  121. export EDITOR='nvim'
  122. export VISUAL='nvim'
  123.  
  124. #PS1='[\u@\h \W]\$ '
  125.  
  126. if [ -d "$HOME/.bin" ] ;
  127. then PATH="$HOME/.bin:$PATH"
  128. fi
  129.  
  130. if [ -d "$HOME/.local/bin" ] ;
  131. then PATH="$HOME/.local/bin:$PATH"
  132. fi
  133.  
  134. ### ALIASES ###
  135.  
  136. #list
  137. alias ls='exa -al --color=always --group-directories-first' # my preferred listing
  138. alias la='exa -a --color=always --group-directories-first' # all files and dirs
  139. alias ll='exa -l --color=always --group-directories-first' # long format
  140. alias lt='exa -aT --color=always --group-directories-first' # tree listing
  141. alias l.='exa -a | egrep "^\."'
  142.  
  143. ## Colorize the grep command output for ease of use (good for log files)##
  144. alias grep='grep --color=auto'
  145. alias egrep='egrep --color=auto'
  146. alias fgrep='fgrep --color=auto'
  147.  
  148. #readable output
  149. alias df='df -h'
  150.  
  151. #pacman unlock
  152. alias unlock="sudo rm /var/lib/pacman/db.lck"
  153. alias rmpacmanlock="sudo rm /var/lib/pacman/db.lck"
  154.  
  155. #arcolinux logout unlock
  156. alias rmlogoutlock="sudo rm /tmp/arcologout.lock"
  157.  
  158. #which graphical card is working
  159. alias whichvga="/usr/local/bin/arcolinux-which-vga"
  160.  
  161. #free
  162. alias free="free -mt"
  163.  
  164. #continue download
  165. alias wget="wget -c"
  166.  
  167. #userlist
  168. alias userlist="cut -d: -f1 /etc/passwd | sort"
  169.  
  170. #merge new settings
  171. alias merge="xrdb -merge ~/.Xresources"
  172.  
  173. # Aliases for software managment
  174.  
  175. # pacman
  176. alias pac='sudo pacman --color auto'
  177. alias up='sudo pacman -Syyu'
  178.  
  179. # paru as aur helper - updates everything
  180. alias pksyua="paru -Syu --noconfirm"
  181. alias pal="paru -Syu --noconfirm"
  182.  
  183. #ps
  184. alias psa="ps auxf"
  185. alias psgrep="ps aux | grep -v grep | grep -i -e VSZ -e"
  186.  
  187. #grub update
  188. alias upgrub="sudo grub-mkconfig -o /boot/grub/grub.cfg"
  189. #grub issue 08/2022
  190. alias install-grub-efi="sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi"
  191.  
  192. #add new fonts
  193. alias upfc='sudo fc-cache -fv'
  194.  
  195. #copy/paste all content of /etc/skel over to home folder - backup of config created - beware
  196. #skel alias has been replaced with a script at /usr/local/bin/skel
  197.  
  198. #backup contents of /etc/skel to hidden backup folder in home/user
  199. alias bupskel='cp -Rf /etc/skel ~/.skel-backup-$(date +%Y.%m.%d-%H.%M.%S)'
  200.  
  201. #copy shell configs
  202. alias cb='cp /etc/skel/.bashrc ~/.bashrc && echo "Copied."'
  203. alias cz='cp /etc/skel/.zshrc ~/.zshrc && exec zsh'
  204. alias cf='cp /etc/skel/.config/fish/config.fish ~/.config/fish/config.fish && echo "Copied."'
  205.  
  206. #switch between bash and zsh
  207. alias tobash="sudo chsh $USER -s /bin/bash && echo 'Now log out.'"
  208. alias tozsh="sudo chsh $USER -s /bin/zsh && echo 'Now log out.'"
  209. alias tofish="sudo chsh $USER -s /bin/fish && echo 'Now log out.'"
  210.  
  211. #switch between lightdm and sddm
  212. 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'"
  213. alias tosddm="sudo pacman -S sddm --noconfirm --needed ; sudo systemctl enable sddm.service -f ; echo 'Sddm is active - reboot now'"
  214. alias toly="sudo pacman -S ly --noconfirm --needed ; sudo systemctl enable ly.service -f ; echo 'Ly is active - reboot now'"
  215. alias togdm="sudo pacman -S gdm --noconfirm --needed ; sudo systemctl enable gdm.service -f ; echo 'Gdm is active - reboot now'"
  216. alias tolxdm="sudo pacman -S lxdm --noconfirm --needed ; sudo systemctl enable lxdm.service -f ; echo 'Lxdm is active - reboot now'"
  217.  
  218. # kill commands
  219. # quickly kill conkies
  220. alias kc='killall conky'
  221. # quickly kill polybar
  222. alias kp='killall polybar'
  223. # quickly kill picom
  224. alias kpi='killall picom'
  225.  
  226. #hardware info --short
  227. alias hw="hwinfo --short"
  228.  
  229. #audio check pulseaudio or pipewire
  230. alias audio="pactl info | grep 'Server Name'"
  231.  
  232. #skip integrity check
  233. alias paruskip='paru -S --mflags --skipinteg'
  234.  
  235. #check vulnerabilities microcode
  236. alias microcode='grep . /sys/devices/system/cpu/vulnerabilities/*'
  237.  
  238. #get fastest mirrors in your neighborhood
  239. alias mr="sudo reflector -f 30 -l 30 --number 10 --verbose --save /etc/pacman.d/mirrorlist"
  240. alias mrd="sudo reflector --latest 30 --number 10 --sort delay --save /etc/pacman.d/mirrorlist"
  241. alias mrs="sudo reflector --latest 30 --number 10 --sort score --save /etc/pacman.d/mirrorlist"
  242. alias mra="sudo reflector --latest 30 --number 10 --sort age --save /etc/pacman.d/mirrorlist"
  243.  
  244. #our experimental - best option for the moment
  245. alias mirrorx="sudo reflector --age 6 --latest 20 --fastest 20 --threads 5 --sort rate --protocol https --save /etc/pacman.d/mirrorlist"
  246. alias mirrorxx="sudo reflector --age 6 --latest 20 --fastest 20 --threads 20 --sort rate --protocol https --save /etc/pacman.d/mirrorlist"
  247. alias ram='rate-mirrors --allow-root --disable-comments arch | sudo tee /etc/pacman.d/mirrorlist'
  248. alias rams='rate-mirrors --allow-root --disable-comments --protocol https arch | sudo tee /etc/pacman.d/mirrorlist'
  249.  
  250. #mounting the folder Public for exchange between host and guest on virtualbox
  251. alias vbm="sudo /usr/local/bin/arcolinux-vbox-share"
  252.  
  253. #shopt
  254. #shopt -s autocd # change to named directory
  255. #shopt -s cdspell # autocorrects cd misspellings
  256. #shopt -s cmdhist # save multi-line commands in history as single line
  257. #shopt -s dotglob
  258. #shopt -s histappend # do not overwrite history
  259. #shopt -s expand_aliases # expand aliases
  260.  
  261. #youtube download
  262. alias yta-aac="yt-dlp --extract-audio --audio-format aac "
  263. alias yta-best="yt-dlp --extract-audio --audio-format best "
  264. alias yta-flac="yt-dlp --extract-audio --audio-format flac "
  265. alias yta-mp3="yt-dlp --extract-audio --audio-format mp3 "
  266. alias ytv-best="yt-dlp -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/bestvideo+bestaudio' --merge-output-format mp4 "
  267.  
  268. #Recent Installed Packages
  269. alias rip="expac --timefmt='%Y-%m-%d %T' '%l\t%n %v' | sort | tail -200 | nl"
  270. alias riplong="expac --timefmt='%Y-%m-%d %T' '%l\t%n %v' | sort | tail -3000 | nl"
  271.  
  272. #iso and version used to install ArcoLinux
  273. alias iso="cat /etc/dev-rel | awk -F '=' '/ISO/ {print $2}'"
  274. alias isoo="cat /etc/dev-rel"
  275.  
  276. #Cleanup orphaned packages
  277. alias cleanup='sudo pacman -Rns $(pacman -Qtdq)'
  278.  
  279. #clear
  280. alias clean="clear; seq 1 $(tput cols) | sort -R | sparklines | lolcat"
  281.  
  282. #search content with ripgrep
  283. alias rg="rg --sort path"
  284.  
  285. #get the error messages from journalctl
  286. alias jctl="journalctl -p 3 -xb"
  287.  
  288. #nano for important configuration files
  289. #know what you do in these files
  290. alias nlxdm="sudo $EDITOR /etc/lxdm/lxdm.conf"
  291. alias nlightdm="sudo $EDITOR /etc/lightdm/lightdm.conf"
  292. alias npacman="sudo $EDITOR /etc/pacman.conf"
  293. alias ngrub="sudo $EDITOR /etc/default/grub"
  294. alias nconfgrub="sudo $EDITOR /boot/grub/grub.cfg"
  295. alias nmkinitcpio="sudo $EDITOR /etc/mkinitcpio.conf"
  296. alias nmirrorlist="sudo $EDITOR /etc/pacman.d/mirrorlist"
  297. alias narcomirrorlist="sudo $EDITOR /etc/pacman.d/arcolinux-mirrorlist"
  298. alias nsddm="sudo $EDITOR /etc/sddm.conf"
  299. alias nsddmk="sudo $EDITOR /etc/sddm.conf.d/kde_settings.conf"
  300. alias nfstab="sudo $EDITOR /etc/fstab"
  301. alias nnsswitch="sudo $EDITOR /etc/nsswitch.conf"
  302. alias nsamba="sudo $EDITOR /etc/samba/smb.conf"
  303. alias ngnupgconf="sudo $EDITOR /etc/pacman.d/gnupg/gpg.conf"
  304. alias nhosts="sudo $EDITOR /etc/hosts"
  305. alias nhostname="sudo $EDITOR /etc/hostname"
  306. alias nb="$EDITOR ~/.bashrc"
  307. alias nz="$EDITOR ~/.zshrc"
  308. alias nf="$EDITOR ~/.config/fish/config.fish"
  309. alias nneofetch="$EDITOR ~/.config/neofetch/config.conf"
  310.  
  311. #reading logs with bat
  312. alias lcalamares="bat /var/log/Calamares.log"
  313. alias lpacman="bat /var/log/pacman.log"
  314. alias lxorg="bat /var/log/Xorg.0.log"
  315. alias lxorgo="bat /var/log/Xorg.0.log.old"
  316.  
  317. #gpg
  318. #verify signature for isos
  319. alias gpg-check="gpg2 --keyserver-options auto-key-retrieve --verify"
  320. alias fix-gpg-check="gpg2 --keyserver-options auto-key-retrieve --verify"
  321. #receive the key of a developer
  322. alias gpg-retrieve="gpg2 --keyserver-options auto-key-retrieve --receive-keys"
  323. alias fix-gpg-retrieve="gpg2 --keyserver-options auto-key-retrieve --receive-keys"
  324. alias fix-keyserver="[ -d ~/.gnupg ] || mkdir ~/.gnupg ; cp /etc/pacman.d/gnupg/gpg.conf ~/.gnupg/ ; echo 'done'"
  325.  
  326. #fixes
  327. alias fix-perms="sudo chown -R $USER:$USER ~/.config ~/.local"
  328. alias keyfix="/usr/local/bin/arcolinux-fix-pacman-databases-and-keys"
  329. alias key-fix="/usr/local/bin/arcolinux-fix-pacman-databases-and-keys"
  330. alias keys-fix="/usr/local/bin/arcolinux-fix-pacman-databases-and-keys"
  331. alias fixkey="/usr/local/bin/arcolinux-fix-pacman-databases-and-keys"
  332. alias fixkeys="/usr/local/bin/arcolinux-fix-pacman-databases-and-keys"
  333. alias fix-key="/usr/local/bin/arcolinux-fix-pacman-databases-and-keys"
  334. alias fix-keys="/usr/local/bin/arcolinux-fix-pacman-databases-and-keys"
  335. alias fix-pacman-conf="/usr/local/bin/arcolinux-fix-pacman-conf"
  336. alias fix-pacman-keyserver="/usr/local/bin/arcolinux-fix-pacman-gpg-conf"
  337.  
  338. #maintenance
  339. alias big="expac -H M '%m\t%n' | sort -h | nl"
  340. alias dgrada="sudo downgrade --ala-url https://ant.seedhost.eu/arcolinux/"
  341.  
  342. #hblock (stop tracking with hblock)
  343. #use unhblock to stop using hblock
  344. alias unhblock="hblock -S none -D none"
  345.  
  346. #systeminfo
  347. alias probe="sudo -E hw-probe -all -upload"
  348. alias sysfailed="systemctl list-units --failed"
  349.  
  350. #shutdown or reboot
  351. alias ssn="sudo shutdown now"
  352. alias sr="sudo reboot"
  353.  
  354. #update betterlockscreen images
  355. alias bls="betterlockscreen -u /usr/share/backgrounds/arcolinux/"
  356.  
  357. #give the list of all installed desktops - xsessions desktops
  358. alias xd="ls /usr/share/xsessions"
  359. alias xdw="ls /usr/share/wayland-sessions"
  360.  
  361. # # ex = EXtractor for all kinds of archives
  362. # # usage: ex <file>
  363. ex ()
  364. {
  365. if [ -f $1 ] ; then
  366. case $1 in
  367. *.tar.bz2) tar xjf $1 ;;
  368. *.tar.gz) tar xzf $1 ;;
  369. *.bz2) bunzip2 $1 ;;
  370. *.rar) unrar x $1 ;;
  371. *.gz) gunzip $1 ;;
  372. *.tar) tar xf $1 ;;
  373. *.tbz2) tar xjf $1 ;;
  374. *.tgz) tar xzf $1 ;;
  375. *.zip) unzip $1 ;;
  376. *.Z) uncompress $1;;
  377. *.7z) 7z x $1 ;;
  378. *.deb) ar x $1 ;;
  379. *.tar.xz) tar xf $1 ;;
  380. *.tar.zst) tar xf $1 ;;
  381. *) echo "'$1' cannot be extracted via ex()" ;;
  382. esac
  383. else
  384. echo "'$1' is not a valid file"
  385. fi
  386. }
  387.  
  388. #wayland aliases
  389. alias wsimplescreenrecorder="wf-recorder -a"
  390.  
  391. #btrfs aliases
  392. alias btrfsfs="sudo btrfs filesystem df /"
  393. alias btrfsli="sudo btrfs su li / -t"
  394.  
  395. #snapper aliases
  396. alias snapcroot="sudo snapper -c root create-config /"
  397. alias snapchome="sudo snapper -c home create-config /home"
  398. alias snapli="sudo snapper list"
  399. alias snapcr="sudo snapper -c root create"
  400. alias snapch="sudo snapper -c home create"
  401.  
  402. #Leftwm aliases
  403. alias lti="leftwm-theme install"
  404. alias ltu="leftwm-theme uninstall"
  405. alias lta="leftwm-theme apply"
  406. alias ltupd="leftwm-theme update"
  407. alias ltupg="leftwm-theme upgrade"
  408.  
  409. #arcolinux applications
  410. #att is a symbolic link now
  411. #alias att="archlinux-tweak-tool"
  412. alias adt="arcolinux-desktop-trasher"
  413. alias abl="arcolinux-betterlockscreen"
  414. alias agm="arcolinux-get-mirrors"
  415. alias amr="arcolinux-mirrorlist-rank-info"
  416. alias aom="arcolinux-osbeck-as-mirror"
  417. alias ars="arcolinux-reflector-simple"
  418. alias atm="arcolinux-tellme"
  419. alias avs="arcolinux-vbox-share"
  420. alias awa="arcolinux-welcome-app"
  421.  
  422. #remove
  423. alias rmgitcache="rm -r ~/.cache/git"
  424.  
  425. #moving your personal files and folders from /personal to ~
  426. alias personal='cp -Rf /personal/* ~'
  427.  
  428. #create a file called .zshrc-personal and put all your personal aliases
  429. #in there. They will not be overwritten by skel.
  430.  
  431. [[ -f ~/.zshrc-personal ]] && . ~/.zshrc-personal
  432.  
  433. # reporting tools - install when not installed
  434.  
  435. #neofetch
  436. #screenfetch
  437. #alsi
  438. #paleofetch
  439. #fetch
  440. #hfetch
  441. #sfetch
  442. #ufetch
  443. #ufetch-arco
  444. #pfetch
  445. #sysinfo
  446. #sysinfo-retro
  447. #cpufetch
  448. colorscript random
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement