bashrc 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. # -*- mode: sh -*-
  2. # If not running interactively, do nothing.
  3. [ -z "$PS1" ] && return
  4. ################################################################
  5. ### History
  6. # Do not put duplicate lines in the history.
  7. HISTCONTROL=erasedups:ignorespace
  8. HISTSIZE=1000
  9. HISTTIMEFORMAT='%Y-%m-%d %H:%M '
  10. HISTIGNORE="cd:pwd:ls:l:ll:fg:bg:jobs:j"
  11. HISTFILESIZE=9999
  12. # Double check of history substitutions.
  13. shopt -s histverify
  14. # All terminals use .bash_history file without overwriting it.
  15. shopt -s histappend
  16. #PROMPT_COMMAND="history -a"
  17. ################################################################
  18. ### Command prompts and titles
  19. PS1='\[\033[32m\]\A \[\033[0m\]\u\[\033[35m\]@\[\033[0m\]\h \[\033[40;1;33m\]\j\[\033[0;0;36m\] \! \[\033[1;34m\]\w\[\033[1;37m\]\n\[\033[0;1;31m\]\$\[\033[0m\] '
  20. PS2='\[\e[34m\]\#>\[\e[0m\] '
  21. if [ -n "$GUIX_ENVIRONMENT" ]; then
  22. PS1="\[\033[31m\][guix env] $PS1"
  23. fi
  24. case "$TERM" in
  25. xterm*|rxvt*)
  26. PS1="\[\e]0;\W\a\]$PS1"
  27. ;;
  28. *)
  29. ;;
  30. esac
  31. ################################################################
  32. ### Aliases
  33. alias ls='ls --color=auto'
  34. alias dir='dir --color=auto'
  35. alias vdir='vdir --color=auto'
  36. alias grep='grep --color=auto'
  37. alias fgrep='fgrep --color=auto'
  38. alias egrep='egrep --color=auto'
  39. alias sudo='sudo '
  40. alias se='SUDO_EDITOR=emacsclient sudoedit'
  41. alias ll='ls -AlFh --group-directories-first'
  42. alias l='ls -CAF --group-directories-first'
  43. alias j='jobs'
  44. alias p='pgrep -l'
  45. alias temperature='sudo hddtemp /dev/sd[ab]'
  46. alias pingg='ping -c3 google.com'
  47. alias pac='pacman'
  48. alias pacq='pacman -Q'
  49. alias pacqi='pacman -Qi'
  50. alias pacql='pacman -Ql'
  51. alias pacqo='pacman -Qo'
  52. alias pacqs='pacman -Qs'
  53. alias pacs='sudo pacman -S'
  54. alias pacsuy='sudo pacman -Suy'
  55. alias pacss='pacman -Ss'
  56. alias pacsi='pacman -Si'
  57. alias pacr='sudo pacman -R'
  58. alias pacu='sudo pacman -U'
  59. alias reboot='sudo reboot'
  60. alias halt='sudo halt'
  61. alias hyp-suspend='ssh root@hyperion "systemctl start systemd-suspend"'
  62. alias sc='sudo systemctl --no-pager'
  63. alias scu='systemctl --user --no-pager'
  64. alias scd='sudo systemctl daemon-reload'
  65. alias scud='systemctl --user daemon-reload'
  66. alias scuenv='systemctl --user --no-pager --full show-environment'
  67. alias scenv='systemctl --no-pager --full show-environment'
  68. alias Herd='sudo /run/current-system/profile/bin/herd'
  69. alias doc='herd doc'
  70. alias status='herd status'
  71. alias stop='herd stop'
  72. alias start='herd start'
  73. alias restart='herd restart'
  74. alias Doc='Herd doc'
  75. alias Status='Herd status'
  76. alias Stop='Herd stop'
  77. alias Start='Herd start'
  78. alias Restart='Herd restart'
  79. alias e='emacs --no-site-file &'
  80. alias eq='emacs -nw -Q'
  81. alias gc='guile-compile'
  82. alias m='mpv --quiet'
  83. alias my='mpv --quiet --ytdl'
  84. alias y='youtube-dl'
  85. alias yg='youtube-dl -f22'
  86. alias yb='youtube-dl -f18'
  87. ################################################################
  88. ### Misc
  89. shopt -s autocd
  90. # check the window size after each command and, if necessary,
  91. # update the values of LINES and COLUMNS.
  92. shopt -s checkwinsize
  93. # Unbind C-s and C-u.
  94. # stty -ixon
  95. stty kill ^- stop ^-
  96. # Disable 'suspend' builtin command as I use a script with the same name.
  97. enable -n suspend