mirror of https://github.com/kastdeur/dotfiles.git
Compare commits
11 Commits
279b135ffe
...
f7078d1b8a
Author | SHA1 | Date |
---|---|---|
Eric Teunis de Boone | f7078d1b8a | |
Eric Teunis de Boone | 77195d5de3 | |
Eric Teunis de Boone | c923c38566 | |
Eric Teunis de Boone | ce9fc9d752 | |
Eric Teunis de Boone | 6b0d6af2f8 | |
Eric Teunis de Boone | f67517fdec | |
Eric Teunis de Boone | 28be1944fd | |
Eric Teunis de Boone | b8f391ae20 | |
Eric Teunis de Boone | 12f86b412b | |
Eric Teunis de Boone | 7edec3a7a7 | |
Eric Teunis de Boone | ccba451d3d |
|
@ -6,7 +6,7 @@
|
||||||
- clean: ['~']
|
- clean: ['~']
|
||||||
|
|
||||||
- link:
|
- link:
|
||||||
~/.bashrc: bash/rc
|
~/.bashrc: bash/bashrc
|
||||||
~/.bash_profile: bash/profile
|
~/.bash_profile: bash/profile
|
||||||
~/.config/git/config: git/config
|
~/.config/git/config: git/config
|
||||||
~/.config/git/ignore_global: git/ignore
|
~/.config/git/ignore_global: git/ignore
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
~/.vimrc: vim/vimrc
|
~/.vimrc: vim/vimrc
|
||||||
~/.xinitrc: X11/xinitrc
|
~/.xinitrc: X11/xinitrc
|
||||||
~/.xprofile: X11/xprofile
|
~/.xprofile: X11/xprofile
|
||||||
~/.Xresources: X11/Xresources
|
~/.Xresources.src: X11/Xresources.src
|
||||||
~/.Xresources.d/urxvt: urxvt/Xresources
|
~/.Xresources.d/urxvt: urxvt/Xresources
|
||||||
~/.config/user-dirs.dirs: X11/user-dirs.dirs
|
~/.config/user-dirs.dirs: X11/user-dirs.dirs
|
||||||
~/.config/awesome: awesome
|
~/.config/awesome: awesome
|
||||||
|
@ -37,5 +37,10 @@
|
||||||
~/.ssh/keys/:
|
~/.ssh/keys/:
|
||||||
mode: 0700
|
mode: 0700
|
||||||
|
|
||||||
#- shell:
|
- shell:
|
||||||
# - git submodules update # after linking ~/.gitconfig
|
-
|
||||||
|
command: ./bin/Xresources-preprocess
|
||||||
|
description: Preprocess Xresources.src so that xrdb doesn't have to.
|
||||||
|
stderr: true
|
||||||
|
- [chmod 600 ./ssh/config, Ensure ./ssh/config only read/writable for owner]
|
||||||
|
# - git submodules update # after linking ~/.gitconfig
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
# Give a fortune cookie
|
|
||||||
if [[ $(command -v fortune) ]]
|
|
||||||
then
|
|
||||||
if [[ $(command -v cowsay) ]]
|
|
||||||
then
|
|
||||||
fortune -so | cowsay -n
|
|
||||||
else
|
|
||||||
fortune -so
|
|
||||||
fi
|
|
||||||
fi
|
|
|
@ -1,3 +0,0 @@
|
||||||
#LOL
|
|
||||||
alias shrug="echo '¯\_(ツ)_/¯'"
|
|
||||||
alias pinguin="echo 🐧"
|
|
|
@ -30,11 +30,11 @@ if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Load main things
|
# Load main things
|
||||||
if [ -d "$DOTBASH/bash.d" ]; then
|
if [ -d "$DOTBASH/bashrc.d" ]; then
|
||||||
for f in colours aliases history prompt_command password-store
|
for f in colours.bash aliases.bash history.bash prompt_command.bash password-store.bash network.bash
|
||||||
do
|
do
|
||||||
if [ -r "$DOTBASH/bash.d/$f" ]; then
|
if [ -r "$DOTBASH/bashrc.d/$f" ]; then
|
||||||
source "$DOTBASH/bash.d/$f"
|
source "$DOTBASH/bashrc.d/$f"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
@ -44,6 +44,12 @@ if [ -r "$DOTBASH/$HOSTNAME.bashrc" ]; then
|
||||||
source "$DOTBASH/$HOSTNAME.bashrc"
|
source "$DOTBASH/$HOSTNAME.bashrc"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -r "$HOME/.bashrc.local" ]; then
|
# Always source a local bashrc
|
||||||
source "$HOME/.bashrc.local"
|
[ -r "$HOME/.bashrc.local" ] && source "$HOME/.bashrc.local"
|
||||||
fi
|
|
||||||
|
# Use the local(ly linked) bashrc.private
|
||||||
|
[ -r "$HOME/.local/bashrc.private" ] && source "$HOME/.local/bashrc.private"
|
||||||
|
|
||||||
|
|
||||||
|
# Also check in .local for a bashrc
|
||||||
|
[ -r "$HOME/.local/bashrc" ] && source "$HOME/.local/bashrc"
|
|
@ -8,6 +8,7 @@ if [ -x /usr/bin/dircolors ]; then
|
||||||
alias grep='grep --color=auto'
|
alias grep='grep --color=auto'
|
||||||
alias fgrep='fgrep --color=auto'
|
alias fgrep='fgrep --color=auto'
|
||||||
alias egrep='egrep --color=auto'
|
alias egrep='egrep --color=auto'
|
||||||
|
alias ip='ip --color=auto'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# some more ls aliases
|
# some more ls aliases
|
||||||
|
@ -17,12 +18,19 @@ alias la='ls -A'
|
||||||
alias lla='ll -A'
|
alias lla='ll -A'
|
||||||
alias l='ls -CF'
|
alias l='ls -CF'
|
||||||
|
|
||||||
|
# make mkdir nicer
|
||||||
|
alias mkdir='mkdir -p -v'
|
||||||
|
|
||||||
# Use vim if possible instead of vi
|
# Use vim if possible instead of vi
|
||||||
if [[ $(command -v vim) ]]; then
|
if command -v vim > /dev/null; then
|
||||||
alias vi='vim'
|
alias vi='vim'
|
||||||
else
|
else
|
||||||
alias vim='vi'
|
alias vim='vi'
|
||||||
fi
|
fi
|
||||||
|
alias e="${EDITOR:-vi}"
|
||||||
|
|
||||||
|
# Alias expansion in sudo arguments
|
||||||
|
alias sudo='sudo '
|
||||||
|
|
||||||
# Reload bashrc
|
# Reload bashrc
|
||||||
alias bashreload="source ~/.bashrc"
|
alias bashreload="source ~/.bashrc"
|
||||||
|
@ -33,7 +41,12 @@ alias pc='python -ic "from __future__ import division; from math import *"'
|
||||||
# Moving around
|
# Moving around
|
||||||
alias ~='cd ~'
|
alias ~='cd ~'
|
||||||
alias ..='cd ..'
|
alias ..='cd ..'
|
||||||
|
alias ...='cd ../../'
|
||||||
|
|
||||||
# Computer control
|
# Computer control
|
||||||
alias blank='sleep 1s && xset dpms force off'
|
alias blank='sleep 1s && xset dpms force off'
|
||||||
alias lock='blank; xscreensaver-command --lock'
|
alias lock='blank; xscreensaver-command --lock'
|
||||||
|
|
||||||
|
# whatever
|
||||||
|
alias shrug="echo '¯\_(ツ)_/¯'"
|
||||||
|
alias pinguin="echo 🐧"
|
|
@ -52,28 +52,42 @@ function vte_thing() {
|
||||||
|
|
||||||
export PROMPT_COMMAND=__prompt_command
|
export PROMPT_COMMAND=__prompt_command
|
||||||
|
|
||||||
function __colored_hostname() {
|
function __PS1_hostname() {
|
||||||
local HOST="${1:-$HOSTNAME}"
|
# returns a formatted hostname
|
||||||
local color="${2:-$(color)}"
|
local color="${2:-$(color)}"
|
||||||
local PS1
|
|
||||||
|
|
||||||
if color ; then
|
# no colours? no need to run
|
||||||
case "${HOSTNAME%%.*}" in
|
if ! color ; then
|
||||||
'esson') PS1+="${IGre}\h${RCol}";;
|
echo "\h";
|
||||||
'tinsmith') PS1+="${Gre}\h${RCol}";;
|
return
|
||||||
'blacksmith') PS1+="${Blu}\h${RCol}";;
|
fi
|
||||||
'locksmith') PS1+="${Pur}\h${RCol}";;
|
|
||||||
'bladesmith') PS1+="${Yel}\h${RCol}";;
|
local HOST="${1:-$HOSTNAME}"
|
||||||
'gunsmith') PS1+="${Red}\h${RCol}";;
|
local PS1
|
||||||
'goldsmith') PS1+="${IYel}\h${RCol}";;
|
local NOMATCH
|
||||||
'lilo'*) PS1+="${BWhi}\h${RCol}";;
|
local func_extension="__PS1_hostname_extended"
|
||||||
'hg'*) PS1+="${BRed}\h${RCol}";;
|
|
||||||
'gouda'|'bunnik'|'houten'|'zandberg'|'bussum'|'baarn') PS1+="${Gre}${On_Whi}HEF:${Blu}${On_Whi}\h${RCol}";;
|
# check selected hostnames
|
||||||
'messier'*) PS1+="${Blu}Astro:${Red}\h${RCol}";;
|
case "${HOST%%.*}" in
|
||||||
*) PS1+="${Blu}${On_Whi}\h${RCol}";;
|
'locksmith') PS1+="${Pur}\h${RCol}";;
|
||||||
esac
|
'bladesmith') PS1+="${Yel}\h${RCol}";;
|
||||||
else
|
'gunsmith') PS1+="${Red}\h${RCol}";;
|
||||||
PS1+="\h"
|
'goldsmith') PS1+="${IYel}\h${RCol}";;
|
||||||
|
*) NOMATCH=1;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -n "${NOMATCH}" ]; then
|
||||||
|
if [ x$(type -t "$func_extension") = xfunction ]; then
|
||||||
|
NOMATCH=$($func_extension "$@")
|
||||||
|
fi
|
||||||
|
|
||||||
|
# extended colouring
|
||||||
|
if [ -z "${NOMATCH}" ]; then
|
||||||
|
PS1+="${NOMATCH}"
|
||||||
|
# default colouring
|
||||||
|
else
|
||||||
|
PS1+="${Blu}${On_Whi}\h${RCol}";
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "$PS1"
|
echo "$PS1"
|
||||||
|
@ -131,7 +145,7 @@ function __prompt_command() {
|
||||||
PS1+="@"
|
PS1+="@"
|
||||||
|
|
||||||
if color ; then
|
if color ; then
|
||||||
PS1+="$(__colored_hostname)"
|
PS1+="$(__PS1_hostname)"
|
||||||
else
|
else
|
||||||
PS1+="\h"
|
PS1+="\h"
|
||||||
fi
|
fi
|
|
@ -1,13 +1,18 @@
|
||||||
# ~/.bash_profile
|
# ~/.bash_profile
|
||||||
[ -z "$DOTFILES" ] && source "$HOME/.profile"
|
[ -z "$DOTFILES" ] && source "$HOME/.profile"
|
||||||
|
|
||||||
|
# Always source local bash_profiles
|
||||||
[ -r "$HOME/.bash_profile.local" ] && source "$HOME/.bash_profile.local"
|
[ -r "$HOME/.bash_profile.local" ] && source "$HOME/.bash_profile.local"
|
||||||
|
[ -r "$HOME/.local/bash_profile" ] && source "$HOME/.local/bash_profile"
|
||||||
|
|
||||||
if shopt -q login_shell
|
if shopt -q login_shell
|
||||||
then
|
then
|
||||||
# This is a bash login shell
|
# This is a bash login shell
|
||||||
LOGINHISTORY=~/.login.history
|
LOGINHISTORY=~/.login.history
|
||||||
LOGINSTRING="$(date) ${USER}@${HOSTNAME}"
|
|
||||||
|
|
||||||
echo $LOGINSTRING > $LOGINHISTORY
|
if [ -w "${LOGINHISTORY}" ]; then
|
||||||
|
echo "$(date) ${USER}@${HOSTNAME}" >> $LOGINHISTORY
|
||||||
|
fi
|
||||||
|
|
||||||
|
unset LOGINHISTORY
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -0,0 +1,45 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Use the precompiler to allow for `xrdb -nocpp -merge ~/.Xresources`.
|
||||||
|
# Inspiration from https://github.com/dolmen/Xresources.edit/blob/1be4f5601b3d4e8befa043386288c64e724ed746/Xresources.edit
|
||||||
|
|
||||||
|
fname=.Xresources
|
||||||
|
ext=src
|
||||||
|
force=
|
||||||
|
|
||||||
|
# Initial setup: move $fname to $fname.$ext
|
||||||
|
if [ ! -f "$HOME/$fname.$ext" ]; then
|
||||||
|
cat "$HOME/$fname" > "$HOME/$fname.$ext"
|
||||||
|
|
||||||
|
# Make $fname non-writable to discourage direct editing
|
||||||
|
chmod a-wx "$HOME/$fname"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check mtime
|
||||||
|
if [ -f "$HOME/$fname" -a "$HOME/$fname" -nt "$HOME/$fname.$ext" ]; then
|
||||||
|
{
|
||||||
|
echo "~/$fname is more recent than ~/$fname.$ext"
|
||||||
|
echo "You have to fix this manually."
|
||||||
|
echo "e.g. touch ~/$fname.$ext"
|
||||||
|
} >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Run cpp and save the result as ~/$fname
|
||||||
|
[ -e "$HOME/$fname" ] && chmod u+w "$HOME/$fname"
|
||||||
|
|
||||||
|
{
|
||||||
|
echo '! *************************************************'
|
||||||
|
echo "! Do not edit ~/$fname, but ~/$fname.$ext"
|
||||||
|
echo '! *************************************************'
|
||||||
|
echo '! vim:set ft=xdefaults:'
|
||||||
|
echo '!'
|
||||||
|
} > "$HOME/$fname"
|
||||||
|
|
||||||
|
cpp "$HOME/$fname.$ext" | tee -a "$HOME/$fname"
|
||||||
|
res=$?
|
||||||
|
|
||||||
|
# Make $fname non-writable to discourage direct editing
|
||||||
|
chmod a-wx "$HOME/$fname"
|
||||||
|
exit $res
|
|
@ -13,7 +13,3 @@ git pull || echo "Pulling from remote failed"
|
||||||
git submodule update --init --recursive "${DOTBOT_DIR}"
|
git submodule update --init --recursive "${DOTBOT_DIR}"
|
||||||
|
|
||||||
"${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" -d "${BASEDIR}" -c "${CONFIG}" "${@}"
|
"${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" -d "${BASEDIR}" -c "${CONFIG}" "${@}"
|
||||||
|
|
||||||
|
|
||||||
# Make sure ssh/config is only read/writable for owner
|
|
||||||
chmod 600 ssh/config
|
|
||||||
|
|
|
@ -40,7 +40,9 @@ then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# if this is BASH source BASHRC
|
# if this is BASH source BASHRC
|
||||||
if [ "$BASH" ] && [ -f $DOTFILES/bash/rc ]
|
DOTBASHRC="$DOTFILES/bash/bashrc"
|
||||||
|
if [ "$BASH" ] && [ -r "$DOTBASHRC" ]
|
||||||
then
|
then
|
||||||
source $DOTFILES/bash/rc
|
source "$DOTBASHRC"
|
||||||
fi
|
fi
|
||||||
|
unset DOTBASHRC
|
||||||
|
|
Loading…
Reference in New Issue