From 5ab72cd4fe62ac88117ebd521ffb8cfde4485645 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 14 Aug 2013 14:52:45 -0400 Subject: move a bunch of things into XDG directories --- .config/Makefile | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .config/Makefile (limited to '.config/Makefile') diff --git a/.config/Makefile b/.config/Makefile new file mode 100644 index 0000000..391e43c --- /dev/null +++ b/.config/Makefile @@ -0,0 +1,28 @@ +SHELL = /bin/bash + +GITDIR=${HOME}/.git + +targets=${HOME}/.folders ${XDG_CACHE_HOME}/cron/cookie ${GITDIR}/info/exclude +all: $(targets) +clean: + rm -f $(targets) + +${HOME}/.folders: ${HOME}/Maildir + ( echo '..'; find $< -maxdepth 2 -type f -name "maildirfolder" -printf '%h\n'|sed -r 's@.*/(.*\.)(.*)@.\1\2@' )|sort>'$@' +${GITDIR}/info/exclude: .git.info.exclude.in $(shell echo .??*/) + ( cat $<; find $^ -type f -name 'CACHEDIR.TAG' -printf '%h\n'|sed 's@^\./@/@' ) > $@ + +${XDG_CACHE_HOME}/cron/cookie: ${XDG_CONFIG_HOME}/cron + -(cat $^/*; echo) | crontab - 2>/dev/null + mkdir -p '$(@D)' + date > '$@' + +${HOME}/Maildir: + mkdir -p '$@'/{cur,new,tmp} +${HOME}/Maildir/%: | ${HOME}/Maildir + mkdir -p '$@'/{cur,new,tmp} + touch '$@'/maildirfolder + +.PHONY: FORCE PHONY +FORCE: ; +PHONY: ; -- cgit v1.2.3-54-g00ecf From b5f8ee46f0b8a97ddbe8b21e1605bfe2b41c0cb5 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 14 Aug 2013 15:07:04 -0400 Subject: re-jigger to have most everything in XDG directories --- .config/Makefile | 18 +++++++-- .config/login.local.sh | 11 +++++ .config/login.sh | 106 +++++++++++++++++++++++++++++++++++++++++++++++++ .config/symlinks | 3 ++ .git.info.exclude.in | 65 +++++------------------------- .profile | 105 ------------------------------------------------ .profile.local | 11 ----- 7 files changed, 144 insertions(+), 175 deletions(-) create mode 100644 .config/login.local.sh create mode 100644 .config/login.sh delete mode 100644 .profile delete mode 100644 .profile.local (limited to '.config/Makefile') diff --git a/.config/Makefile b/.config/Makefile index 391e43c..829b820 100644 --- a/.config/Makefile +++ b/.config/Makefile @@ -1,15 +1,22 @@ +#!/usr/bin/make -f + SHELL = /bin/bash -GITDIR=${HOME}/.git +GITDIR = ${HOME}/.git + +targets = \ + ${GITDIR}/info/exclude \ + ${HOME}/.folders \ + ${XDG_CACHE_HOME}/config-symlinks/cookie \ + ${XDG_CACHE_HOME}/cron/cookie -targets=${HOME}/.folders ${XDG_CACHE_HOME}/cron/cookie ${GITDIR}/info/exclude all: $(targets) clean: rm -f $(targets) ${HOME}/.folders: ${HOME}/Maildir ( echo '..'; find $< -maxdepth 2 -type f -name "maildirfolder" -printf '%h\n'|sed -r 's@.*/(.*\.)(.*)@.\1\2@' )|sort>'$@' -${GITDIR}/info/exclude: .git.info.exclude.in $(shell echo .??*/) +${GITDIR}/info/exclude: ${HOME}/.git.info.exclude.in $(shell echo .??*/) ( cat $<; find $^ -type f -name 'CACHEDIR.TAG' -printf '%h\n'|sed 's@^\./@/@' ) > $@ ${XDG_CACHE_HOME}/cron/cookie: ${XDG_CONFIG_HOME}/cron @@ -17,6 +24,11 @@ ${XDG_CACHE_HOME}/cron/cookie: ${XDG_CONFIG_HOME}/cron mkdir -p '$(@D)' date > '$@' +${XDG_CACHE_HOME}/config-symlinks/cookie: ${XDG_CONFIG_HOME}/symlinks + config-symlinks + mkdir -p '$(@D)' + date > '$@' + ${HOME}/Maildir: mkdir -p '$@'/{cur,new,tmp} ${HOME}/Maildir/%: | ${HOME}/Maildir diff --git a/.config/login.local.sh b/.config/login.local.sh new file mode 100644 index 0000000..25b322b --- /dev/null +++ b/.config/login.local.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +# Start background programs ########################################## +if [ -x "`which daemon`" ]; then + daemon -i maildirproc.att maildirproc + daemon -i maildirproc.purdue maildirproc -r ~/.maildirproc/purdue.rc + daemon batterymon 20 " + amixer sset Master unmute 100%; + espeak 'PLUG ME IN'; + sleep .2;" +fi diff --git a/.config/login.sh b/.config/login.sh new file mode 100644 index 0000000..851f4ec --- /dev/null +++ b/.config/login.sh @@ -0,0 +1,106 @@ +#!/bin/sh +# ~/.profile: executed by the command interpreter for login shells. +# Should be whether logging in graphically or not. +# +# This file should be executable by /bin/sh, but I'm going to assume bash(1) +# +# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login +# exists. + +# the default umask is set in /etc/profile; for setting the umask +# for ssh logins, install and configure the libpam-umask package. +umask 022 + +## Paths ############################################################# + +# Unix +prefixes=( + "$HOME" + "$HOME/.local.`uname -m`" + "$HOME/.local/bin" + "$HOME/.prefix.`uname -m`" + "$HOME/.prefix" + "$HOME"/.gem/ruby/* +) +for prefix in "${prefixes[@]}"; do + if [[ -d "$prefix/bin" ]]; then + export PATH="$prefix/bin:$PATH" + fi +done + +# Ruby +for dir in "$HOME"/.prefix/lib; do + if [[ -d "$dir" ]]; then + export RUBYLIB="$dir" + fi +done +unset prefixes dir prefix + +# TMPDIR ############################################################# + +if [[ ! -d "$HOME/tmp" ]]; then + tmp="$(mktemp --tmpdir -d "$USER-tmpdir.XXXXXXXXXXXXXXXXXXX")" + ln -sf "$tmp" "$HOME/tmp" + unset tmp +fi +export TMPDIR="$HOME/tmp" + +# XDG ################################################################ + +. "$HOME/.local/lib/xdg.sh" + +# Settings ########################################################### + +# Text editor +if [[ -f "$HOME/.selected_editor" ]]; then + . "$HOME/.selected_editor" + export SELECTED_EDITOR + export ALTERNATE_EDITOR + export EDITOR="${EDITOR:-$SELECTED_EDITOR}" + export VISUAL="${VISUAL:-$SELECTED_EDITOR}" +fi + +# GPG +if [[ -z $GPGKEY ]] && [[ -f "${HOME}/.gnupg/gpg.conf" ]]; then + export GPGKEY=`sed -nr 's/^\s*default-key\s+//p' "${HOME}/.gnupg/gpg.conf"` +fi +if [[ -z "$(pgrep -u `whoami` gpg-agent)" ]] && [[ -n $XDG_RUNTIME_DIR ]] && type gpg-agent &>/dev/null; then + mkdir -p "${XDG_RUNTIME_DIR}/sessions" + gpg-agent --daemon --write-env-file "${XDG_RUNTIME_DIR}/sessions/gpg" &>/dev/null +fi +if [[ -f "${XDG_RUNTIME_DIR}/sessions/gpg" ]]; then + . "${XDG_RUNTIME_DIR}/sessions/gpg" + export GPG_AGENT_INFO + #export SSH_AUTH_SOCK +fi + +# Java +_JAVA_OPTIONS='' +_JAVA_OPTIONS+=' -Dawt.useSystemAAFontSettings=on' +_JAVA_OPTIONS+=' -Dswing.aatext=true' +_JAVA_OPTIONS+=' -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel' +if [[ -n $TMPDIR ]]; then + _JAVA_OPTIONS+=" -Djava.io.tmpdir=$TMPDIR" +fi +export _JAVA_OPTIONS + +# X11 +if [[ -z $XAUTHORITY ]]; then + export XAUTHORITY=$HOME/.Xauthority +fi + +# D-Bus +if [[ -z $DBUS_SESSION_BUS_ADDRESS ]] && type dbus-launch &>/dev/null; then + # I want a separate instance for each login + #dbus-launch > "${HOME}/.cache/sessions/dbus" + #. "${HOME}/.cache/sessions/dbus" + eval `dbus-launch` + + export DBUS_SESSION_BUS_ADDRESS + export DBUS_SESSION_BUS_PID +fi + +# Load any box-specific stuff +if [[ -f "$XDG_CONFIG_HOME/login.local.sh" ]]; then + . "$XDG_CONFIG_HOME/login.local.sh" +fi diff --git a/.config/symlinks b/.config/symlinks index 01c8c4e..05d6631 100644 --- a/.config/symlinks +++ b/.config/symlinks @@ -1,5 +1,8 @@ # target link +# Generic +.config/login.sh .profile + # X11 .config/X11/defaults .Xdefaults .config/X11/clientrc .xinitrc diff --git a/.git.info.exclude.in b/.git.info.exclude.in index 0c5ce40..2d09032 100644 --- a/.git.info.exclude.in +++ b/.git.info.exclude.in @@ -1,18 +1,17 @@ # Defualt to ignoring all files /* +# except these: -# Except dotfiles -!.* +# The things I actually want to track +!/.config +!/.local* -# Or Makefile -!Makefile +# The file that generates this one +!/.git.info.exclude.in -# Ignore these for privacy -.ssh/* -!.ssh/config -.gnupg/* -!.gnupg/gpg.conf -.netrc +# The relevent programs do not like symlinks for these: +!/.gtkrc-2.0 +!/.gtkrc-2.0.mine # Ignore temp/log/history files *.log @@ -46,49 +45,3 @@ lock *~ .#* \#*# - - -# Ignore these special-purpose cache/temp files -.camel_certs -.compiz/session/* -.config/RecentDocuments/* -.dbus/session-bus/* -.ddd/sessions -.esd_auth -.evolution/.* -.gconfd/saved_state -.gnash-media -.gnash/SharedObjects/* -.lesshst -.link*/*.his -.local/share/Trash/* -.local/share/gvfs-metadata/* -.local/share/icons/* -.local/share/recently-used.xbel -.pki -.pulse -.pulse-cookie -.recently-used -.recently-used.xbel* -.setroubleshoot -.shotwell/thumbs/* -.sudo_as_admin_successful -.thumbnails/* -.wireshark/recent* -.xsession-errors* - -# Ignore files that are autogenerated -.folders -.git.info.exclude - -# Ignore these files for no good reason -.bogofilter -.gem -.gitk -.offlineimap -.prefix -.prefix.* -.wine* - -# Ignore these files that if I tracked them, would be a separate repo -.mozilla diff --git a/.profile b/.profile deleted file mode 100644 index 84103f3..0000000 --- a/.profile +++ /dev/null @@ -1,105 +0,0 @@ -# ~/.profile: executed by the command interpreter for login shells. -# Should be whether logging in graphically or not. -# -# This file should be executable by /bin/sh, but I'm going to assume bash(1) -# -# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login -# exists. - -# the default umask is set in /etc/profile; for setting the umask -# for ssh logins, install and configure the libpam-umask package. -umask 022 - -## Paths ############################################################# - -# Unix -prefixes=( - "$HOME" - "$HOME/.local.`uname -m`" - "$HOME/.local/bin" - "$HOME/.prefix.`uname -m`" - "$HOME/.prefix" - "$HOME"/.gem/ruby/* -) -for prefix in "${prefixes[@]}"; do - if [[ -d "$prefix/bin" ]]; then - export PATH="$prefix/bin:$PATH" - fi -done - -# Ruby -for dir in "$HOME"/.prefix/lib; do - if [[ -d "$dir" ]]; then - export RUBYLIB="$dir" - fi -done -unset prefixes dir prefix - -# TMPDIR ############################################################# - -if [[ ! -d "$HOME/tmp" ]]; then - tmp="$(mktemp --tmpdir -d "$USER-tmpdir.XXXXXXXXXXXXXXXXXXX")" - ln -sf "$tmp" "$HOME/tmp" - unset tmp -fi -export TMPDIR="$HOME/tmp" - -# XDG ################################################################ - -. "$HOME/.local/lib/xdg.sh" - -# Settings ########################################################### - -# Text editor -if [[ -f "$HOME/.selected_editor" ]]; then - . "$HOME/.selected_editor" - export SELECTED_EDITOR - export ALTERNATE_EDITOR - export EDITOR="${EDITOR:-$SELECTED_EDITOR}" - export VISUAL="${VISUAL:-$SELECTED_EDITOR}" -fi - -# GPG -if [[ -z $GPGKEY ]] && [[ -f "${HOME}/.gnupg/gpg.conf" ]]; then - export GPGKEY=`sed -nr 's/^\s*default-key\s+//p' "${HOME}/.gnupg/gpg.conf"` -fi -if [[ -z "$(pgrep -u `whoami` gpg-agent)" ]] && [[ -n $XDG_RUNTIME_DIR ]] && type gpg-agent &>/dev/null; then - mkdir -p "${XDG_RUNTIME_DIR}/sessions" - gpg-agent --daemon --write-env-file "${XDG_RUNTIME_DIR}/sessions/gpg" &>/dev/null -fi -if [[ -f "${XDG_RUNTIME_DIR}/sessions/gpg" ]]; then - . "${XDG_RUNTIME_DIR}/sessions/gpg" - export GPG_AGENT_INFO - #export SSH_AUTH_SOCK -fi - -# Java -_JAVA_OPTIONS='' -_JAVA_OPTIONS+=' -Dawt.useSystemAAFontSettings=on' -_JAVA_OPTIONS+=' -Dswing.aatext=true' -_JAVA_OPTIONS+=' -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel' -if [[ -n $TMPDIR ]]; then - _JAVA_OPTIONS+=" -Djava.io.tmpdir=$TMPDIR" -fi -export _JAVA_OPTIONS - -# X11 -if [[ -z $XAUTHORITY ]]; then - export XAUTHORITY=$HOME/.Xauthority -fi - -# D-Bus -if [[ -z $DBUS_SESSION_BUS_ADDRESS ]] && type dbus-launch &>/dev/null; then - # I want a separate instance for each login - #dbus-launch > "${HOME}/.cache/sessions/dbus" - #. "${HOME}/.cache/sessions/dbus" - eval `dbus-launch` - - export DBUS_SESSION_BUS_ADDRESS - export DBUS_SESSION_BUS_PID -fi - -# Load any box-specific stuff -if [[ -f "$HOME/.profile.local" ]]; then - . "$HOME/.profile.local" -fi diff --git a/.profile.local b/.profile.local deleted file mode 100644 index 25b322b..0000000 --- a/.profile.local +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -# Start background programs ########################################## -if [ -x "`which daemon`" ]; then - daemon -i maildirproc.att maildirproc - daemon -i maildirproc.purdue maildirproc -r ~/.maildirproc/purdue.rc - daemon batterymon 20 " - amixer sset Master unmute 100%; - espeak 'PLUG ME IN'; - sleep .2;" -fi -- cgit v1.2.3-54-g00ecf