-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bash_vars
112 lines (96 loc) · 3.92 KB
/
.bash_vars
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/bin/bash
# default location for config files
test -z "$XDG_CONFIG_HOME" && export XDG_CONFIG_HOME="$HOME/.config"
# default location for config files
test -z "$XDG_CACHE_HOME" && export XDG_CACHE_HOME="$HOME/.cache"
# export the user-dirs variables
test -f "${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs" && . "${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs"
# location of config file for readline (normally ~/.inputrc)
export INPUTRC="$XDG_CONFIG_HOME/readline/inputrc"
# Make ncurses apps use the terminal default colors as the ncurses default colors.
# I think this only works if Lynx is compiled with ncurses color support... which should be extremely common.
# This allows Lynx to have a transparent background, for example.
export NCURSES_ASSUMED_COLORS='-1,-1'
# enable the config file for calc
export CALCRC='~/.calcrc'
# maxima configuration files
export MAXIMA_USERDIR="$XDG_CONFIG_HOME/maxima"
# irc client configs
export WEECHAT_HOME="$XDG_CONFIG_HOME/weechat"
# default location for Python REPL config
export PYTHONSTARTUP=~/.config/pythonrc
# home page for Lynx
export WWW_HOME='https://duckduckgo.com/lite'
export LYNX_CFG="$XDG_CONFIG_HOME/lynx/lynx.cfg"
export LYNX_LSS="$XDG_CONFIG_HOME/lynx/lynx.lss"
# set the default editor to vim
export EDITOR=`which vim`
export SUDO_EDITOR=`which vim`
export BROWSER=`which firefox 2>/dev/null`
# Track a single ssh-agent across multiple shells.
# example of ssh-agent output:
#SSH_AUTH_SOCK=/tmp/ssh-bITD9PhOiQiY/agent.1303522; export SSH_AUTH_SOCK;
#SSH_AGENT_PID=1303523; export SSH_AGENT_PID;
#echo Agent pid 1303523;
export SSH_AGENT_TRACKFILE=$HOME/.local/share/ssh-agent-vars.sh
export SSH_AGENT_TRACKLOG=$HOME/log/ssh-agent-track.log
{
echo
date
if [ -f "$SSH_AGENT_TRACKFILE" ]
then
echo ssh agent trackfile exists: "$SSH_AGENT_TRACKFILE"
echo sourcing...
source "$SSH_AGENT_TRACKFILE"
if [ "$(ps -p $SSH_AGENT_PID o cmd='')" != 'ssh-agent' ]
then
echo trackfile was out of date \(listed process not found\)
echo starting a new agent...
ssh-agent > "$SSH_AGENT_TRACKFILE"
source "$SSH_AGENT_TRACKFILE"
fi
else
echo ssh agent trackfile does NOT exist: "$SSH_AGENT_TRACKFILE"
echo creating a new trackfile...
mkdir -p "$(dirname "$SSH_AGENT_TRACKFILE")" # in case the directory doesn't exist yet
echo starting a new agent...
ssh-agent > "$SSH_AGENT_TRACKFILE"
source "$SSH_AGENT_TRACKFILE"
fi
} >> "$SSH_AGENT_TRACKLOG"
# add ~/texmf to LaTeX's path:
test -d "~/texmf" && export TEXMFHOME="$HOME/texmf"
# set the variable that points the gnupg.vim plugin to the current terminal
# Only relevant once that plugin is fixed and I start using it.
# GPG_TTY=`tty`
# export GPG_TTY
# Compatability for Linux-like environments on Windows
AHKEXE='/c/Program Files/AutoHotkey/AutoHotkeyU64.exe'
if [[ -n $(uname -a | grep -i microsoft) ]]; then
WINCOMPATABILITY=WSL
AHKEXE="/mnt$AHKEXE"
elif [[ -n $(uname -a | grep -i MINGW) ]]; then
WINCOMPATABILITY=MINGW # git bash
else
WINCOMPATABILITY='' # real linux
fi
export WINCOMPATABILITY AHKEXE
##### Make the output of `less` colored #####
export LESS='--RAW-CONTROL-CHARS'
export MANROFFOPT="-P -c" # I *think* this allows escape seqs to make it through nroff
# "stop all"="reset to defaults" (applies to so, us, mb, md, and mr)
export LESS_TERMCAP_me=$'\e[0m'
# "start blinking"="magenta fg"
export LESS_TERMCAP_mb=$'\e[35m'
# "start bold"="bold cyan fg"
export LESS_TERMCAP_md=$'\e[1;96m'
# "start standout"="black fg; green bg; no dim"
export LESS_TERMCAP_so=$'\e[30;42;22m'
# "end standout"="default fg and bg"
export LESS_TERMCAP_se=$'\e[39;49m'
# "start underlining"="start ul; light yellow fg"
export LESS_TERMCAP_us=$'\e[4;93m'
# "end underlining"="reset ul and fg"
export LESS_TERMCAP_ue=$'\e[24;39m'
# "start half-bright"="dim"
export LESS_TERMCAP_mh=$'\e[2m'