From 617c9b5fb109e3f0ab387945ce9fc3d36eb07d64 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 22 Sep 2015 15:10:09 -0400 Subject: ssh: The Purdue CS boxes have a `host` that always exit(0). --- .config/ssh/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.1-4-g5e80 From ef71eedb6bcc3889128af24df3aa668dde3e2c6f Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 22 Aug 2015 03:46:53 -0400 Subject: emacs/init.el: tidy --- .config/emacs/init.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.config/emacs/init.el b/.config/emacs/init.el index e14d0f5..e635b77 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -149,7 +149,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 @@ -157,7 +158,8 @@ 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) (require 'go-mode-load nil t) -- cgit v1.1-4-g5e80 From 1ae109d7abae11a327f362bfdfb623ac0ac770e0 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 22 Aug 2015 03:51:52 -0400 Subject: Clean up bash configuration, and bash-emacs integration --- .config/bash/rc.d/01_unset_prompt_command.sh | 3 + .config/bash/rc.d/10_aliases.sh | 111 +++++++++++++++++++++++++++ .config/bash/rc.d/10_hist.sh | 9 +++ .config/bash/rc.d/10_misc.sh | 10 +++ .config/bash/rc.d/90_emacs.sh | 63 +++++++++++++++ .config/bash/rc.d/90_term_title.sh | 3 + .config/bash/rc.d/99_ps1.sh | 20 +++++ .config/bash/rc.d/aliases.sh | 63 --------------- .config/bash/rc.d/emacs.sh | 102 ------------------------ .config/bash/rc.sh | 65 +--------------- .config/emacs/init.el | 26 +++++++ 11 files changed, 247 insertions(+), 228 deletions(-) create mode 100644 .config/bash/rc.d/01_unset_prompt_command.sh create mode 100644 .config/bash/rc.d/10_aliases.sh create mode 100644 .config/bash/rc.d/10_hist.sh create mode 100644 .config/bash/rc.d/10_misc.sh create mode 100644 .config/bash/rc.d/90_emacs.sh create mode 100644 .config/bash/rc.d/90_term_title.sh create mode 100644 .config/bash/rc.d/99_ps1.sh delete mode 100644 .config/bash/rc.d/aliases.sh delete mode 100644 .config/bash/rc.d/emacs.sh 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/10_aliases.sh b/.config/bash/rc.d/10_aliases.sh new file mode 100644 index 0000000..758c069 --- /dev/null +++ b/.config/bash/rc.d/10_aliases.sh @@ -0,0 +1,111 @@ +#!/hint/bash + +###################################################################### +# Set up colors and settings for all the things # +###################################################################### +if [ -x "`which dircolors`" ]; then + eval "$(dircolors -p | cat - "${XDG_CONFIG_HOME}/dir_colors" | + dircolors -b -)" + alias ls='ls -1v --color=auto' + alias dir='dir -v --color=auto' + alias vdir='vdir -v --color=auto' + + for xgrep in ${PATH//:/\/*grep }/*grep; do + if [ -f "$xgrep" ]; then + 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' + alias vdir='vdir -v' +fi + +###################################################################### +# Set up the standard aliases for ls # +###################################################################### +alias ll='ls -l' +alias la='ls -a' +alias l='ls -CF' + +###################################################################### +# Some preferences for miscellaneous stuff # +###################################################################### +#alias rm='gvfs-trash' +#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' + +###################################################################### +# These are actually functions :P # +###################################################################### +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" + fi + target=$(readlink -f -- "$1") + ln -srT -- "$target" "$2" + if cmp -- "$1" "$2"; then + rm -f -- "$1" + else + 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 '^ ' +} 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..595ddcf --- /dev/null +++ b/.config/bash/rc.d/90_emacs.sh @@ -0,0 +1,63 @@ +#!/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)" needs to + # be used instead of $HOSTNAME, unfortunately. + printf '\eAnSiT%s %s\n' \ + u "$USER" \ + c "$PWD" \ + h "$(hostname -f)" + } + # 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/aliases.sh b/.config/bash/rc.d/aliases.sh deleted file mode 100644 index cd2cfd8..0000000 --- a/.config/bash/rc.d/aliases.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/hint/bash - -###################################################################### -# Set up colors and settings for ls/dir/vdir # -###################################################################### -if [ -x "`which dircolors`" ]; then - eval "$(dircolors -p | cat - "${XDG_CONFIG_HOME}/dir_colors" | - dircolors -b -)" - alias ls='ls -1v --color=auto' - alias dir='dir -v --color=auto' - alias vdir='vdir -v --color=auto' - - for xgrep in ${PATH//:/\/*grep }/*grep; do - if [ -f "$xgrep" ]; then - xgrep=`basename "$xgrep"` - if [ "$xgrep" != pgrep ]; then - alias $xgrep="$xgrep --color=auto" - fi - fi - done -else - alias ls='ls -1v' - alias dir='dir -v' - alias vdir='vdir -v' -fi - -###################################################################### -# Set up the standard aliases for ls # -###################################################################### -alias ll='ls -l' -alias la='ls -a' -alias l='ls -CF' - -###################################################################### -# Some preferences for miscellaneous stuff # -###################################################################### -#alias rm='gvfs-trash' -#alias sed='sed --follow-symlinks' # breaks 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 # -###################################################################### -alias lock="clear; away -C 'This terminal is locked'" -alias plock="term-title Terminal Locked;lock" -mvln() { - if [[ ! -L "$1" ]]; then - libremessages error 'Not a soft link: %s' "$1" - fi - target=$(readlink -f -- "$1") - ln -srT -- "$target" "$2" - if cmp -- "$1" "$2"; then - rm -f -- "$1" - else - 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 '^ '; } 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/emacs/init.el b/.config/emacs/init.el index e635b77..90fda1b 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -161,6 +161,32 @@ sh-script.el is broken." (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) + (require 'go-mode-load nil t) -- cgit v1.1-4-g5e80 From e3840259dab27b4e9570d33297d410868a1f9c13 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 24 Aug 2015 00:11:22 -0400 Subject: systemd --- .config/systemd/user/emacs-daemon.service | 2 +- .config/systemd/user/wmii@.service.wants/dunst@.service | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 120000 .config/systemd/user/wmii@.service.wants/dunst@.service 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/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 -- cgit v1.1-4-g5e80 From f773fc22cc8057c719eef94d90c07de8a7230d0a Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 22 Sep 2015 15:28:40 -0400 Subject: systemd: add synergy unit --- .config/systemd/user/synergy@.service | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .config/systemd/user/synergy@.service diff --git a/.config/systemd/user/synergy@.service b/.config/systemd/user/synergy@.service new file mode 100644 index 0000000..18961f2 --- /dev/null +++ b/.config/systemd/user/synergy@.service @@ -0,0 +1,9 @@ +[Unit] +Description=Keyboard and mouse sharing on X display %I +StopWhenUnneeded=true + +[Service] +Type=simple +Environment=DISPLAY=%I +ExecStart=/usr/bin/synergy +Restart=always -- cgit v1.1-4-g5e80 From 6fd75fa99cc547ed9b9aa3657d698ac9552cc7f9 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 22 Sep 2015 15:20:20 -0400 Subject: clean up systemd dependencies --- .config/systemd/user/lxpanel@.service | 4 ++++ .config/systemd/user/panel@.target | 3 +++ .config/systemd/user/panel@.target.requires/lxpanel@.service | 1 + .config/systemd/user/synergy@.service | 1 + .config/systemd/user/wm@.target | 1 - .config/systemd/user/wm@.target.requires/wmii@.service | 1 + .config/systemd/user/wmii@.service | 3 +++ 7 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 .config/systemd/user/panel@.target create mode 120000 .config/systemd/user/panel@.target.requires/lxpanel@.service create mode 120000 .config/systemd/user/wm@.target.requires/wmii@.service 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 index 18961f2..df0640a 100644 --- a/.config/systemd/user/synergy@.service +++ b/.config/systemd/user/synergy@.service @@ -1,6 +1,7 @@ [Unit] Description=Keyboard and mouse sharing on X display %I StopWhenUnneeded=true +Requires=panel@%i.target [Service] Type=simple 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 -- cgit v1.1-4-g5e80