poetician

i3 ArcoLinux | config.fish | Eden Theme

Nov 3rd, 2020
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.89 KB | None | 0 0
  1. #
  2. # ~/.config/fish/config.fish
  3. #
  4.  
  5. set fish_greeting #suppresses the Fish intro message
  6.  
  7. #Ibus settings if needed
  8. #to start the daemon and change settings: type ibus-setup
  9. #delete the hashtags in the next 3 lines and restart
  10. #export GTK_IM_MODULE=ibus
  11. #export XMODIFIERS=@im=dbus
  12. #export QT_IM_MODULE=ibus
  13.  
  14. #sets paths of stuff
  15. set PS1 '[\u@\h \W]\$ '
  16.  
  17. if [ -d "HOME/.bin" ] ;
  18. then PATH="HOME/.bin:PATH"
  19. end
  20.  
  21. if [ -d "HOME/.local/bin" ] ;
  22. then PATH="HOME/.local/bin:PATH"
  23. end
  24.  
  25. ##Eden Prompt
  26. function _git_branch_name
  27. echo (command git symbolic-ref HEAD 2> /dev/null | sed -e 's|^refs/heads/||')
  28. end
  29.  
  30. function _is_git_dirty
  31. echo (command git status -s --ignore-submodules=dirty 2> /dev/null)
  32. end
  33.  
  34. ## Function to show a segment
  35. function _prompt_segment -d "Function to show a segment"
  36. # Get colors
  37. set -l bg $argv[1]
  38. set -l fg $argv[2]
  39.  
  40. # Set 'em
  41. set_color -b $bg
  42. set_color $fg
  43.  
  44. # Print text
  45. if [ -n "$argv[3]" ]
  46. echo -n -s $argv[3]
  47. end
  48.  
  49. # Reset
  50. set_color -b normal
  51. set_color normal
  52.  
  53. # Print padding
  54. if [ (count $argv) = 4 ]
  55. echo -n -s $argv[4]
  56. end
  57. end
  58.  
  59. function show_ssh_status -d "Function to show the ssh tag"
  60. if test "$THEME_EDEN_HIDE_SSH_TAG" != 'yes'
  61. if [ -n "$SSH_CLIENT" ]
  62. if [ (id -u) = "0" ]
  63. _prompt_segment red white "-SSH-" ' '
  64. else
  65. _prompt_segment blue white "-SSH-" ' '
  66. end
  67. end
  68. end
  69. end
  70.  
  71. function show_host -d "Show host & user name"
  72. # Display [user & host] info
  73. if test "$THEME_EDEN_SHOW_HOST" = 'yes'
  74. if [ (id -u) = "0" ]
  75. echo -n (set_color red)
  76. else
  77. echo -n (set_color blue)
  78. end
  79. echo -n ''(hostname|cut -d . -f 1)ˇ$USER' ' (set color normal)
  80. end
  81. end
  82.  
  83. function show_cwd -d "Function to show the current working directory"
  84. if test "$theme_short_path" != 'yes' -a (prompt_pwd) != '~' -a (prompt_pwd) != '/'
  85. set -l cwd (dirname (prompt_pwd))
  86. test $cwd != '/'; and set cwd $cwd'/'
  87. _prompt_segment normal cyan $cwd
  88. end
  89. set_color -o cyan
  90. echo -n (basename (prompt_pwd))' '
  91. set_color normal
  92. end
  93.  
  94. function show_git_info -d "Show git branch and dirty state"
  95. if [ (_git_branch_name) ]
  96. set -l git_branch '['(_git_branch_name)']'
  97.  
  98. set_color -o
  99. if [ (_is_git_dirty) ]
  100. set_color -o red
  101. echo -ne "$git_branch× "
  102. else
  103. set_color -o green
  104. echo -ne "$git_branch "
  105. end
  106. set_color normal
  107. end
  108. end
  109.  
  110. function show_prompt_char -d "Terminate with a nice prompt char"
  111. set -q THEME_EDEN_PROMPT_CHAR
  112. or set -U THEME_EDEN_PROMPT_CHAR '»'
  113. echo -n -s $normal $THEME_EDEN_PROMPT_CHAR ' '
  114. end
  115.  
  116. function fish_prompt
  117. set fish_greeting
  118.  
  119. # The newline before prompts
  120. echo ''
  121.  
  122. show_ssh_status
  123. show_host
  124. show_cwd
  125. show_git_info
  126. show_prompt_char
  127. end
  128. ## END of Eden Prompt
  129.  
  130. #list
  131. alias ls='exa -al --color=always --group-directories-first'
  132. alias la='ls -a'
  133. alias ll='ls -la'
  134. alias l='ls'
  135. alias l.='ls -A | egrep "^\."'
  136.  
  137. #fix typos
  138. alias cd..='cd ..'
  139. alias pdw="pwd"
  140. alias udpate='sudo pacman -Syyu'
  141. alias upate='sudo pacman -Syyu'
  142. alias pas="ps auxf"
  143.  
  144. #Colorize grep command output
  145. alias grep='grep --color=auto'
  146. alias egrep='egrep --color=auto'
  147. alias fgrep='fgrep --color=auto'
  148.  
  149. #readable output
  150. alias df='df -h'
  151.  
  152. #pacman unlock
  153. alias unlock="sudo rm /var/lib/pacman/db.lck"
  154. alias ulk="sudo rm /var/lib/pacman/db.lck"
  155.  
  156. #free
  157. alias free="free -mt"
  158.  
  159. #use all cores
  160. alias uac="sh ~/.bin/main/000*"
  161.  
  162. #continue an interrupted download
  163. alias wget="wget -c"
  164.  
  165. #userlist
  166. alias userlist="cut -d: -f1 /etc/passwd/"
  167.  
  168. #merge new settings
  169. alias merge="xrdb -merge ~/.Xresources"
  170.  
  171. #Aliases for software management
  172. #pacman or pm
  173. alias pacman='sudo pacman --color auto'
  174. alias up='sudo pacman -Syyu'
  175.  
  176. #yay - updates all AUR packages
  177. alias aurup="yay -Sua"
  178. #updates everything
  179. alias pksyua="yay -Syu --noconfirm"
  180. alias all="yay -Syu --noconfirm"
  181.  
  182. #ps
  183. alias psa="ps auxf"
  184. alias psgrep="ps aux | grep -v grep | grep -i -e VSZ -e"
  185.  
  186. #grub update
  187. alias update-grub="sudo grub-mkconfig -o /boot/grub/grub.cfg"
  188.  
  189. #add new fonts
  190. alias update-fc='sudo fc-cache -fv'
  191.  
  192. #copy/paste all content of /etc/skel over to home folder - backup of config created - beware
  193. alias skel='cp -Rf ~/.config ~/.config-backup-(date) && cp -rf /etc/skel/* ~'
  194. #backup contents of /etc/skel to hidden backup folder in home/user
  195. alias bupskel='cp -Rf /etc/skel ~/.skel-backup-(date)'
  196.  
  197. #copy bashrc-latest over on bashrc - cb= copy bashrc
  198. alias cb='sudo cp /etc/skel/.bashrc ~/.bashrc && source ~/.bashrc'
  199. #copy /etc/skel/.zshrc over on ~/.zshrc - cz= copy zshrc
  200. #alias cz='sudo cp /etc/skel/.zshrc ~/.zshrc && source ~/.zshrc'
  201. #copy /etc/skel/config.fish over on ~/.config/fish - cf = copy config.fish
  202. #alias cf='sudo cp /etc/skel/config.fish ~/.config/fish && source ~/.config/fish/config.fish
  203.  
  204. #switch between bash, zsh, and fish
  205. alias tobash="sudo chsh USER -s /bin/bash && echo 'Now log out.'"
  206. alias tozsh="sudo chsh USER -s /bin/zsh && echo 'Now log out.'"
  207. alias tofish="sudo chsh USER -s /bin/fish && echo 'Now log out.'"
  208.  
  209. #quickly kill conkies
  210. alias kc='killall conky'
  211.  
  212. #hardware info --short
  213. alias hw="hwinfo --short"
  214.  
  215. #skip integrity check
  216. alias yayskip='yay -S --mflags --skipinteg'
  217. alias trizenskip='trizen -S --skipinteg'
  218.  
  219. #check vulnerabilities microcode
  220. alias microcode='grep . /sys/devices/system/cpu/vulnerabilities/*'
  221.  
  222. #get fastest mirrors in your neighborhood
  223. alias mr="sudo reflector -f 30 -l 30 --number 10 --verbose --save /etc/pacman.d/mirrorlist"
  224. alias mirrord="sudo reflector --latest 50 --number 20 --sort delay --save /etc/pacman.d/mirrorlist"
  225. alias mirrors="sudo reflector --latest 50 --number 20 --sort score --save /etc/pacman.d/mirrorlist"
  226. alias mirrora="sudo reflector --latest 50 --number 20 --sort age --save /etc/pacman.d/mirrorlist"
  227.  
  228. #mounting the folder Public for exchange between host and guest on virtualbox
  229. alias vbm="sudo mount -t vboxsf -o rw,uid=1000,gid=1000 Public /home/$USER/Public"
  230.  
  231. #youtube-dl
  232. alias yta-aac="youtube-dl --extract-audio --audio-format aac "
  233. alias yta-best="youtube-dl --extract-audio --audio-format best "
  234. alias yta-flac="youtube-dl --extract-audio --audio-format flac "
  235. alias yta-m4a="youtube-dl --extract-audio --audio-format m4a "
  236. alias yta-mp3="youtube-dl --extract-audio --audio-format mp3 "
  237. alias yta-opus="youtube-dl --extract-audio --audio-format opus "
  238. alias yta-vorbis="youtube-dl --extract-audio --audio-format vorbis "
  239. alias yta-wav="youtube-dl --extract-audio --audio-format wav "
  240.  
  241. alias ytb="youtube-dl -f bestvideo+bestaudio "
  242.  
  243. #Recent Installed Packages
  244. alias rip="expac --timefmt='%Y-%m-%d %T' '%l\t%n %v' | sort | tail -200 | nl"
  245. alias riplong="expac --timefmt='%Y-%m-%d %T' '%l\t%n %v' | sort | tail -3000 | nl"
  246.  
  247. #Cleanup orphaned packages
  248. alias cleanup='sudo pacman -Rns (pacman -Qtdq)'
  249.  
  250. #get the error messages from journalctl
  251. alias jctl="journalctl -p 3 -xb"
  252.  
  253. #some other developer things
  254. alias bootmsg="dmesg > /home/$USER/dmesg.log"
  255. alias ply-splashshow="sudo plymouthd && sudo plymouth --show-splash"
  256.  
  257. #nano for important configuration files
  258. #know what you do in these files
  259. alias nlightdm="sudo nano /etc/lightdm/lightdm.conf"
  260. alias npacman="sudo nano /etc/pacman.conf"
  261. alias ngrub="sudo nano /etc/default/grub"
  262. alias nmkinitcpio="sudo nano /etc/mkinitcpio.conf"
  263. alias nslim="sudo nano /etc/slim.conf"
  264. alias noblogout="sudo nano /etc/oblogout.conf"
  265. alias nmirrorlist="sudo nano /etc/pacman.d/mirrorlist"
  266. alias nconfgrub="sudo nano /boot/grub/grub.cfg"
  267.  
  268. #gpg
  269. #verify signature for isos
  270. alias gpg-check="gpg2 --keyserver-options auto-key-retrieve --verify"
  271. #receive the key of a developer
  272. alias gpg-retrieve="gpg2 --keyserver-options auto-key-retrieve --receive-keys"
  273.  
  274. #shutdown or reboot
  275. alias ssn="sudo shutdown now"
  276. alias sr="sudo reboot"
  277.  
  278. #Poetician Aliases
  279. alias cl="clear"
  280. alias up='sudo pacman -Syyu'
  281. alias all="yay -Syu --noconfirm"
  282. alias rs="redshift &"
  283.  
  284. ##ex = EXtractor for all kinds of archives
  285. ##usage: ex <file>
  286. function ex -a FILE
  287. set ext1 (string split -r -m2 . $FILE)[2]
  288. set ext2 (string split -r -m2 . $FILE)[3]
  289. if test -z "$ext2"
  290. set ext $ext1
  291. else
  292. set ext $ext1.$ext2
  293. end
  294. switch $ext
  295. case "tar.bz2"
  296. tar xjf $FILE
  297. case "tar.gz"
  298. tar xzf $FILE
  299. case "bz2"
  300. bunzip2 $FILE
  301. case "rar"
  302. unrar x $FILE
  303. case "gz"
  304. gunzip $FILE
  305. case "tar"
  306. tar xf $FILE
  307. case "tbz2"
  308. tar xjf $FILE
  309. case "tgz"
  310. tar xzf $FILE
  311. case "zip"
  312. unzip $FILE
  313. case "Z"
  314. uncompress $FILE
  315. case "7z"
  316. 7z x $FILE
  317. case "deb"
  318. ar x $FILE
  319. case "tar.xz"
  320. tar xf $FILE
  321. case "tar.zst"
  322. unzstd $FILE
  323. case "*"
  324. echo "'$FILE' cannot be extracted via ex"
  325. end
  326. end
  327.  
  328.  
  329. #place other functions in a functions subdirectory. They will not be overwritten.
  330. #run neofetch
  331. neofetch
  332.  
Advertisement
Add Comment
Please, Sign In to add comment