diff --git a/.bashrc b/.bashrc index d69d7b3..c16633f 100644 --- a/.bashrc +++ b/.bashrc @@ -1,6 +1,5 @@ # -# ~/.bashrc -- Sourced by bash in interactive non-login shells. -# Includes ~/.config/bashrc.d/* +# ~/.bashrc -- Sourced by bash in interactive non-login shells; includes ~/bashrc.d/* and ~/.bashrc.local # # If not running interactively, don't do anything @@ -10,17 +9,17 @@ set -o noclobber shopt -s checkwinsize shopt -s histappend -HISTCONTROL=ignoreboth -HISTSIZE=20000 -HISTFILESIZE=20000 -PROMPT_DIRTRIM=3 +export HISTCONTROL=ignoreboth +export HISTSIZE=20000 +export HISTFILESIZE=20000 +export PROMPT_DIRTRIM=3 # Save and display timestamps for history HISTTIMEFORMAT="[%F %T] " # Color output and default options -GREP_OPTS='--color=auto' -LS_OPTS='--color=auto -hFN --group-directories-first' +export GREP_OPTS='--color=auto' +export LS_OPTS='--color=auto -hFN --group-directories-first' export LESS="-Ri" # colored GCC warnings and errors @@ -72,16 +71,14 @@ else fi # Include drop-in files -if [[ -d ~/.config/bashrc.d ]]; then - for f in ~/.config/bashrc.d/*; do +if [[ -d ~/.bashrc.d ]]; then + for f in ~/.bashrc.d/*; do [[ -f $f ]] && source "$f" done fi -# Deprecation warning for old drop-in file locations -if [[ -e ~/.bashrc.d || -e ~/.bashrc.local ]]; then - echo "WARNING: ~/.bashrc.d and ~/.bashrc.local are ignored, please use ~/.config/bashrc.d/ instead." -fi +# Include host-specific bashrc +[[ -f ~/.bashrc.local ]] && source ~/.bashrc.local # Clean up environment variables unset TRED TGREEN TBLUE TGREENB TCYANB TWHITEB TRESET diff --git a/.config/bashrc.d/10_common.sh b/.bashrc.d/10_common_aliases.sh similarity index 96% rename from .config/bashrc.d/10_common.sh rename to .bashrc.d/10_common_aliases.sh index afa83de..00883f9 100644 --- a/.config/bashrc.d/10_common.sh +++ b/.bashrc.d/10_common_aliases.sh @@ -1,5 +1,5 @@ # -# ~/.config/bashrc.d/10_common.sh -- Collection of common bash aliases and functions +# ~/.bashrc.d/10_common_aliases.sh -- Collection of common bash aliases and functions # # Shortcut aliases diff --git a/.config/bashrc.d/30_desktop.sh b/.bashrc.d/30_desktop.sh similarity index 80% rename from .config/bashrc.d/30_desktop.sh rename to .bashrc.d/30_desktop.sh index c0d556e..87b06b8 100644 --- a/.config/bashrc.d/30_desktop.sh +++ b/.bashrc.d/30_desktop.sh @@ -1,5 +1,5 @@ # -# ~/.config/bashrc.d/30_desktop.sh -- Aliases and functions for desktop environments +# ~/.bashrc.d/30_desktop.sh -- Aliases and functions for desktop environments # # Open files according to MIME type diff --git a/.config/bashrc.d/60_server.sh b/.bashrc.d/60_server.sh similarity index 85% rename from .config/bashrc.d/60_server.sh rename to .bashrc.d/60_server.sh index 9e41ec4..106b30f 100644 --- a/.config/bashrc.d/60_server.sh +++ b/.bashrc.d/60_server.sh @@ -1,5 +1,5 @@ # -# ~/.config/bashrc.d/60_server.sh -- Custom .bashrc additions for server environments +# ~/.bashrc.d/60_server.sh -- Custom .bashrc additions for server environments # # Set this alias only on hosts where restic is installed diff --git a/.config/git/config b/.config/git/config deleted file mode 100644 index cdfd2f3..0000000 --- a/.config/git/config +++ /dev/null @@ -1,11 +0,0 @@ -# Include common settings (default branch, diff tools, aliases...) -[include] - path = ~/.config/git/config.inc/common.gitconfig - -# Include default user settings -[include] - path = ~/.config/git/config.inc/user_binaryDiv.gitconfig - -# # Do not sign commits with GPG -# [include] -# path = ~/.config/git/config.inc/no_gpgsign.gitconfig diff --git a/.config/git/config_root b/.config/git/config_root deleted file mode 100644 index 6df8856..0000000 --- a/.config/git/config_root +++ /dev/null @@ -1,11 +0,0 @@ -# Include common settings (default branch, diff tools, aliases...) -[include] - path = ~/.config/git/config.inc/common.gitconfig - -# Include default user settings -[include] - path = ~/.config/git/config.inc/user_binaryDiv.gitconfig - -# No PGP key for root user -[include] - path = ~/.config/git/config.inc/no_gpgsign.gitconfig diff --git a/.config/profile.d/30_desktop.sh b/.config/profile.d/30_desktop.sh deleted file mode 100644 index 3ed9f2d..0000000 --- a/.config/profile.d/30_desktop.sh +++ /dev/null @@ -1,16 +0,0 @@ -# -# ~/.config/profile.d/30_desktop.sh -- Environment variables for clients / desktop environments. -# - -# GNOME Keyring is used as an SSH agent on desktops -export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/gcr/ssh" - -# Preferred applications -export TERMINAL=sakura -export BROWSER=firefox - -# Wine: Do not change filetype associations -export WINEDLLOVERRIDES=winemenubuilder.exe=d - -# Firefox: Enable pixel-perfect scrolling -export MOZ_USE_XINPUT2=1 diff --git a/.gitconfig b/.gitconfig new file mode 100644 index 0000000..7df42d2 --- /dev/null +++ b/.gitconfig @@ -0,0 +1,11 @@ +# Include common settings (default branch, diff tools, aliases...) +[include] + path = ~/.gitconfig.inc/common.gitconfig + +# Include default user settings +[include] + path = ~/.gitconfig.inc/user_binaryDiv.gitconfig + +# # Do not sign commits with GPG +# [include] +# path = ~/.gitconfig.inc/no_gpgsign.gitconfig diff --git a/.config/git/config.inc/common.gitconfig b/.gitconfig.inc/common.gitconfig similarity index 100% rename from .config/git/config.inc/common.gitconfig rename to .gitconfig.inc/common.gitconfig diff --git a/.config/git/config.inc/no_gpgsign.gitconfig b/.gitconfig.inc/no_gpgsign.gitconfig similarity index 100% rename from .config/git/config.inc/no_gpgsign.gitconfig rename to .gitconfig.inc/no_gpgsign.gitconfig diff --git a/.config/git/config.inc/user_binaryDiv.gitconfig b/.gitconfig.inc/user_binaryDiv.gitconfig similarity index 100% rename from .config/git/config.inc/user_binaryDiv.gitconfig rename to .gitconfig.inc/user_binaryDiv.gitconfig diff --git a/.gitconfig_root b/.gitconfig_root new file mode 100644 index 0000000..ec96d0f --- /dev/null +++ b/.gitconfig_root @@ -0,0 +1,11 @@ +# Include common settings (default branch, diff tools, aliases...) +[include] + path = ~/.gitconfig.inc/common.gitconfig + +# Include default user settings +[include] + path = ~/.gitconfig.inc/user_binaryDiv.gitconfig + +# No PGP key for root user +[include] + path = ~/.gitconfig.inc/no_gpgsign.gitconfig diff --git a/.pam_environment b/.pam_environment new file mode 100644 index 0000000..95f2bc4 --- /dev/null +++ b/.pam_environment @@ -0,0 +1 @@ +SSH_AUTH_SOCK DEFAULT="${XDG_RUNTIME_DIR}/ssh-agent.sock" diff --git a/.profile b/.profile index e58d5b9..2df3854 100644 --- a/.profile +++ b/.profile @@ -1,33 +1,30 @@ # -# ~/.profile -- Included by .bash_profile, i.e. sourced in login shells. -# Includes ~/.config/profile.d/* +# ~/.profile -- Included by .bash_profile; includes ~/.profile.local # +# SSH key agent +[[ -e "$XDG_RUNTIME_DIR/gcr/ssh" ]] && export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/gcr/ssh" + # GPG key stuff export GPG_TTY=$(tty) -# Set terminal type to support colors +# Environment variables export TERM=xterm-color - -# Preferred editor +export TERMINAL=mate-terminal export EDITOR=vim - -# Set PATH -[[ -d "$HOME/.local/bin" ]] && export PATH="$HOME/.local/bin:$PATH" -[[ -d "$HOME/bin" ]] && export PATH="$HOME/bin:$PATH" - -# Settings for bc +export BROWSER=firefox export BC_ENV_ARGS="-lq" [[ -f "$HOME/.bcrc" ]] && export BC_ENV_ARGS="$BC_ENV_ARGS $HOME/.bcrc" -# Include drop-in files -if [[ -d ~/.config/profile.d ]]; then - for f in ~/.config/profile.d/*; do - [[ -f $f ]] && source "$f" - done -fi +# PATH +[[ -d "$HOME/.local/bin" ]] && export PATH="$HOME/.local/bin:$PATH" +[[ -d "$HOME/bin" ]] && export PATH="$HOME/bin:$PATH" -# Deprecation warning for .profile.local -if [[ -e ~/.profile.local ]]; then - echo "WARNING: ~/.profile.local is ignored, please use ~/.config/profile.d/ instead." -fi +# Wine: do not change filetype associations +export WINEDLLOVERRIDES=winemenubuilder.exe=d + +# Firefox: Enable pixel-perfect scrolling +export MOZ_USE_XINPUT2=1 + +# Include host-specific .profile +[ -f ~/.profile.local ] && source ~/.profile.local diff --git a/_local/aranea/.profile.local b/_local/aranea/.profile.local new file mode 100644 index 0000000..606eb9e --- /dev/null +++ b/_local/aranea/.profile.local @@ -0,0 +1,3 @@ +# +# ~/.profile.local (included by ~/.profile) +# diff --git a/_local/calliope/.bashrc.local b/_local/calliope/.bashrc.local new file mode 100644 index 0000000..d7307b5 --- /dev/null +++ b/_local/calliope/.bashrc.local @@ -0,0 +1,18 @@ +# +# ~/.bashrc.local -- calliope version +# + +# Assume colors are set in global .bashrc: +# - TRED +# - TGREEN +# - TBLUE +# - TGREENB (bold) +# - TRESET + +# Set host-specific bash prompt: "user@host pwd :U " +if [[ ${EUID} == 0 ]] ; then + PS1="${TRED}\u@\h ${TBLUE}\w ${TGREENB}:U ${TRESET}" +else + PS1="${TGREEN}\u@\h ${TBLUE}\w ${TGREENB}:U ${TRESET}" +fi +