Alucard

Untitled

Feb 16th, 2022 (edited)
401
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.00 KB | None | 0 0
  1. ### GENERAL
  2.  
  3. ## Autostart Sway at login
  4. [ "$(tty)" = "/dev/tty1" ] && exec sway
  5.  
  6. ## If not running interactively, don't do anything
  7. [[ $- != *i* ]] && return
  8.  
  9. ## Enable colors and change prompt
  10. autoload -U colors && colors
  11. PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b "
  12.  
  13. ### COMPINIT
  14.  
  15. zstyle :compinstall filename '/home/alucard/.zshrc'
  16. autoload -Uz compinit
  17. zstyle ':completion:*' menu select
  18. zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
  19. compinit
  20.  
  21. ### SETOPT
  22.  
  23. ## histfile
  24. HISTFILE=~/.histfile
  25. HISTSIZE=10000
  26. SAVEHIST=10000
  27. setopt BANG_HIST # Treat the '!' character specially during expansion
  28. setopt EXTENDED_HISTORY # Write the history file in the ":start:elapsed;command" format
  29. setopt INC_APPEND_HISTORY # Write to the history file immediately, not when the shell exits
  30. setopt SHARE_HISTORY # Share history between all sessions
  31. setopt HIST_EXPIRE_DUPS_FIRST # Expire duplicate entries first when trimming history
  32. setopt HIST_IGNORE_DUPS # Don't record an entry that was just recorded again
  33. setopt HIST_IGNORE_ALL_DUPS # Delete old recorded entry if new entry is a duplicate
  34. setopt HIST_FIND_NO_DUPS # Do not display a line previously found
  35. setopt HIST_IGNORE_SPACE # Don't record an entry starting with a space
  36. setopt HIST_SAVE_NO_DUPS # Don't write duplicate entries in the history file
  37. setopt HIST_REDUCE_BLANKS # Remove superfluous blanks before recording entry
  38. setopt HIST_VERIFY # Don't execute immediately upon history expansion
  39. setopt HIST_BEEP # Beep when accessing nonexistent history
  40.  
  41. ## autocompletion
  42. setopt MENU_COMPLETE # Automatically highlight first element of completion menu
  43. setopt AUTO_LIST # Automatically list choices on ambiguous completion
  44. setopt COMPLETE_IN_WORD # Complete from both ends of a word
  45.  
  46. ### PLUGINS
  47.  
  48. source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
  49. source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
  50.  
  51. ### EXPORT
  52.  
  53. export TERM="alacritty"
  54. export COLORTERM="truecolor"
  55. export EDITOR="micro"
  56. export VISUAL="micro"
  57. export MICRO_TRUECOLOR=1
  58. export HISTORY_IGNORE="(ls|cd|pwd|exit|mc|sudo mc|history|cd -|cd ..)"
  59. export XDG_SESSION_TYPE=wayland
  60. export XDG_CURRENT_DESKTOP=sway
  61. #export GDK_BACKEND=wayland
  62. export CLUTTER_BACKEND=wayland
  63. export SDL_VIDEODRIVER=wayland
  64. #export GTK_USE_PORTAL=0
  65. #export QT_QPA_PLATFORM=wayland-egl
  66. export QT_QPA_PLATFORMTHEME=qt6ct
  67. #export QT_WAYLAND_FORCE_DPI=physical
  68. #export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
  69. #export ECORE_EVAS_ENGINE=wayland_egl
  70. #export ELM_ENGINE=wayland_egl
  71. #export _JAVA_AWT_WM_NONREPARENTING=1
  72.  
  73. ### ALIASES
  74.  
  75. ## changing "ls" to "exa
  76. alias ls='exa -al --color=always --group-directories-first'
  77. alias la='exa -a --color=always --group-directories-first'
  78. alias ll='exa -l --color=always --group-directories-first'
  79. alias lt='exa -aT --color=always --group-directories-first'
  80. alias l.='exa -a | egrep "^\."'
  81.  
  82. ## colorize grep output
  83. alias grep='grep --color=auto'
  84. alias egrep='egrep --color=auto'
  85. alias fgrep='fgrep --color=auto'
  86.  
  87. ## pacman and yay
  88. alias pacs='sudo pacman -S'
  89. alias pacss='pacman -Ss'
  90. alias pacsi='pacman -Si'
  91. alias pacsl='pacman -Sl'
  92. alias pacqs='pacman -Qs'
  93. alias pacqi='pacman -Qi'
  94. alias pacql='pacman -Ql'
  95. alias pacqe='pacman -Qe'
  96. alias pacqet='pacman -Qet'
  97. alias pacqem='pacman -Qem'
  98. alias pacqen='pacman -Qen'
  99. alias pacqent='pacman -Qent'
  100. alias pacrn='sudo pacman -Rn'
  101. alias pacrns='sudo pacman -Rns'
  102. alias pacsyu='sudo pacman -Syyu'
  103. alias pacc='sudo pacman -Scc --noconfirm'
  104. alias yaysi='yay -Si'
  105. alias yaysl='yay -Sl'
  106. alias yayqi='yay -Qi'
  107. alias yayql='yay -Ql'
  108. alias yayrn='yay -Rn'
  109. alias yayrns='yay -Rns'
  110. alias yaysua='yay -Sua'
  111. alias yaysyu='yay -Syu'
  112. alias yayc='yay -Sc --noconfirm'
  113. alias unlock='sudo rm /var/lib/pacman/db.lck'
  114.  
  115. ## ssh
  116.  
  117. alias sshs='ssh -p 1098 alucard@server'
  118. #alias ssh git 'ssh git@gitlab.com'
  119.  
  120.  
  121. # shutdown & reboot
  122. alias shutdown='shutdown -h now'
  123. alias reboot='shutdown -r now'
  124.  
  125. ## systemctl
  126. alias sctlss='systemctl status'
  127. alias sctlsp='sudo systemctl stop'
  128. alias sctlst='sudo systemctl start'
  129. alias sctlrt='sudo systemctl restart'
  130. alias sctlrd='sudo systemctl reload'
  131. alias sctlee='sudo systemctl enable'
  132. alias sctlde='sudo systemctl disable'
  133. alias sctlbl='systemctl reboot --boot-loader-entry=linux.conf'
  134. alias sctlbz='systemctl reboot --boot-loader-entry=zen.conf'
  135. #alias sctlba='systemctl reboot --boot-loader-entry=amd.conf'
  136. alias sctlbu='systemctl reboot --firmware-setup'
  137.  
  138. ## journalctl
  139. #jctl
  140.  
  141. ## imv
  142. alias imv='imv * -s full -u linear'
  143.  
  144. ## HDSentinel
  145. alias hds='sudo hdsentinel'
  146. alias hdst='sudo hdsentinel | grep TB'
  147.  
  148. ## bc
  149. alias bc='bc -q'
  150.  
  151. ## newsboat
  152. alias rss='newsboat'
  153.  
  154. ## git
  155. #alias addup='git add -u'
  156. #alias addall='git add .'
  157. #alias branch='git branch'
  158. #alias checkout='git checkout'
  159. #alias clone='git clone'
  160. #alias commit='git commit -m'
  161. #alias fetch='git fetch'
  162. #alias pull='git pull origin'
  163. #alias push='git push origin'
  164. #alias stat='git status'
  165. #alias tag='git tag'
  166. #alias newtag='git tag -a'
  167.  
  168. ## confirm before overwriting something
  169. alias cp="cp -i"
  170. alias mv='mv -i'
  171. alias rm='rm -i'
  172.  
  173. ### ARCHIVE EXTRACTION
  174. ex ()
  175. {
  176. if [ -f $1 ] ; then
  177. case $1 in
  178. *.tar.bz2) tar xjf $1 ;;
  179. *.tar.gz) tar xzf $1 ;;
  180. *.bz2) pbzip2 $1 ;;
  181. *.rar) unrar x $1 ;;
  182. *.gz) pigz $1 ;;
  183. *.tar) tar xf $1 ;;
  184. *.tbz2) tar xjf $1 ;;
  185. *.tgz) tar xzf $1 ;;
  186. *.zip) unzip $1 ;;
  187. *.Z) uncompress $1;;
  188. *.7z) 7z x $1 ;;
  189. *.deb) ar x $1 ;;
  190. *.tar.xz) tar xf $1 ;;
  191. *.tar.zst) unzstd $1 ;;
  192. *) echo "'$1' cannot be extracted via ex()" ;;
  193. esac
  194. else
  195. echo "'$1' is not a valid file"
  196. fi
  197. }
  198.  
Add Comment
Please, Sign In to add comment