-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.zprofile
More file actions
72 lines (62 loc) · 2.1 KB
/
.zprofile
File metadata and controls
72 lines (62 loc) · 2.1 KB
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
##### DEBUG ######
# Does this shit even work man
# export XKB_LOG_LEVEL=2
# export XKB_LOG_FILE=$HOME/xkb.log
###### SSH ######
# Setup SSH Agent (No systemd :[) # TODO move this to systemd?
SSH_ENV="$HOME/.ssh/agent-environment"
function start_agent {
echo "Initialising new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo succeeded
chmod 600 "${SSH_ENV}"
. "${SSH_ENV}" > /dev/null
# Example: add other keys
# /usr/bin/ssh-add ~/.ssh/other-keys/me-rivos-2;
}
# Source SSH settings, if applicable
if [ -f "${SSH_ENV}" ]; then
. "${SSH_ENV}" > /dev/null
#ps ${SSH_AGENT_PID} doesn't work under cywgin
ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
start_agent;
}
else
start_agent;
fi
###### Keyboard/Interface Settings ######
# TODO should this be in .zprofile?
# Map Shift+Space to '_' on graphical environments
# xmodmap -e 'keycode 65 = space underscore' # Requires x11-xserver-utils
# Map Shift+Space to '_' in the console
# TODO # Requires console-data
# Preferred editor for local and remote sessions
if [[ -n $SSH_CONNECTION ]]; then
export EDITOR='vim'
else
export EDITOR='vim'
fi
####### PATH changes ######
# Add things to PATH that are too heavy to add in .zshenv
# E.g. ones where I need to do conditional logic or launch subprocesses
# Mostly this is just the ones which may or may not exist on different systems
# and tend not to change much after that point, like .local/bin
# set PATH so it includes user-bins if they exist
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
fi
# Language-specific binary install paths
if [ -d "/usr/local/go/bin" ] ; then
PATH=$PATH:"/usr/local/go/bin" # Go
fi
if [ -d $HOME/.ghcup ] ; then
. "$HOME/.ghcup/env" # Haskell (Cabal, via ghcup)
fi
if [ -d "$HOME/.cargo" ] ; then
export CARGO_HOME="$HOME/.cargo" # Rust
. "$HOME/.cargo/env" # Rust
fi
export PATH