1
0
Fork 0

cleanup zsh, pre-install script

This commit is contained in:
Massaki Archambault 2018-03-14 09:33:11 -04:00
parent 894b011bb1
commit d436398ab0
6 changed files with 16 additions and 9 deletions

View File

@ -1,4 +1,4 @@
# ZSH
# make word splitting behave like bash
setopt SH_WORD_SPLIT
# Evaluate if root user
@ -23,5 +23,3 @@ export IS_ROOT
export GPG_TTY=$(tty)
gpg-connect-agent updatestartuptty /bye >/dev/null
source ~/.local/profile.d/*

View File

@ -9,6 +9,7 @@ fi
alias http-server="python -m http.server"
alias nmap-libvirt="nmap 192.168.122.0/24"
alias xsel="xsel -b"
alias rename="perl-rename"
alias drun-it="docker run -it"
alias dexec-it="docker exec -it"

View File

@ -1,7 +1,3 @@
mkcdir() {
mkdir -p "$1" && cd "$1"
}
vialias() {
$EDITOR $ZSH_CUSTOM/100-alias.zsh
source $ZSH_CUSTOM/100-alias.zsh

View File

@ -10,8 +10,7 @@ if [ "$IS_ROOT" = false ]; then
# Check tmux
if tmux info &>/dev/null; then
tmux ls
echo " "
printf "\n%s\n\n" "$(tmux ls)"
fi
fi

13
scripts/pre-install.sh Normal file
View File

@ -0,0 +1,13 @@
#!/bin/bash
fix_permissions() {
chown -R "$(id --name -u):$(id --name -g)" "$1"
find "$1" -type d -exec chmod 700 {} \;
find "$1" -type f -exec chmod 600 {} \;
}
for d in "$HOME/.ssh" "$HOME/.gnupg"; do
mkdir -p "$d"
fix_permissions "$d"
done