From 1c297d3a776c3c3aa2353bf3a73bb93c65a419dc Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 21 Apr 2018 01:03:17 +0100 Subject: [PATCH] Reorganise many directories into XDG dirs --- .config/X11/xinitrc | 18 +++++++++ .config/gopass/config.yml | 24 ++++++++++++ .gtkrc-2.0 => .config/gtk-2.0/settings.ini | 0 .profile | 43 +++++++++++----------- scripts/linkdotfiles | 24 ------------ 5 files changed, 63 insertions(+), 46 deletions(-) create mode 100644 .config/gopass/config.yml rename .gtkrc-2.0 => .config/gtk-2.0/settings.ini (100%) diff --git a/.config/X11/xinitrc b/.config/X11/xinitrc index 62dd892..3131ec9 100644 --- a/.config/X11/xinitrc +++ b/.config/X11/xinitrc @@ -19,4 +19,22 @@ xrandr --dpi $(xrdb -query | grep -i xft.dpi | cut -d: -f2) setxkbmap -option caps:none xset r rate 200 18 + +export TERMINAL="termite" +export BROWSER="chromium" +export _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel" +export QT_QPA_PLATFORMTHEME=gtk2 +export XDG_CURRENT_DESKTOP="GNOME" # Fixes xdg-open + +# Merge system clipboards +if [ -n "$DISPLAY" ] && exists autocutsel && ! pidof autocutsel 1>/dev/null; then + autocutsel -fork + autocutsel -selection PRIMARY -fork +fi + +# Start the gnome-keyring if it's installed +if exists gnome-keyring-daemon; then + export $(/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh,gnupg) +fi + exec i3 diff --git a/.config/gopass/config.yml b/.config/gopass/config.yml new file mode 100644 index 0000000..a39fbb8 --- /dev/null +++ b/.config/gopass/config.yml @@ -0,0 +1,24 @@ +root: + askformore: false + autoimport: true + autosync: true + cliptimeout: 45 + noconfirm: false + nopager: false + path: /home/frebib/.local/share/pass + safecontent: false + usesymbols: false + nocolor: false +mounts: + spritsail: + askformore: false + autoimport: true + autosync: true + cliptimeout: 45 + noconfirm: false + nopager: false + path: /home/frebib/.local/share/pass-spritsail + safecontent: false + usesymbols: false + nocolor: false +version: 1.6.10 diff --git a/.gtkrc-2.0 b/.config/gtk-2.0/settings.ini similarity index 100% rename from .gtkrc-2.0 rename to .config/gtk-2.0/settings.ini diff --git a/.profile b/.profile index 62dfe55..48af925 100644 --- a/.profile +++ b/.profile @@ -6,7 +6,8 @@ export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}" export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}" export XDG_LOCAL_HOME="$HOME/.local" -export XDG_CURRENT_DESKTOP="GNOME" # Fixes xdg-open + +mkdir -p "$XDG_CONFIG_HOME" "$XDG_CACHE_HOME" "$XDG_DATA_HOME" "$XDG_LOCAL_HOME" case "$(basename "$(readlink -f /proc/$$/exe)")" in zsh) thisfile="$(readlink -f "${(%):-%N}")";; @@ -16,25 +17,27 @@ esac export DOTFILES="$(dirname "${thisfile:-$XDG_CONFIG_HOME/dotfiles}")" export PATH="${PATH}:$DOTFILES/scripts" -# Allow Vim to load from ~/.config/vim +# Override paths for non-compliant programs +# https://wiki.archlinux.org/index.php/XDG_Base_Directory_support +# Vim export VIMDIR="$XDG_CONFIG_HOME/vim" export VIMRC="$VIMDIR/vimrc" export VIMINIT=":so $VIMRC" export EDITOR="vim" export VISUAL="vim" - -# Allow ZSH to load from ~/.config/zsh +# ZSH export ZDOTDIR="$XDG_CONFIG_HOME/zsh" - -# Configure X11 config file paths +# Gnupg +export GNUPGHOME="$XDG_CONFIG_HOME/gnupg" +# X11 export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority" export XINITRC="$XDG_CONFIG_HOME/X11/xinitrc" - -export MANPAGER="less -+N" -export TERMINAL="termite" -export BROWSER="chromium" -export _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel" -export QT_QPA_PLATFORMTHEME=gtk2 +# GTK2 +export GTK2_RC_FILES="$XDG_CONFIG_HOME"/gtk-2.0/settings.ini +# Cargo/Rust +export CARGO_HOME="$XDG_DATA_HOME/cargo" +# Pass +export PASSWORD_STORE_DIR="$XDG_DATA_HOME/pass" # Go configuration export GOPATH="$XDG_DATA_HOME/go" @@ -42,8 +45,13 @@ export PATH="$PATH:$GOPATH/bin" exists() { which $@ 0<&- 1>/dev/null 2>/dev/null; } +# Configure less and add colours export LESS="-RI" export PAGER="less $LESS" +export MANPAGER="less -+N" +# Disable histfile +export LESSHISTFILE=- + if exists tput; then export LESS_TERMCAP_mb=$(tput bold; tput setaf 2) # green export LESS_TERMCAP_md=$(tput bold; tput setaf 6) # cyan @@ -67,18 +75,9 @@ if [ -f "$XDG_CONFIG_HOME/secrets" ]; then set +o allexport fi -# Merge system clipboards -if [ -n "$DISPLAY" ] && exists autocutsel && ! pidof autocutsel 1>/dev/null; then - autocutsel -fork - autocutsel -selection PRIMARY -fork -fi - +# Start a dbus session daemon for programs that require it if [ -z "$DBUS_SESSION_BUS_ADDRESS" ] && exists dbus-launch; then eval $(dbus-launch --sh-syntax --exit-with-session) dbus-update-activation-environment --systemd DISPLAY fi -# Start the gnome-keyring if it's installed -if exists gnome-keyring-daemon; then - export $(/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh,gnupg) -fi diff --git a/scripts/linkdotfiles b/scripts/linkdotfiles index cd611fd..9ec9ec4 100755 --- a/scripts/linkdotfiles +++ b/scripts/linkdotfiles @@ -23,27 +23,3 @@ echo cd `pwd` for file in $conffiles; do ln -sfv $confpath/.config/$file . done - -cd $HOME -mkdir -p .local/share/ && cd .local/share -echo cd `pwd` -ln -sfv $DOTFILES/fonts . - -sudo -s << EOF -cd ~ -echo -n "cd " -pwd - -ln -sfv $DOTFILES .config/ -ln -sfv $userhome/.zshrc . -ln -sfv $userhome/.profile . -ln -sfv $userhome/.zprofile . -ln -sfv $userhome/.vimrc . -ln -sfv $userhome/.vim/ . -ln -sfv $userhome/.gtkrc-2.0 . - -mkdir -p .config && cd .config/ -echo -n "cd " -pwd -ln -sfv $userhome/.config/gtk-3.0 . -EOF