My dotfiles. Period.

main.bashrc 17KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763
  1. #!/bin/bash
  2. ## hack to workaround Fedora/Red Hat bug 878428
  3. #shellcheck disable=SC1091
  4. test -f /usr/share/git-core/contrib/completion/git-prompt.sh \
  5. && . /usr/share/git-core/contrib/completion/git-prompt.sh
  6. #######################################################
  7. ### things to do BEFORE host/user-specific settings ###
  8. #######################################################
  9. ### .... ###
  10. ### SUBZ ###
  11. ### '''' ###
  12. prepend() {
  13. #
  14. # pre-pend $2 to filename $1
  15. #
  16. local path=$1
  17. local prefix=$2
  18. local dirpath
  19. local filename
  20. local abspath
  21. abspath=$(readlink -f "$path")
  22. dirpath=$(dirname "$abspath")
  23. filename=$(basename "$abspath")
  24. echo mv "$path" "$dirpath/$prefix-$filename"
  25. }
  26. smv() {
  27. #
  28. # scp but rm the source
  29. #
  30. local src=$1
  31. local dst=$2
  32. test $# -eq 2 || {
  33. echo "i can only 2 argz!" >&2
  34. return 2
  35. }
  36. scp "$src" "$dst" && rm "$src"
  37. }
  38. smvr() {
  39. #
  40. # smv but recursive
  41. #
  42. local src=$1
  43. local dst=$2
  44. test $# -eq 2 || {
  45. echo "i can only 2 argz!" >&2
  46. return 2
  47. }
  48. scp -r "$src" "$dst" && rm -r "$src"
  49. }
  50. snore() {
  51. #
  52. # Sleep loudly-ish for $1 time
  53. #
  54. local stime=${1:-0}
  55. test "$stime" == 0 || echo -e "sleeping for $BASHUM_COLOR_LGREEN$stime$BASHUM_COLOR_NORMAL"
  56. sleep "$stime"
  57. }
  58. dotsleep() {
  59. #
  60. # Sleep with dots for $1 seconds
  61. #
  62. local secs=$1
  63. echo -e "sleeping for $BASHUM_COLOR_LGREEN$secs$BASHUM_COLOR_NORMAL seconds"
  64. local secs_togo=$secs
  65. while test "$secs_togo" -gt 0; do
  66. sleep 1
  67. echo -n .
  68. ((secs_togo--))
  69. done
  70. echo
  71. }
  72. bb() {
  73. #
  74. # Ring the bell after $1 time of sleep
  75. #
  76. local stime=${1:-0}
  77. snore "$stime"
  78. printf '\a'
  79. }
  80. spec_cksources() {
  81. #
  82. # Check Source?: URL's in RPM spec file $1
  83. #
  84. local file=$1
  85. local hdr
  86. local url
  87. rpmspec -P "$file" \
  88. | grep -E 'Source[0-9]+: *http' \
  89. | while read -r hdr url; do
  90. echo -n "$hdr: $url .."
  91. curl -fsSL -I "$url" >/dev/null || {
  92. echo fail
  93. return 1
  94. }
  95. echo ok
  96. done
  97. }
  98. nn() {
  99. #
  100. # Ring the bell and send notification $1 after $2 time
  101. #
  102. local msg=${1:-this is done}
  103. local stime=$2
  104. bb "$stime"
  105. echo -e "hey, $BASHUM_COLOR_LRED$msg$BASHUM_COLOR_NORMAL"
  106. notify-send -a 'nn()' "hey, $msg"
  107. }
  108. pp() {
  109. #
  110. # Ring the bell and send notification $1 and pause
  111. #
  112. local msg=${1:-this is done}
  113. bb
  114. echo -e "hey, \033[1;31m$msg\033[1;0m!"
  115. notify-send -a 'pp()' "hey, $msg"
  116. read -r junk -p "Press Enter to continue"
  117. }
  118. lrep() {
  119. #
  120. # Print each line on STDIN $1 times
  121. #
  122. local rep=${1:-1}; shift
  123. local line
  124. local n
  125. while read -r line; do
  126. n=$rep
  127. while test "$n" -gt 0;
  128. do
  129. echo "$line"
  130. ((n--))
  131. done
  132. done
  133. }
  134. prep() {
  135. #
  136. # Print STDIN $1 times
  137. #
  138. local rep=${1:-1}; shift
  139. local data
  140. data=$(cat)
  141. n=$rep
  142. while test "$n" -gt 0;
  143. do
  144. echo "$data"
  145. echo
  146. ((n--))
  147. done
  148. }
  149. dt() {
  150. #
  151. # Open $1 new terminals
  152. #
  153. __bashum_run_n "${1:-1}" urxvt
  154. }
  155. dT() {
  156. #
  157. # Open $1 new alterminals
  158. #
  159. __bashum_run_n "${1:-1}" xfce4-terminal
  160. }
  161. hr() {
  162. #
  163. # Make horizontal ruler
  164. #
  165. local i
  166. local line
  167. for i in $(seq 1 "$COLUMNS"); do
  168. case $((i%10)) in
  169. 0) line+='#' ;;
  170. *) line+='-' ;;
  171. esac
  172. done
  173. echo "$line"
  174. echo "$line"
  175. echo "$line"
  176. }
  177. __bashum_run_n() {
  178. #
  179. # Run $2.. in background $1 times
  180. #
  181. local n=${1:-1}; shift
  182. while test "$n" -gt 0;
  183. do
  184. "$@" &
  185. ((n--))
  186. done
  187. }
  188. twice() {
  189. #
  190. # Run $@ two times
  191. #
  192. "$@"
  193. "$@"
  194. }
  195. ckyaml() {
  196. #
  197. # Check if YAML file $1 is loadable
  198. #
  199. local yfile=$1
  200. test -n "$yfile" || { echo "usage: ckyaml FILE.yaml"; return 2; }
  201. python -c 'import yaml; import sys; print(yaml.load(sys.stdin)["this"])' <"$yfile"
  202. }
  203. git() {
  204. #
  205. # /usr/bin/git wrapper just to disable dangerous commands
  206. #
  207. # In particular, `git-am` is a a close typo of my favorite
  208. # aliases `ap` (`git-add --patch`) and `cm` (`git-commit`)
  209. # but it's dangerous to call by accident as it destroys
  210. # workdir changes.
  211. #
  212. if grep -Fwqse "$1" "$GIT_DISABLED_COMMANDS"; then
  213. echo "You don't want this." >&2
  214. return 1
  215. else
  216. command git "$@"
  217. fi
  218. }
  219. grepcl() {
  220. #
  221. # Grep in common chat log files
  222. #
  223. # The order is from older apps to newer as I was moving towards
  224. # weechat.
  225. #
  226. grep "$@" -R \
  227. "$HOME/.config/xchat2/xchatlogs" \
  228. "$HOME/.config/xchat2/scrollback" \
  229. "$HOME/.config/hexchat/logs" \
  230. "$HOME/.config/hexchat/scrollback" \
  231. "$HOME/.local/share/weechat/logs.old" \
  232. "$HOME/.local/share/weechat/logs"
  233. }
  234. grepfx() {
  235. #
  236. # Grep recursively for technical debt
  237. #
  238. # '[F]' hack to avoid matching self
  239. #
  240. grep --color -n \
  241. --exclude-dir 'utils' \
  242. --exclude-dir '.git' \
  243. -o '#[F]IXME:.*' -R "$@"
  244. }
  245. grepr() {
  246. #
  247. # Grep recursively, keeping numbers and ignoring common dirs
  248. #
  249. # Number one tool for refactoring!
  250. #
  251. local p=$1; shift
  252. grep --color -n --exclude-dir=".git" -e "$p" -R "$@"
  253. }
  254. grepr1() {
  255. #
  256. # Like grepr() but only list matching items in this directory
  257. #
  258. # Ie. list only files in current directory or names of subdirectories
  259. # where matches were found "somewhere".
  260. #
  261. grepr "$@" -l | cut -d/ -f1 | uniq
  262. }
  263. greph() {
  264. #
  265. # Grep through bash history
  266. #
  267. history | sed 's/^ *//; s/ / /' | cut -d' ' -f2- | grep "$@"
  268. }
  269. gitcd() {
  270. #
  271. # Deep in git repo, cd to the git root
  272. #
  273. cd "$(git rev-parse --show-toplevel)" || return 1
  274. }
  275. clsz() {
  276. #
  277. # Clear screen and move the prompt to bottom
  278. #
  279. tput clear; tput cup "$(tput lines)" 0
  280. }
  281. bcdiff() {
  282. #
  283. # Call bcompare only if objects actually differ
  284. #
  285. test $# -eq 2 && diff "$@" >/dev/null && return
  286. bcompare "$@" &
  287. }
  288. strip_colors() {
  289. #
  290. # Strip color codes from stdin
  291. #
  292. # Stolen from http://unix.stackexchange.com/a/4533/9365
  293. #
  294. sed -r 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g'
  295. }
  296. vims() {
  297. #
  298. # List Vim .swp files in a nice table
  299. #
  300. # **Note:** For this ro work, you need to set up Vim to
  301. # use same swap directory as assigned below. this can
  302. # be achieved by addoing section such as this to your
  303. # .vimrc:
  304. #
  305. # if isdirectory($HOME . '/.local/share/vim') == 0
  306. # :silent !mkdir -p ~/.vim/swap >/dev/null 2>&1
  307. # endif
  308. # set directory=./.vim-swap//
  309. # set directory+=~/.local/share/vim/swap//
  310. # set directory+=~/tmp//
  311. # set directory+=.
  312. #
  313. # Call this after crash or poweroff to remind yourself what
  314. # files you were editing before fact. Example:
  315. #
  316. # 2015-07-10 06:10:48.603953758 +0200 ~/TODO.todo
  317. #
  318. # This should make it easier to recover after a little
  319. # disaster.
  320. #
  321. local swap="$HOME/.local/share/vim/swap"
  322. #shellcheck disable=SC1117
  323. find "$swap" -type f -print0 \
  324. | xargs -0 -r stat -c "%y %n" \
  325. | sed "
  326. s| $swap/| |
  327. s|%|/|g
  328. s|.swp$||
  329. s| $HOME| ~|
  330. s| \(..:..\):[^ ]* +.... | \\1 |
  331. " \
  332. | sort \
  333. | tac
  334. }
  335. fixnl() {
  336. #
  337. # Fix newlines in stdin and pass to stdout
  338. #
  339. # Note: We need to read whole stdin; this cannot work
  340. # for infinite stream.
  341. #
  342. # Fix annoying cases:
  343. #
  344. # * If multi-line text is missing newline at the
  345. # end---add the missing newline.
  346. #
  347. # * If -c is passed, and single-line text does have
  348. # a newline at the end, remove it.
  349. #
  350. # This will not touch properly terminated multi-line texts,
  351. # or zero-line texts (ie. oly chars with no newline at all).
  352. #
  353. local arg=$1 # argument passed
  354. local cache # cache to keep stream in
  355. local nlcount # count of newlines in the stream
  356. local lastchr # hex dump (2-digit, lowercase) of last char
  357. local single=keep # single-line streams:
  358. # keep: do nothing
  359. # chop: drop last char if it's a LF
  360. case $arg in
  361. -c|--chop-single) single=chop ;;
  362. esac
  363. cache="$(mktemp -t fixnl.XXXXXXXX)"
  364. cat >"$cache"
  365. nlcount=$(<"$cache" wc -l)
  366. lastchr=$(<"$cache" tail -c1 | hexdump -e '"%02x"')
  367. case $nlcount:$lastchr:$single in
  368. 0:??:*) cat "$cache" ;; # 'abc' => keep as is
  369. 1:0a:chop) head -c -1 "$cache" ;; # 'abc\n' => -c passed: chop!
  370. 1:0a:keep) cat "$cache" ;; # 'abc\n' => keep as is
  371. *:0a:*) cat "$cache" ;; # 'a\nb\nc\n' => keep as is
  372. *:??:*) cat "$cache"; echo ;; # 'a\nb\nc' => add the missing NL
  373. esac
  374. rm "$cache"
  375. }
  376. nlfor() {
  377. #
  378. # Replace $1 (or blank space) with newlines and fix final newline
  379. #
  380. # Shorthand for commonly used tr syntax. Example:
  381. #
  382. # $ echo "$PATH" | nlat :
  383. # /foo
  384. # /bar
  385. # $
  386. #
  387. # is almost like `tr : '\n'` except that it is a bit easier
  388. # to type and fixes the annoying problem with missing
  389. # newline at the end of the replaced string.
  390. #
  391. local char=$1
  392. test -n "$char" || char='[:blank:]'
  393. tr "$char" '\n' \
  394. | fixnl
  395. }
  396. nljoin() {
  397. #
  398. # Join lines with $1 (or space)
  399. #
  400. # Shorthand for commonly used tr syntax. Example:
  401. #
  402. # $ { echo foo; echo bar; } | nljoin :
  403. #
  404. # is almost like `tr '\n' :` except that it is a bit easier
  405. # to type and fixes the annoying problem with extraneous
  406. # newline/colon at the end of final string.
  407. #
  408. local char=$1
  409. test -n "$char" || char=' '
  410. tr '\n' "$char" \
  411. | sed "s/$char*$//" \
  412. | fixnl -c
  413. }
  414. urle() {
  415. #
  416. # Encode or decode (if $1 is '-d') message on stdin as URL encode
  417. #
  418. local fn=quote
  419. case $1 in
  420. -d) fn=unquote ;;
  421. -*) echo 'usage: urle [-d] <text' >&2; return 2 ;;
  422. esac
  423. python3 -c "import sys; from urllib.parse import $fn; print($fn(sys.stdin.read()));"
  424. }
  425. qpr() {
  426. #
  427. # Encode or decode (if $1 is '-d') message on stdin as Quoted Printable
  428. #
  429. local fn=encode
  430. case $1 in
  431. -d) fn=decode ;;
  432. -*) echo 'usage: qpr [-d] <text' >&2; return 2 ;;
  433. esac
  434. perl -MMIME::QuotedPrint -pe "\$_=MIME::QuotedPrint::$fn(\$_);"
  435. }
  436. xop() {
  437. #
  438. # Common clipboard operations with fixnl() on top
  439. #
  440. local op=$1
  441. local file=${2:-/dev/stdin}
  442. case $op in
  443. oo) xclip -selection clipboard -o | fixnl ;;
  444. o) xclip -o | fixnl ;;
  445. ii) fixnl -c | xclip -selection clipboard -i ;;
  446. i) fixnl -c | xclip -i ;;
  447. esac <"$file"
  448. }
  449. xod() {
  450. #
  451. # Like mktemp but get the content from clipboard
  452. #
  453. # Dump xo in a file named $1 somewhere in /tmp; echo the path
  454. # usage: scp $(xod useful_name.txt) eg:some/shared/place
  455. # instead of:
  456. #
  457. # xo > useful_name.txt
  458. # scp useful_name.txt eg:some/shared/place
  459. # rm useful_name.txt
  460. #
  461. local name="${1:-clipboard_dump.txt}"
  462. local tmp
  463. tmp=$(mktemp -d -t "xod.XXXXXXXX")
  464. xclip -o > "$tmp/$name"
  465. echo "$tmp/$name"
  466. }
  467. xood() {
  468. #
  469. # Just like xod() but using xoo (i.e. 'clipboard' clipboard)
  470. #
  471. local name="${1:-clipboard_dump.txt}"
  472. local tmp
  473. tmp=$(mktemp -d -t "xood.XXXXXXXX")
  474. xclip -selection clipboard -o > "$tmp/$name"
  475. echo "$tmp/$name"
  476. }
  477. xl() {
  478. #
  479. # Show primary clipboard in less(1)
  480. #
  481. xop o | less -S
  482. }
  483. xxl() {
  484. #
  485. # Show C-C clipboard in less(1)
  486. #
  487. xop oo | less -S
  488. }
  489. xvxx() {
  490. #
  491. # Edit text in primary clipboard and save it to C-C clipboard
  492. #
  493. # Ideal for editing snippets in browser-based editors: during editing,
  494. # select the text, open terminal, call `xvxx`, edit the text, move
  495. # back to the browser and paste it over the old (still selected) text.
  496. # That's it, no need to make up and save temporary files.
  497. #
  498. # If you quickly realize you need to re-edit the text, use xvvx().
  499. #
  500. xop o | vipe | xop ii
  501. }
  502. xcp() {
  503. #
  504. # Copy paths of $@ to clipboard
  505. #
  506. local path
  507. find "$@" -maxdepth 0 -mindepth 0 \
  508. | while read -r path; do
  509. readlink -e "$path"
  510. done \
  511. | xop i
  512. }
  513. xpst() {
  514. #
  515. # Paste paths from clipboard
  516. #
  517. { xop o; echo; } \
  518. | while read -r path; do
  519. echo "path='$path'" >&2
  520. test -e "$path" || {
  521. echo "does not exist: $path"
  522. continue
  523. }
  524. cp -r "$path" .
  525. done
  526. }
  527. xvb() {
  528. #
  529. # Edit text in primary clipboard and run it using bash
  530. #
  531. xop o | vipe | bash
  532. }
  533. xxvb() {
  534. #
  535. # Edit text in C-C clipboard and run it using bash
  536. #
  537. xop oo | vipe | bash
  538. }
  539. vxx() {
  540. #
  541. # Edit text on stdin and save it to C-C clipboard
  542. #
  543. # Ideal for editing outut of command before pasting ot to browser
  544. # or another GUI application. Run the command with `vxx`, edit
  545. # the text, move back to the application and paste it.
  546. #
  547. # If you quickly realize you need to re-edit the text, use xvvx().
  548. #
  549. vipe | xop ii
  550. }
  551. xcxx() {
  552. #
  553. # Filter text in primary clipboard using command $@ and save it to C-C clipboard
  554. #
  555. # Similar to xvvx() but instead of interactive editing, provided filter
  556. # command is run.
  557. #
  558. local cmd=("$@")
  559. xop o | "${cmd[@]}" | xop ii
  560. return "${PIPESTATUS[1]}"
  561. }
  562. vx() {
  563. #
  564. # Edit stdin and save it to primary clipboard
  565. #
  566. # Ideal for selecting snippets of output of arbitrary commands.
  567. # select the text, open terminal, call `xvx`, edit the text, move
  568. # back to the browser and paste it over the old (still selected) text.
  569. # That's it, no need to make up and save temporary files.
  570. #
  571. vipe | xop i
  572. }
  573. xxvxx() {
  574. #
  575. # Edit text in C-C clipboard and save it back
  576. #
  577. xop oo | vipe | xop ii
  578. }
  579. yt2ogg() {
  580. #
  581. # Download YouTube video as vorbis audio
  582. #
  583. local url=$1
  584. youtube-dl -x --audio-format vorbis "$url"
  585. }
  586. yum_hasbin() {
  587. #
  588. # Ask yum who has bin $1 (and make the output actually readable)
  589. #
  590. local bname
  591. for bname in "$@";
  592. do
  593. case $bname in
  594. */*) dnf provides "$bname" ;;
  595. *) dnf provides "*/bin/$bname" ;;
  596. esac \
  597. | grep '^.' \
  598. | grep -E '^[[:alnum:]_:.-]+ :'
  599. done
  600. }
  601. cal() {
  602. #
  603. # cal with the proper version pick
  604. #
  605. local cal_v
  606. local cal_es
  607. cal_v=$(command cal -V 2>/dev/null); cal_es=$?
  608. case $cal_es:$cal_v in
  609. 0:cal\ from\ util-linux\ 2.*)
  610. command cal --color=always --monday --week "$@"
  611. ;;
  612. 64:*)
  613. command cal -M "$@"
  614. ;;
  615. esac
  616. }
  617. ### .... ###
  618. ### BASH ###
  619. ### '''' ###
  620. HISTCONTROL=ignoredups:erasedups
  621. # shopt -s histappend
  622. # PROMPT_COMMAND="history -n; history -w; history -c; history -r; $PROMPT_COMMAND"
  623. HISTIGNORE="$HISTIGNORE:ls:ll:la:cd"
  624. HISTIGNORE="$HISTIGNORE:git st"
  625. HISTIGNORE="$HISTIGNORE:se *:sc *"
  626. HISTSIZE=33333
  627. HISTFILESIZE=33333
  628. HISTTIMEFORMAT='%F %T '
  629. GLOBIGNORE=.:..
  630. # shopt -s histverify
  631. # some more aliases
  632. alias cls='clear'
  633. alias czkrates='czkrates -v'
  634. alias ll='ls -lh'
  635. alias lla='ls -lha'
  636. alias lr='ll -lhrt'
  637. alias open='xdg-open'
  638. alias diff='colordiff -u'
  639. alias dmesg='dmesg --time-format iso'
  640. alias pad4='sed -e "/./s/^/ /"'
  641. alias mkittool='mkittool -v'
  642. alias grep='grep --color'
  643. alias sc='se --direction encz.cz'
  644. alias taskm='task modify'
  645. alias tasks='task rc.context:none'
  646. alias ts='ts "%F %T"'
  647. alias lsblk='lsblk -o +UUID,LABEL'
  648. alias pstree='pstree -h'
  649. alias virsh='virsh --connect qemu:///system'
  650. alias wttr='curl -s "wttr.in/?1&n&q"'
  651. alias xaa='xclip -o | audit2allow'
  652. alias xi='xop i'
  653. alias xii='xop ii'
  654. alias xo='xop o'
  655. alias xoo='xop oo'
  656. alias reboot="echo -n . ; sync ; echo -n . ; sync ; echo -n . ; systemctl reboot"
  657. alias poweroff="echo -n . ; sync ; echo -n . ; sync ; echo -n . ; systemctl poweroff"
  658. x4x() {
  659. #
  660. # Pad text from primary clipboard with 4 spaces; save to C-C clipboard
  661. #
  662. # ...that is, for inclusion as Markdown verbatim text.
  663. #
  664. xo | pad4 | xii
  665. }
  666. BASHUM__RV_TMP="/tmp/bashum-rv"
  667. mkdir -p "$BASHUM__RV_TMP"
  668. ### ...... ###
  669. ### OTHERS ###
  670. ### '''''' ###
  671. export LC_COLLATE=C # make sort upper first
  672. export EDITOR=vim
  673. export LESSOPEN="| /usr/bin/src-hilite-lesspipe.sh %s"
  674. export LESS=' -R '
  675. export NEATY=color
  676. export PRETTY=color
  677. export PRETTY_DEBUG_EXCLUDE=inigrep
  678. export MDVIMB__CONVERTER=cmark
  679. export MDVIMB__STYLE=darkzen # pergamen
  680. #shellcheck disable=SC2034
  681. {
  682. GIT_PS1_SHOWDIRTYSTATE=true
  683. GIT_PS1_SHOWUNTRACKEDFILES=true
  684. __SATURNIN_COMPLETE_DEBUG=true
  685. GIT_DISABLED_COMMANDS="$HOME/.gittum/disabled-commands"
  686. }
  687. export GIT_PAGER='less -S'
  688. # disable mounting things like SFTP to ~/.gvfs when accessed
  689. # via GIO (used by nautilus etc.)
  690. export GVFS_DISABLE_FUSE=1
  691. # disable the terrible beep sound (only for X; for tty?, blacklist pcspkr)
  692. xhost >& /dev/null && xset b off
  693. # get rid of those .pyc files once and for all
  694. export PYTHONDONTWRITEBYTECODE=1
  695. ssh-add -l >& /dev/null || ssh-add