diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2015-10-04 15:08:06 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2015-10-04 15:08:06 -0400 |
commit | 9685060a9222ae5bdc242c6366f4a074e5ad8589 (patch) | |
tree | 4fde5c1088d69d177852e9964acb38d546144a17 /.config | |
parent | 4b151e74462b93b68ebbf90502de86b84917bd7c (diff) | |
parent | 795875623f9a9cd35374d2f0531182a267e81588 (diff) |
Merge branch 'master' into build64-par/master
# Conflicts:
# .config/emacs/init.el
Diffstat (limited to '.config')
27 files changed, 451 insertions, 186 deletions
diff --git a/.config/Makefile b/.config/Makefile index 9ee3115..002a933 100644 --- a/.config/Makefile +++ b/.config/Makefile @@ -10,9 +10,10 @@ GIT_DIR = ${HOME}/.git targets = \ ${GIT_DIR}/info/exclude \ - ${HOME}/.folders \ ${XDG_CACHE_HOME}/config-symlinks/cookie \ - ${XDG_CACHE_HOME}/cron/cookie + $(if $(shell crontab -l),${XDG_CACHE_HOME}/cron/cookie) \ + $(if $(wildcard ${HOME}/Maildir),${HOME}/.folders) \ + $(if $(wildcard ${XDG_CONFIG_HOME}/dconf/user),${XDG_CONFIG_HOME}/dconf/user.txt) all: $(targets) clean: @@ -24,6 +25,9 @@ ${HOME}/.folders: ${HOME}/Maildir $(MAKEFILE_LIST) ${GIT_DIR}/info/exclude: ${HOME}/.git.info.exclude.in $(shell echo .??*/) ( cat $<; find $^ -type f -name 'CACHEDIR.TAG' -printf '%h\n'|sed 's@^\./@/@' ) > $@ +${XDG_CONFIG_HOME}/dconf/user.txt: ${XDG_CONFIG_HOME}/dconf/user + dconf dump / > $@ + ${XDG_CACHE_HOME}/cron/cookie: ${XDG_CONFIG_HOME}/cron -(cat $^/*; echo) | crontab - 2>/dev/null mkdir -p '$(@D)' @@ -34,8 +38,6 @@ ${XDG_CACHE_HOME}/config-symlinks/cookie: ${XDG_CONFIG_HOME}/symlinks mkdir -p '$(@D)' date > '$@' -${HOME}/Maildir: - mkdir -p '$@'/{cur,new,tmp} ${HOME}/Maildir/%: | ${HOME}/Maildir mkdir -p '$@'/{cur,new,tmp} touch '$@'/maildirfolder diff --git a/.config/X11/clientrc b/.config/X11/clientrc index ac0d5a8..bc68ed6 100644 --- a/.config/X11/clientrc +++ b/.config/X11/clientrc @@ -17,7 +17,10 @@ if [ -f "$usermodmap" ]; then xmodmap "$usermodmap" fi -[ -n "$XDG_RUNTIME_DIR" ] || exit 1 +if [ -z "$XDG_RUNTIME_DIR" ]; then + printf "XDG_RUNTIME_DIR isn't set\n" >&2 + exit 6 +fi _DISPLAY="$(systemd-escape -- "$DISPLAY")" trap "rm -f $(printf '%q' "${XDG_RUNTIME_DIR}/x11-wm@${_DISPLAY}")" EXIT mkfifo "${XDG_RUNTIME_DIR}/x11-wm@${_DISPLAY}" diff --git a/.config/bash/rc.d/01_unset_prompt_command.sh b/.config/bash/rc.d/01_unset_prompt_command.sh new file mode 100644 index 0000000..165fdbc --- /dev/null +++ b/.config/bash/rc.d/01_unset_prompt_command.sh @@ -0,0 +1,3 @@ +#!/hint/bash + +PROMPT_COMMAND='' diff --git a/.config/bash/rc.d/aliases.sh b/.config/bash/rc.d/10_aliases.sh index cd2cfd8..758c069 100644 --- a/.config/bash/rc.d/aliases.sh +++ b/.config/bash/rc.d/10_aliases.sh @@ -1,7 +1,7 @@ #!/hint/bash ###################################################################### -# Set up colors and settings for ls/dir/vdir # +# Set up colors and settings for all the things # ###################################################################### if [ -x "`which dircolors`" ]; then eval "$(dircolors -p | cat - "${XDG_CONFIG_HOME}/dir_colors" | @@ -12,12 +12,40 @@ if [ -x "`which dircolors`" ]; then for xgrep in ${PATH//:/\/*grep }/*grep; do if [ -f "$xgrep" ]; then - xgrep=`basename "$xgrep"` + xgrep=$(basename "$xgrep") if [ "$xgrep" != pgrep ]; then alias $xgrep="$xgrep --color=auto" fi fi done + unset xgrep + + wdiff() { + if [[ -t 1 ]]; then + local red="$(tput setaf 1)" + local blue="$(tput setaf 4)" + local bold="$(tput bold)" + local reset="$(tput sgr0)" + command wdiff \ + -w "$bold$red[-" \ + -x "-]$reset" \ + -y "$bold$blue{+" \ + -z "+}$reset" "$@" + else + command wdiff "$@" + fi + } + + diff() { + if [[ -t 1 ]]; then + ( + set -o pipefail + command diff "$@" | colordiff + ) + else + command diff "$@" + fi + } else alias ls='ls -1v' alias dir='dir -v' @@ -35,17 +63,23 @@ alias l='ls -CF' # Some preferences for miscellaneous stuff # ###################################################################### #alias rm='gvfs-trash' -#alias sed='sed --follow-symlinks' # breaks sed 4.2.2 +#alias sed='sed --follow-symlinks' # breaks operating on stdio in GNU sed 4.2.2 alias tree='tree --charset utf8' alias cd=pushd alias gitk='gitk --all --date-order' alias userctl='systemctl --user' ###################################################################### -# Some almost-function aliases # +# These are actually functions :P # ###################################################################### -alias lock="clear; away -C 'This terminal is locked'" -alias plock="term-title Terminal Locked;lock" +term-title() { + local fmt='' + case "$TERM" in + screen|tmux) fmt='\ek%s\e\\';; + xterm*|rxvt*) fmt='\e]0;%s\a';; + esac + printf "$fmt" "$*" +} mvln() { if [[ ! -L "$1" ]]; then libremessages error 'Not a soft link: %s' "$1" @@ -58,6 +92,20 @@ mvln() { libremessages error 'Failed moving link: %s -> %s' "$1" "$2" fi } -jarls() { jar tf "$1" | sed -n 's/\.class$//p' | LC_ALL=C sort | xargs -r -d $'\n' javap -classpath "$1"; } -tarls() { local file; for file in "$@"; do bsdtar tf "$file" | sed "s|^|$file:|"; done; } -jarmain() { jarls "$1" 2>/dev/null | grep -E '(^[a-z]|public static void main\(java\.lang\.String\[\]\))' | grep -B1 '^ '; } +jarls() { + jar tf "$1" | + sed -n 's/\.class$//p' | + LC_ALL=C sort | + xargs -r -d $'\n' javap -classpath "$1" +} +tarls() { + local file + for file in "$@"; do + bsdtar tf "$file" | sed "s|^|$file:|" + done +} +jarmain() { + jarls "$1" 2>/dev/null | + grep -E '(^[a-z]|public static void main\(java\.lang\.String\[\]\))' | + grep -B1 '^ ' +} diff --git a/.config/bash/rc.d/10_hist.sh b/.config/bash/rc.d/10_hist.sh new file mode 100644 index 0000000..d7c6bfc --- /dev/null +++ b/.config/bash/rc.d/10_hist.sh @@ -0,0 +1,9 @@ +#!/hint/bash + +# don't overwrite GNU Midnight Commander's setting of `ignorespace'. +HISTCONTROL=$HISTCONTROL${HISTCONTROL+,}ignoredups +HISTFILE=${XDG_CACHE_HOME}/bash/history +HISTTIMEFORMAT='[%Y-%m-%d %H:%M] ' +HISTSIZE=5000 +shopt -s histappend # append to the history file, don't overwrite it +mkdir -p "${HISTFILE%/*}" diff --git a/.config/bash/rc.d/10_misc.sh b/.config/bash/rc.d/10_misc.sh new file mode 100644 index 0000000..afcf6fd --- /dev/null +++ b/.config/bash/rc.d/10_misc.sh @@ -0,0 +1,10 @@ +#!/hint/bash + +# General settings +shopt -s checkwinsize # update the values of LINES and COLUMNS +shopt -s globstar # Let ** recursively scan directories + +# Why is this not on by default? +# "We have a cached value, but it isn't valid anymore. Should we trash it?" +# "Duh, yes!" +shopt -s checkhash diff --git a/.config/bash/rc.d/90_emacs.sh b/.config/bash/rc.d/90_emacs.sh new file mode 100644 index 0000000..79d5e61 --- /dev/null +++ b/.config/bash/rc.d/90_emacs.sh @@ -0,0 +1,67 @@ +#!/hint/bash + +if [[ $TERM == eterm* ]]; then + ## Primatives for interacting with Emacs ############################### + + # _emacs_run LISP + _emacs_run() { + emacsclient -a false -e "$*" 2>/dev/null + } + # _emacs_quote UNQUOTED_STRING + _emacs_quote() { + local str="$*" + str="${str//\\/\\\\}" # \ -> \\ + str="${str//\"/\\\"}" # " -> \" + str="\"${str}\"" # wrap it in quotes + printf '%s' "$str" + } + # _emacs_unquote QUOTED_STRING + _emacs_unquote() { + local str="$*" + if [[ $str =~ ^\"(.*)\"$ ]]; then + str=${BASH_REMATCH[1]} # un-quote it + str="${str//\\\\/\\}" # \\ -> \ + str="${str//\\\"/\"}" # \" -> " + fi + printf '%s' "$str" + } + + ## High-level tasks #################################################### + + # Set the TRAMP directory for remote hosts (shell -> emacs) + _emacs_set_remote_dir() { + # Because (term-handle-ansi-terminal-messages) is run + # after each item is set, the user should be set + # before the hostname is set, otherwise it will set + # (default-directory) to an invalid TRAMP string. + # + # Because the hostname is compared to (system-name) to + # check if it is localhost, "$(hostname -f)" may need + # to be used instead of $HOSTNAME, if + # $HOSTNAME/$(hostname) doesn't return a qualified + # domain. + local hostname=$HOSTNAME + [[ $hostname = *.* ]] || hostname="$(hostname -f)" + printf '\eAnSiT%s %s\n' \ + u "$USER" \ + c "$PWD" \ + h "$hostname" + } + # Set the shell's X11 display (emacs -> shell) + _emacs_set_shell_DISPLAY() { + export DISPLAY=$(_emacs_unquote "$(_emacs_run "(cdr (assoc 'display (frame-parameters)))")") + [[ $DISPLAY != nil ]] || unset DISPLAY + } + + ## Install the hooks ################################################### + + export SELECTED_EDITOR='emacsclient' + export EDITOR=$SELECTED_EDITOR + export VISUAL=$SELECTED_EDITOR + export PAGER=cat + if _emacs_run '()' >/dev/null; then + PROMPT_COMMAND+='_emacs_set_shell_DISPLAY;' + fi + # Remember, the $() strips the trailing newline, so add it back in + PS1_EXTRA+='\[$(_emacs_set_remote_dir)'$'\n\\]' +fi diff --git a/.config/bash/rc.d/90_term_title.sh b/.config/bash/rc.d/90_term_title.sh new file mode 100644 index 0000000..d39d8b0 --- /dev/null +++ b/.config/bash/rc.d/90_term_title.sh @@ -0,0 +1,3 @@ +#!/hint/bash + +PS1_EXTRA+="\\[$(term-title '\u@\h:\w')\\]" diff --git a/.config/bash/rc.d/99_ps1.sh b/.config/bash/rc.d/99_ps1.sh new file mode 100644 index 0000000..450e118 --- /dev/null +++ b/.config/bash/rc.d/99_ps1.sh @@ -0,0 +1,20 @@ +#!/hint/bash + +if tput setaf 1 &>/dev/null; then + # We have color support; assume it's compliant with Ecma-48 + # (ISO/IEC-6429). (Lack of such support is extremely rare, and such + # a case would tend to support setf rather than setaf.) + RESET="\\[$(tput sgr0)\\]" + BOLD="\\[$(tput bold)\\]" + RED="\\[$(tput setaf 1)\\]" + GREEN="\\[$(tput setaf 2)\\]" + BLUE="\\[$(tput setaf 4)\\]" + + STATUS="${BOLD}[" + STATUS+="\$(v=\$?; [[ \$v = 0 ]] && c='${GREEN}' || c='${RED}'; printf %s%03i \$c \$v)" + STATUS+="${RESET}${BOLD}]${RESET}" +else + STATUS='[$(printf "%03i" $?)]' +fi +PS1="${STATUS} ${BOLD}${GREEN}\u@\h${BLUE}:\w${RESET}${PS1_EXTRA}\\n\\$ " +unset RESET BOLD RED GREEN BLUE STATUS PS1_EXTRA diff --git a/.config/bash/rc.d/emacs.sh b/.config/bash/rc.d/emacs.sh deleted file mode 100644 index d8e1d80..0000000 --- a/.config/bash/rc.d/emacs.sh +++ /dev/null @@ -1,102 +0,0 @@ -#!/hint/bash - -if [[ $TERM == eterm* ]]; then - SELECTED_EDITOR='emacsclient' - EDITOR=$SELECTED_EDITOR - VISUAL=$SELECTED_EDITOR - export SELECTED_EDITOR EDITOR VISUAL - export PAGER=cat - - ## Primatives for interacting with Emacs ############################### - - # _emacs_run LISP - _emacs_run() { - emacsclient -a false -e "$*" 2>/dev/null - } - # _emacs_quote UNQUOTED_STRING - _emacs_quote() { - local str="$*" - str="${str//\\/\\\\}" # \ -> \\ - str="${str//\"/\\\"}" # " -> \" - str="\"${str}\"" # wrap it in quotes - printf '%s' "$str" - } - # _emacs_unquote QUOTED_STRING - _emacs_unquote() { - - local str="$*" - if [[ $str =~ ^\"(.*)\"$ ]]; then - str=${BASH_REMATCH[1]} # un-quote it - str="${str//\\\\/\\}" # \\ -> \ - str="${str//\\\"/\"}" # \" -> " - fi - printf '%s' "$str" - } - - ## Deal with renaming the terminal ##################################### - - # _emacs_rename_terminal NEW_BUFFER_NAME - # This function uses the variable _EMACS_BUFFER to store some state - _emacs_rename_terminal() { - local name=$(_emacs_quote "$*") - if [[ -n $_EMACS_BUFFER ]]; then - local buffer="(get-buffer $_EMACS_BUFFER)" - else - local buffer='(window-buffer (selected-window))' - fi - _EMACS_BUFFER=$(_emacs_run "(with-current-buffer ${buffer} (rename-buffer ${name} t))") - } - # _emacs_get_short_cwd - _emacs_get_short_cwd() { - local base=$PWD - local suffix='' - # The regex here is a list of directory names - # that aren't really helpful, and that the - # parent directory should be included also. - if [[ $base =~ (/(src|pkg|doc|pkg-libre|src-libre|trunk|tags|branches))*$ ]]; then - suffix=$BASH_REMATCH - base=${base%$suffix} - fi - base=${base##*/} - echo ${base}${suffix} - } - # _emacs_get_desired_buffer_name - _emacs_get_desired_buffer_name() { - echo "*ansi-term*<$(_emacs_get_short_cwd)>" - } - - ## High-level tasks #################################################### - - # Like uniquify on the buffer name (shell -> emacs) - _emacs_set_buffer_name() { - # This doesn't work correctly on remote hosts. - # The "correct" solution is probably to hook into - # default-directory being set in term.el - _emacs_rename_terminal "$(_emacs_get_desired_buffer_name)" - } - # Set the TRAMP directory for remote hosts (shell -> emacs) - _emacs_set_remote_dir() { - if [[ -n $SSH_CONNECTION ]]; then - printf '\eAnSiT%s %s\n' \ - u "$USER" \ - c "$PWD" \ - h "$HOSTNAME" - fi - } - # Set the shell's X11 display (emacs -> shell) - _emacs_set_shell_DISPLAY() { - export DISPLAY=$(_emacs_unquote "$(_emacs_run "(cdr (assoc 'display (frame-parameters)))")") - [[ $DISPLAY != nil ]] || unset DISPLAY - } - - ## Do those things ##################################################### - - _emacs_PROMPT_COMMAND() { - _emacs_set_buffer_name - _emacs_set_remote_dir - _emacs_set_shell_DISPLAY - } - if _emacs_run '()' >/dev/null; then - PROMPT_COMMAND=_emacs_PROMPT_COMMAND - fi -fi diff --git a/.config/bash/rc.sh b/.config/bash/rc.sh index 70f1ce4..8512d84 100644 --- a/.config/bash/rc.sh +++ b/.config/bash/rc.sh @@ -5,74 +5,13 @@ # they are login shells or not. # If not running interactively, don't do anything -[[ $- != *i* ]] && return +# This line is probably not nescessary, but whatevs. +[[ $- == *i* ]] || return # GDM failsafe ignores profile (login) settings, but I use XDG stuff # here. . "${XDG_CONFIG_HOME:-$HOME/.config}"/login.d/??_xdg.sh -# Why is this not on by default? -# "We have a cached value, but it isn't valid anymore. Should we trash it?" -# "Duh, yes!" -shopt -s checkhash - -################################################################################ - -# History settings -# don't overwrite GNU Midnight Commander's setting of `ignorespace'. -HISTCONTROL=$HISTCONTROL${HISTCONTROL+,}ignoredups -HISTFILE=${XDG_CACHE_HOME}/bash/history -HISTTIMEFORMAT='[%Y-%m-%d %H:%M] ' -HISTSIZE=5000 -shopt -s histappend # append to the history file, don't overwrite it -mkdir -p "${HISTFILE%/*}" - -# General settings -shopt -s checkwinsize # update the values of LINES and COLUMNS -shopt -s globstar # Let ** recursively scan directories - -################################################################################ -# Overly complicated setting of PS1 # -################################################################################ - -# Belongs in aliases, but I use it here -term-title() { - local fmt='' - case "$TERM" in - screen|tmux) fmt='\ek%s\e\\';; - xterm*|rxvt*) fmt='\e]0;%s\a';; - esac - printf "$fmt" "$*" -} -PROMPT_COMMAND='' - -make_prompt() { - echo "${BOLD}${GREEN}\u@\h${BLUE}:\w${RESET}" -} - -if tput setaf 1 &>/dev/null; then - # We have color support; assume it's compliant with Ecma-48 - # (ISO/IEC-6429). (Lack of such support is extremely rare, and such - # a case would tend to support setf rather than setaf.) - RESET="$(tput sgr0)" - BOLD="$(tput bold)" - RED="$(tput setaf 1)" - GREEN="$(tput setaf 2)" - BLUE="$(tput setaf 4)" - - _STATUS="${BOLD}[" - _STATUS+="\$(v=\$?; [[ \$v = 0 ]] && c='${GREEN}' || c='${RED}'; printf %s%03i \$c \$v)" - _STATUS+="${RESET}${BOLD}]${RESET}" -else - _STATUS='[$(printf "%03i" $?)]' -fi -PS1="${_STATUS} $(make_prompt)"'\n\$ ' -unset RESET BOLD RED GREEN BLUE _STATUS -PS1="$(term-title $(make_prompt))$PS1" -unset make_prompt - -################################################################################ - # Include modular config files if [[ -d ${XDG_CONFIG_HOME}/bash/rc.d ]]; then for file in "${XDG_CONFIG_HOME}/bash/rc.d"/*.sh; do diff --git a/.config/dconf/user.txt b/.config/dconf/user.txt new file mode 100644 index 0000000..48a55eb --- /dev/null +++ b/.config/dconf/user.txt @@ -0,0 +1,200 @@ +[org/mate/terminal/profiles/default] +background-color='#FFFFFFFFDDDD' +login-shell=true +palette='#2E2E34343636:#CCCC00000000:#4E4E9A9A0606:#C4C4A0A00000:#34346565A4A4:#757550507B7B:#060698209A9A:#D3D3D7D7CFCF:#555557575353:#EFEF29292929:#8A8AE2E23434:#FCFCE9E94F4F:#72729F9FCFCF:#ADAD7F7FA8A8:#3434E2E2E2E2:#EEEEEEEEECEC' +bold-color='#000000000000' +foreground-color='#000000000000' +visible-name='Default' + +[org/mate/eom/ui] +image-collection=false +sidebar=false + +[org/mate/engrampa/listing] +sort-method='name' +name-column-width=250 +sort-type='ascending' +list-mode='as-folder' +show-path=false + +[org/mate/engrampa/ui] +sidebar-width=200 +window-height=480 +window-width=600 + +[org/mate/volume-control] +window-height=886 +window-width=1706 + +[org/mate/screenshot] +include-pointer=true +include-border=true +border-effect='none' +delay=0 + +[org/mate/desktop/peripherals/keyboard] +numlock-state='off' + +[org/mate/desktop/accessibility/keyboard] +slowkeys-beep-press=true +mousekeys-accel-time=1200 +bouncekeys-beep-reject=true +slowkeys-beep-reject=false +togglekeys-enable=false +enable=false +bouncekeys-enable=false +stickykeys-enable=false +feature-state-change-beep=false +slowkeys-beep-accept=true +bouncekeys-delay=300 +mousekeys-max-speed=750 +mousekeys-enable=false +timeout-enable=false +slowkeys-delay=300 +stickykeys-modifier-beep=true +stickykeys-two-key-off=true +mousekeys-init-delay=160 +timeout=120 +slowkeys-enable=false + +[org/mate/desktop/background] +color-shading-type='solid' +primary-color='#a1a184845c5c' +picture-options='wallpaper' +picture-filename='' +secondary-color='#3c3c8f8f2525' + +[org/mate/desktop/font-rendering] +antialiasing='grayscale' +dpi=95.0 +hinting='full' + +[org/mate/desktop/session] +session-start=1443192888 + +[org/mate/pluma/plugins/filebrowser/on-load] +virtual-root='file:///tmp' +tree-view=true +root='file:///' + +[org/mate/pluma] +statusbar-visible=true + +[org/mate/marco/general] +mouse-button-modifier='<Super>' +side-by-side-tiling=true +focus-mode='click' +theme='Purdue' + +[org/mate/panel/general] +show-program-list=true +toplevel-id-list=['top', 'bottom'] +history-mate-run=['/homes/shumakl/.prefix.x86_64/bin/urxvt', '/bin/bash --noprofile --norc', 'mate-terminal /bin/sh', 'vncviewer', 'gimp', 'emacs', 'killall emacs', 'urxvt', 'mate-terminal bash --noprofile --norc', 'mate-terminal'] +object-id-list=['menu-bar', 'separator', 'terminal', 'web-browser', 'notification-area', 'clock', 'window-menu', 'show-desktop', 'window-list', 'workspace-switcher', 'object_0'] + +[org/mate/panel/toplevels/bottom] +expand=true +orientation='bottom' +screen=0 +y-bottom=0 +size=24 +y=1055 + +[org/mate/panel/toplevels/top] +expand=true +orientation='top' +screen=0 +size=24 + +[org/mate/panel/objects/workspace-switcher] +applet-iid='WnckletFactory::WorkspaceSwitcherApplet' +locked=true +toplevel-id='bottom' +position=0 +object-type='applet' +panel-right-stick=true + +[org/mate/panel/objects/clock] +applet-iid='ClockAppletFactory::ClockApplet' +locked=true +toplevel-id='top' +position=5 +object-type='applet' +panel-right-stick=true + +[org/mate/panel/objects/clock/prefs] +format='12-hour' +custom-format='' + +[org/mate/panel/objects/object_0] +launcher-location='v-editor.desktop' +toplevel-id='top' +position=296 +object-type='launcher' +panel-right-stick=false + +[org/mate/panel/objects/separator] +locked=true +toplevel-id='top' +position=5 +object-type='separator' + +[org/mate/panel/objects/menu-bar] +locked=true +toplevel-id='top' +position=0 +object-type='menu-bar' + +[org/mate/panel/objects/window-menu] +applet-iid='WnckletFactory::WindowMenuApplet' +locked=true +toplevel-id='top' +position=0 +object-type='applet' +panel-right-stick=true + +[org/mate/panel/objects/window-list] +applet-iid='WnckletFactory::WindowListApplet' +locked=true +toplevel-id='bottom' +position=20 +object-type='applet' + +[org/mate/panel/objects/notification-area] +applet-iid='NotificationAreaAppletFactory::NotificationArea' +locked=true +toplevel-id='top' +position=10 +object-type='applet' +panel-right-stick=true + +[org/mate/panel/objects/show-desktop] +applet-iid='WnckletFactory::ShowDesktopApplet' +locked=true +toplevel-id='bottom' +position=0 +object-type='applet' + +[org/mate/panel/objects/web-browser] +locked=true +launcher-location='/usr/share/applications/firefox.desktop' +toplevel-id='top' +position=10 +object-type='launcher' + +[org/mate/panel/objects/terminal] +locked=true +launcher-location='urxvt.desktop' +toplevel-id='top' +position=10 +object-type='launcher' + +[org/mate/caja/window-state] +start-with-sidebar=true +geometry='800x550+312+123' +start-with-status-bar=true +maximized=true +start-with-toolbar=true + +[org/mate/atril/default] +window-ratio=(3.1209150326797386, 1.2676767676767677) diff --git a/.config/emacs/init.el b/.config/emacs/init.el index db347f1..38f6e77 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -151,7 +151,8 @@ "Use spaces for alignment" (let ((indent-tabs-mode nil)) (apply orig-fun args))) -(advice-add 'align-regexp :around #'align-regexp--use-spaces) +(advice-add 'align-regexp :around + #'align-regexp--use-spaces) (defun sh-smie-sh-rules--fix (args) "Replace :after \"then\" with :after \"if\" because Emacs 24 @@ -159,7 +160,34 @@ sh-script.el is broken." (if (equal args (list :after "then")) (list :after "if") args)) -(advice-add 'sh-smie-sh-rules :filter-args #'sh-smie-sh-rules--fix) +(advice-add 'sh-smie-sh-rules :filter-args + #'sh-smie-sh-rules--fix) + +;; Ideally, figuring this out should be done by uniquify, but I +;; haven't determined how to get uniquify to think that it manages the +;; term buffer. +(defun term-get-short-cwd () + ;; local base=$PWD + ;; local suffix='' + ;; # The regex here is a list of directory names + ;; # that aren't really helpful, and that the + ;; # parent directory should be included also. + ;; if [[ $base =~ (/(src|pkg|doc|pkg-libre|src-libre|trunk|tags|branches))*$ ]]; then + ;; suffix=$BASH_REMATCH + ;; base=${base%$suffix} + ;; fi + ;; base=${base##*/} + ;; echo ${base}${suffix} + (directory-file-name default-directory)) +(defun term-handle-ansi-terminal-messages--uniquify (args) + (rename-buffer (concat + (replace-regexp-in-string "<.*>$" "" (buffer-name)) + "<" + (term-get-short-cwd) + ">") + t)) +(advice-add 'term-handle-ansi-terminal-messages :after + #'term-handle-ansi-terminal-messages--uniquify) diff --git a/.config/login.d/02_xdg_runtime_dir.sh b/.config/login.d/02_xdg_runtime_dir.sh index 864eadd..6db58af 100644 --- a/.config/login.d/02_xdg_runtime_dir.sh +++ b/.config/login.d/02_xdg_runtime_dir.sh @@ -1,7 +1,7 @@ #!/hint/sh # Set XDG_RUNTIME_DIR if we can -if [ -z "$XDG_RUNTIME_DIR" ] && shopt -q login_shell && type flock &>/dev/null; then +if [ -z "$XDG_RUNTIME_DIR" ] && type flock &>/dev/null; then _diy_xdg_runtime_login() { export XDG_RUNTIME_DIR="$XDG_CACHE_HOME/xdg-runtime-dir/$HOSTNAME" if ! [ /dev/fd/7 -ef "$XDG_CACHE_HOME/xdg-runtime-dir/.lock" ]; then diff --git a/.config/login.d/90_dot-runtime.sh b/.config/login.d/90_dot-runtime.sh index d06568f..cb0b7f2 100644 --- a/.config/login.d/90_dot-runtime.sh +++ b/.config/login.d/90_dot-runtime.sh @@ -1,4 +1,8 @@ # This is really only needed for ssh ControlPath; as I don't have a # way to communicate XDG_RUNTIME_DIR to it otherwise. mkdir -p -- ~/.runtime -ln -sfT -- "$XDG_RUNTIME_DIR" ~/.runtime/"$HOSTNAME" +if [ -n "$XDG_RUNTIME_DIR" ]; then + ln -sfT -- "$XDG_RUNTIME_DIR" ~/.runtime/"$HOSTNAME" +else + ln -sfT -- /tmp ~/.runtime/"$HOSTNAME" +fi diff --git a/.config/ssh/config b/.config/ssh/config index dc32703..f651513 100644 --- a/.config/ssh/config +++ b/.config/ssh/config @@ -24,7 +24,7 @@ Host lukeshu.com Port 1863 User lukeshu -Match host build64-par exec "host %n.lan." +Match host build64-par exec "nslookup %n.lan." HostName build64-par Port 22 ForwardX11 yes diff --git a/.config/systemd/user/emacs-daemon.service b/.config/systemd/user/emacs-daemon.service index 279d83a..4077e97 100644 --- a/.config/systemd/user/emacs-daemon.service +++ b/.config/systemd/user/emacs-daemon.service @@ -4,7 +4,7 @@ Description=Emacs deamon [Service] Type=forking ExecStart=/bin/bash -l -c 'emacs --daemon' -ExecStop=/bin/bash -l -c 'emacsclient -e "(kill-emacs)"' +ExecStop=/bin/bash -l -c 'emacsclient -a false -e "(kill-emacs)"' [Install] WantedBy=default.target diff --git a/.config/systemd/user/lxpanel@.service b/.config/systemd/user/lxpanel@.service index 71e2114..ecded87 100644 --- a/.config/systemd/user/lxpanel@.service +++ b/.config/systemd/user/lxpanel@.service @@ -3,9 +3,13 @@ Description=LXDE Desktop Panel on X display %I Documentation=man:lxpanel(1) StopWhenUnneeded=true After=wm@%i.target +Before=panel@%i.target [Service] Type=simple Environment=DISPLAY=%I ExecStart=/usr/bin/lxpanel Restart=always + +[Install] +RequiredBy=panel@%i.target diff --git a/.config/systemd/user/panel@.target b/.config/systemd/user/panel@.target new file mode 100644 index 0000000..ed3dffd --- /dev/null +++ b/.config/systemd/user/panel@.target @@ -0,0 +1,3 @@ +[Unit] +Description=Desktop Panel (System Tray) on display %I +StopWhenUnneeded=true diff --git a/.config/systemd/user/panel@.target.requires/lxpanel@.service b/.config/systemd/user/panel@.target.requires/lxpanel@.service new file mode 120000 index 0000000..06ed03f --- /dev/null +++ b/.config/systemd/user/panel@.target.requires/lxpanel@.service @@ -0,0 +1 @@ +../lxpanel@.service
\ No newline at end of file diff --git a/.config/systemd/user/synergy@.service b/.config/systemd/user/synergy@.service new file mode 100644 index 0000000..df0640a --- /dev/null +++ b/.config/systemd/user/synergy@.service @@ -0,0 +1,10 @@ +[Unit] +Description=Keyboard and mouse sharing on X display %I +StopWhenUnneeded=true +Requires=panel@%i.target + +[Service] +Type=simple +Environment=DISPLAY=%I +ExecStart=/usr/bin/synergy +Restart=always diff --git a/.config/systemd/user/wm@.target b/.config/systemd/user/wm@.target index ac91fa1..c114bf5 100644 --- a/.config/systemd/user/wm@.target +++ b/.config/systemd/user/wm@.target @@ -1,3 +1,2 @@ [Unit] Description=Window Manager on display %I -Requires=wmii@%i.service diff --git a/.config/systemd/user/wm@.target.requires/wmii@.service b/.config/systemd/user/wm@.target.requires/wmii@.service new file mode 120000 index 0000000..1b202d2 --- /dev/null +++ b/.config/systemd/user/wm@.target.requires/wmii@.service @@ -0,0 +1 @@ +../wmii@.service
\ No newline at end of file diff --git a/.config/systemd/user/wmii@.service b/.config/systemd/user/wmii@.service index 0442fca..4a81e3f 100644 --- a/.config/systemd/user/wmii@.service +++ b/.config/systemd/user/wmii@.service @@ -12,3 +12,6 @@ NotifyAccess=all Environment=DISPLAY=%I ExecStart=/usr/bin/bash -l -c 'exec 8>${XDG_RUNTIME_DIR}/x11-wm@%I; exec /usr/bin/wmii' ExecStop=/usr/bin/wmiir xwrite /ctl Quit + +[Install] +RequiredBy=wm@%i.service diff --git a/.config/systemd/user/wmii@.service.wants/dunst@.service b/.config/systemd/user/wmii@.service.wants/dunst@.service new file mode 120000 index 0000000..7635e45 --- /dev/null +++ b/.config/systemd/user/wmii@.service.wants/dunst@.service @@ -0,0 +1 @@ +../dunst@.service
\ No newline at end of file diff --git a/.config/wmii-hg/include.sh b/.config/wmii-hg/include.sh index 4e86276..f8c4e0d 100644 --- a/.config/wmii-hg/include.sh +++ b/.config/wmii-hg/include.sh @@ -1,4 +1,8 @@ #!/hint/bash +if [[ -z "$XDG_RUNTIME_DIR" ]]; then + printf "XDG_RUNTIME_DIR isn't set\n" >&2 + exit 6 +fi if [[ -z "$WMII_NAMESPACE" ]]; then export WMII_NAMESPACE="$(wmiir namespace)" diff --git a/.config/wmii-hg/rbar.sh b/.config/wmii-hg/rbar.sh index 0c9efa6..287f427 100644 --- a/.config/wmii-hg/rbar.sh +++ b/.config/wmii-hg/rbar.sh @@ -1,4 +1,9 @@ #!/hint/bash +if [[ -z "$XDG_RUNTIME_DIR" ]]; then + printf "XDG_RUNTIME_DIR isn't set\n" >&2 + exit 6 +fi + setup_trap() { trap "rm -f -- \"\${XDG_RUNTIME_DIR}\"/n/wmii*/rbar/${1}" EXIT } |