annotate bashrc @ 90:4342e7b19fa8

Standardise nanorc colouring with other file types
author IBBoard <dev@ibboard.co.uk>
date Mon, 02 Apr 2018 17:20:47 +0100
parents 21d5b52ae36f
children 87de05d9f75f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6
013543014cc9 Make sure we import a default bashrc file
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
1 if [ -f /etc/bashrc ]; then
013543014cc9 Make sure we import a default bashrc file
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
2 . /etc/bashrc
013543014cc9 Make sure we import a default bashrc file
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
3 fi
013543014cc9 Make sure we import a default bashrc file
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
4
8
e6a261f18fb1 Add Bash Completion sourcing
IBBoard <dev@ibboard.co.uk>
parents: 6
diff changeset
5 # Use bash-completion, if available
e6a261f18fb1 Add Bash Completion sourcing
IBBoard <dev@ibboard.co.uk>
parents: 6
diff changeset
6 if [ -f /etc/bash_completion ]; then
e6a261f18fb1 Add Bash Completion sourcing
IBBoard <dev@ibboard.co.uk>
parents: 6
diff changeset
7 . /etc/bash_completion
e6a261f18fb1 Add Bash Completion sourcing
IBBoard <dev@ibboard.co.uk>
parents: 6
diff changeset
8 fi
e6a261f18fb1 Add Bash Completion sourcing
IBBoard <dev@ibboard.co.uk>
parents: 6
diff changeset
9
20
ea572e660598 Fix Thunderbird dates and add more comments
IBBoard <dev@ibboard.co.uk>
parents: 19
diff changeset
10 # Use a sane editor
0
27e8e563b02b * First config files
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
11 export EDITOR=/usr/bin/nano
24
acbc487533ab Consistently fix Thunderbird time settings by moving some bits to profile, not bashrc
IBBoard <dev@ibboard.co.uk>
parents: 20
diff changeset
12
47
066d31abcee4 Set 256-colour terminal
IBBoard <dev@ibboard.co.uk>
parents: 27
diff changeset
13 # Set 256-colour terminal support
51
6b1492d34562 Switch from xterm to screen to fix Nano scrolling
IBBoard <dev@ibboard.co.uk>
parents: 47
diff changeset
14 export TERM="screen-256color"
47
066d31abcee4 Set 256-colour terminal
IBBoard <dev@ibboard.co.uk>
parents: 27
diff changeset
15
24
acbc487533ab Consistently fix Thunderbird time settings by moving some bits to profile, not bashrc
IBBoard <dev@ibboard.co.uk>
parents: 20
diff changeset
16 #Import aliases
0
27e8e563b02b * First config files
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
17 test -s ~/.alias && . ~/.alias || true
20
ea572e660598 Fix Thunderbird dates and add more comments
IBBoard <dev@ibboard.co.uk>
parents: 19
diff changeset
18
ea572e660598 Fix Thunderbird dates and add more comments
IBBoard <dev@ibboard.co.uk>
parents: 19
diff changeset
19 # Add sbins to path to make life easier (e.g. /sbin/ifconfig)
0
27e8e563b02b * First config files
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
20 export PATH=/sbin:/usr/sbin:/usr/local/sbin:$PATH
20
ea572e660598 Fix Thunderbird dates and add more comments
IBBoard <dev@ibboard.co.uk>
parents: 19
diff changeset
21
ea572e660598 Fix Thunderbird dates and add more comments
IBBoard <dev@ibboard.co.uk>
parents: 19
diff changeset
22 #Disable man page number prompts - where there's more than one, we normally want the default (user command) version
0
27e8e563b02b * First config files
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
23 export MAN_POSIXLY_CORRECT=1
27e8e563b02b * First config files
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
24
19
170de0d0d6dd Stop less creating a history file
IBBoard <dev@ibboard.co.uk>
parents: 8
diff changeset
25 #Disable less history, because do I really search the same things enough to use it across sessions?
170de0d0d6dd Stop less creating a history file
IBBoard <dev@ibboard.co.uk>
parents: 8
diff changeset
26 export LESSHISTFILE=-
170de0d0d6dd Stop less creating a history file
IBBoard <dev@ibboard.co.uk>
parents: 8
diff changeset
27
24
acbc487533ab Consistently fix Thunderbird time settings by moving some bits to profile, not bashrc
IBBoard <dev@ibboard.co.uk>
parents: 20
diff changeset
28 export XDG_CACHE_HOME="$HOME/.cache"
acbc487533ab Consistently fix Thunderbird time settings by moving some bits to profile, not bashrc
IBBoard <dev@ibboard.co.uk>
parents: 20
diff changeset
29
0
27e8e563b02b * First config files
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
30 if [ "$PS1" != "" -a "${STARTED_TMUX:-x}" = x -a "${SSH_TTY:-x}" != x ]
27e8e563b02b * First config files
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
31 then
27e8e563b02b * First config files
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
32 STARTED_TMUX=1; export STARTED_TMUX
27e8e563b02b * First config files
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
33 sleep 1
27e8e563b02b * First config files
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
34 ( (tmux has-session -t remote && tmux attach-session -t remote) || (tmux new-session -s remote) ) && exit 0
27e8e563b02b * First config files
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
35 echo "tmux failed to start"
6
013543014cc9 Make sure we import a default bashrc file
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
36 fi
27
c67aa2af6ff2 Switch to ibus, because it is simpler than uim but does XCompose
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
37
49
8f4076fd85a9 Export LS_OPTION from bashrc because profile doesn't seem to work on Tumbleweed
IBBoard <dev@ibboard.co.uk>
parents: 47
diff changeset
38 export GTK_IM_MODULE=ibus
56
3c48c5671f1a Make the prompt more visible and fix "less" highlighting
IBBoard <dev@ibboard.co.uk>
parents: 54
diff changeset
39 export LS_OPTIONS="$LS_OPTIONS -p"
3c48c5671f1a Make the prompt more visible and fix "less" highlighting
IBBoard <dev@ibboard.co.uk>
parents: 54
diff changeset
40
64
39b07c5f8785 Add Git and Mercurial support to command prompt
IBBoard <dev@ibboard.co.uk>
parents: 62
diff changeset
41 function vcs_status {
39b07c5f8785 Add Git and Mercurial support to command prompt
IBBoard <dev@ibboard.co.uk>
parents: 62
diff changeset
42 GIT_PS1_SHOWDIRTYSTATE=1
39b07c5f8785 Add Git and Mercurial support to command prompt
IBBoard <dev@ibboard.co.uk>
parents: 62
diff changeset
43 GIT_PS1_SHOWUPSTREAM=verbose
39b07c5f8785 Add Git and Mercurial support to command prompt
IBBoard <dev@ibboard.co.uk>
parents: 62
diff changeset
44 . /etc/bash_completion.d/git-prompt.sh
39b07c5f8785 Add Git and Mercurial support to command prompt
IBBoard <dev@ibboard.co.uk>
parents: 62
diff changeset
45 VCS_EXTRA=$(__git_ps1 "%s")
39b07c5f8785 Add Git and Mercurial support to command prompt
IBBoard <dev@ibboard.co.uk>
parents: 62
diff changeset
46
39b07c5f8785 Add Git and Mercurial support to command prompt
IBBoard <dev@ibboard.co.uk>
parents: 62
diff changeset
47 if [[ "x$VCS_EXTRA" == "x" ]]; then
69
78b4a74a5452 Fix mercurial status spacing, make it show like Git
IBBoard <dev@ibboard.co.uk>
parents: 67
diff changeset
48 VCS_EXTRA=$(hg branch 2>/dev/null)
78b4a74a5452 Fix mercurial status spacing, make it show like Git
IBBoard <dev@ibboard.co.uk>
parents: 67
diff changeset
49 HG_EXTRA=$(hg prompt "{-{incoming|count}}{+{outgoing|count}}" 2>/dev/null)
78b4a74a5452 Fix mercurial status spacing, make it show like Git
IBBoard <dev@ibboard.co.uk>
parents: 67
diff changeset
50 if [[ "x$HG_EXTRA" != "x" ]]; then
78b4a74a5452 Fix mercurial status spacing, make it show like Git
IBBoard <dev@ibboard.co.uk>
parents: 67
diff changeset
51 VCS_EXTRA="${VCS_EXTRA} u${HG_EXTRA}"
78b4a74a5452 Fix mercurial status spacing, make it show like Git
IBBoard <dev@ibboard.co.uk>
parents: 67
diff changeset
52 fi
64
39b07c5f8785 Add Git and Mercurial support to command prompt
IBBoard <dev@ibboard.co.uk>
parents: 62
diff changeset
53 fi
39b07c5f8785 Add Git and Mercurial support to command prompt
IBBoard <dev@ibboard.co.uk>
parents: 62
diff changeset
54 if [[ "x$VCS_EXTRA" != "x" ]]; then
66
091d9fc4698b Limit path length and fix a colouring/wrapping bug that it highlighted
IBBoard <dev@ibboard.co.uk>
parents: 64
diff changeset
55 echo -n " ($VCS_EXTRA)"
64
39b07c5f8785 Add Git and Mercurial support to command prompt
IBBoard <dev@ibboard.co.uk>
parents: 62
diff changeset
56 fi
39b07c5f8785 Add Git and Mercurial support to command prompt
IBBoard <dev@ibboard.co.uk>
parents: 62
diff changeset
57 }
39b07c5f8785 Add Git and Mercurial support to command prompt
IBBoard <dev@ibboard.co.uk>
parents: 62
diff changeset
58
66
091d9fc4698b Limit path length and fix a colouring/wrapping bug that it highlighted
IBBoard <dev@ibboard.co.uk>
parents: 64
diff changeset
59 # Limit long paths
091d9fc4698b Limit path length and fix a colouring/wrapping bug that it highlighted
IBBoard <dev@ibboard.co.uk>
parents: 64
diff changeset
60 PROMPT_DIRTRIM=2
56
3c48c5671f1a Make the prompt more visible and fix "less" highlighting
IBBoard <dev@ibboard.co.uk>
parents: 54
diff changeset
61 # Bold the command prompt and standardise on SUSE format
57
28317d15a4cf Colourise prompt (PS1) based on Ubuntu default colours
IBBoard <dev@ibboard.co.uk>
parents: 56
diff changeset
62 # With colour!
70
3b6eae8d3801 Deal with spaces in current path when making $PS1
IBBoard <dev@ibboard.co.uk>
parents: 69
diff changeset
63 export PS1='\[\033[01;38;5;34m\]\u\[\033[01;38;5;28m\]@\[\033[01;38;5;34m\]\h\[\033[39m\]:\[\033[01;38;5;26m\]\w$(test "$PWD" != / && echo -n /)\[\033[39m\]\[\033[01;38;5;247m\]$(vcs_status)\[\033[39m\]>\[\033[00m\] '
56
3c48c5671f1a Make the prompt more visible and fix "less" highlighting
IBBoard <dev@ibboard.co.uk>
parents: 54
diff changeset
64
3c48c5671f1a Make the prompt more visible and fix "less" highlighting
IBBoard <dev@ibboard.co.uk>
parents: 54
diff changeset
65 # Fix "less" highlighting
59
2a3670fb2ef2 Improve highlighting background for "less"
IBBoard <dev@ibboard.co.uk>
parents: 57
diff changeset
66 export LESS_TERMCAP_so=$'\033[30;48;5;247m'
71
fed933b2b8f5 Fix Steam bug where overlay doesn't work
IBBoard <dev@ibboard.co.uk>
parents: 70
diff changeset
67 export LESS_TERMCAP_se=$'\033[0m'
fed933b2b8f5 Fix Steam bug where overlay doesn't work
IBBoard <dev@ibboard.co.uk>
parents: 70
diff changeset
68
72
21d5b52ae36f Configure default Go path to be sensible
IBBoard <dev@ibboard.co.uk>
parents: 71
diff changeset
69 export GOPATH="$HOME/.golang"
21d5b52ae36f Configure default Go path to be sensible
IBBoard <dev@ibboard.co.uk>
parents: 71
diff changeset
70
71
fed933b2b8f5 Fix Steam bug where overlay doesn't work
IBBoard <dev@ibboard.co.uk>
parents: 70
diff changeset
71 # Possible fix for Steam - https://github.com/ValveSoftware/steam-for-linux/issues/5000#issuecomment-305937612
fed933b2b8f5 Fix Steam bug where overlay doesn't work
IBBoard <dev@ibboard.co.uk>
parents: 70
diff changeset
72 export STEAM_RUNTIME_PREFER_HOST_LIBRARIES=0