From 39b328618bbf6e898b4fd1cf2e6207d79bc1769b Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 6 Jan 2015 13:08:37 -0500 Subject: .config/Makefile: use GIT_DIR instead of GITDIR --- .config/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.config/Makefile b/.config/Makefile index dd4c37f..7293c8a 100644 --- a/.config/Makefile +++ b/.config/Makefile @@ -2,10 +2,10 @@ SHELL = /bin/bash -GITDIR = ${HOME}/.git +GIT_DIR = ${HOME}/.git targets = \ - ${GITDIR}/info/exclude \ + ${GIT_DIR}/info/exclude \ ${HOME}/.folders \ ${XDG_CACHE_HOME}/config-symlinks/cookie \ ${XDG_CACHE_HOME}/cron/cookie @@ -15,8 +15,8 @@ clean: rm -f $(targets) ${HOME}/.folders: ${HOME}/Maildir $(MAKEFILE_LIST) - find $< -mindepth 2 -maxdepth 2 \( -type f -name "maildirfolder" -o -type d -name new -o -type d -name tmp -o -type d -name cur \) -printf '%P\0' | xargs -0 dirname -z -- | sort -zu | xargs -0 printf '.%s\n' >'$@' -${GITDIR}/info/exclude: ${HOME}/.git.info.exclude.in $(shell echo .??*/) + find $< -mindepth 2 -maxdepth 2 \( -type f -name "maildirfolder" -o -type d -name new -o -type d -name tmp -o -type d -name cur \) -printf '%P\0' | xargs -0 dirname -z -- | sort -zu | xargs -0 printf -- '.%s\n' >'$@' +${GIT_DIR}/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 -- cgit v1.2.3 From 2c59bc096e4a0ea16d78d4b726a6dfe6c6a60b81 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 6 Jan 2015 13:09:16 -0500 Subject: .config/Makefile: use .DELETE_ON_ERROR: --- .config/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/Makefile b/.config/Makefile index 7293c8a..909486d 100644 --- a/.config/Makefile +++ b/.config/Makefile @@ -35,6 +35,7 @@ ${HOME}/Maildir/%: | ${HOME}/Maildir mkdir -p '$@'/{cur,new,tmp} touch '$@'/maildirfolder +.DELETE_ON_ERROR: .PHONY: FORCE PHONY FORCE: ; PHONY: ; -- cgit v1.2.3 From ec527987b4389e3139567d04d66d97db843e46ef Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 6 Jan 2015 13:10:22 -0500 Subject: Add redshift.conf --- .config/bash/aliases.sh | 8 -------- .config/redshift.conf | 13 +++++++++++++ 2 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 .config/redshift.conf diff --git a/.config/bash/aliases.sh b/.config/bash/aliases.sh index f59eef9..fe4f2c6 100644 --- a/.config/bash/aliases.sh +++ b/.config/bash/aliases.sh @@ -42,14 +42,6 @@ alias cd=pushd alias gitk='gitk --all --date-order' alias userctl='systemctl --user' -###################################################################### -# Remember lat/long for redshift # -###################################################################### -redshift='redshift -l39.9030:85.9979' -alias gtk-redshift="gtk-$redshift" -alias redshift="$redshift" -unset redshift - ###################################################################### # Some almost-function aliases # ###################################################################### diff --git a/.config/redshift.conf b/.config/redshift.conf new file mode 100644 index 0000000..25e731a --- /dev/null +++ b/.config/redshift.conf @@ -0,0 +1,13 @@ +[redshift] +; Don't mess with the color, just brightness +temp-day=6500K +temp-night=6500K +brightness-day=1.0 +brightness-night=0.45 + +location-provider=manual +transition=0 + +[manual] +lat=39.9030 +lon=-85.9979 -- cgit v1.2.3 From bbf4a28f2a7640ec06d997f9d24c94c5d425dd1b Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 6 Jan 2015 13:12:36 -0500 Subject: emacs/init.el: Use ;; for comment instead of ; --- .config/emacs/init.el | 64 +++++++++++++++++++++++++-------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/.config/emacs/init.el b/.config/emacs/init.el index 4bce12a..479db10 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -1,5 +1,5 @@ -; This config requires Emacs 24(+?) -;; Use XDG-ish locations ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; This config requires Emacs 24(+?) +;;;; Use XDG-ish locations ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (setq xdg-cache-home (file-name-as-directory (or (getenv "XDG_CACHE_HOME") "~/.cache"))) (setq package-user-dir (concat xdg-cache-home "emacs/elpa") @@ -15,7 +15,7 @@ wl-init-file (concat user-emacs-directory "wl.el") ) -;; The basics that I can't use Emacs without ;;;;;;;;;;;;;;;;;;;;;;;;; +;;;; The basics that I can't use Emacs without ;;;;;;;;;;;;;;;;;;;;;;; (show-paren-mode 1) (column-number-mode 1) (line-number-mode 1) @@ -37,18 +37,18 @@ (load custom-file 'noerror) -;; Early settings ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; This isn't particularly important, but set it before doing a whole -; lot (loading packages), so there isn't a weird change in text size. +;;;; Early settings ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; This isn't particularly important, but set it before doing a whole +;; lot (loading packages), so there isn't a weird change in text size. (set-face-attribute 'default nil :height 80) -;; Bootstrap el-get ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; This downloads and installs el-get (package management) if isn't -; installed. +;;;; Bootstrap el-get ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; This downloads and installs el-get (package management) if isn't +;; installed. -; Derived from ELPA installation -; http://tromey.com/elpa/install.html +;; Derived from ELPA installation +;; http://tromey.com/elpa/install.html (defun eval-url (url) (let ((buffer (url-retrieve-synchronously url))) (save-excursion @@ -64,25 +64,25 @@ (eval-url "https://github.com/dimitri/el-get/raw/master/el-get-install.el"))) -;; Install packages ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; This is kinda funny how it works. -; -; package.el/ELPA (The standard package manager in Emacs 24) has -; terrible programatic management. It's great at installing packages, -; but only interactively. So, I -; 1) Disable package.el from getting loading all downloaded packages -; 2) Use el-get to load a specified list of packages from elpa. -; -; This is also nice because I can do event-base programming for what -; to do once a package is loaded, using :after. +;;;; Install packages ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; This is kinda funny how it works. +;; +;; package.el/ELPA (The standard package manager in Emacs 24) has +;; terrible programatic management. It's great at installing packages, +;; but only interactively. So, I +;; 1) Disable package.el from getting loading all downloaded packages +;; 2) Use el-get to load a specified list of packages from elpa. +;; +;; This is also nice because I can do event-base programming for what +;; to do once a package is loaded, using :after. (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/")) (setq package-enable-at-startup nil) -; What packages el-get should get from ELPA (if it gets them at all) +;; What packages el-get should get from ELPA (if it gets them at all) (setq el-get-sources '( - ; Minor modes - (:name dtrt-indent :type elpa ; Detect indent style for existing files + ;; Minor modes + (:name dtrt-indent :type elpa ;; Detect indent style for existing files :after (dtrt-indent-mode 1)) (:name page-break-lines :type elpa ; Display form-feeds pretty :after '(lambda () @@ -90,11 +90,11 @@ page-break-lines-mode page-break-lines-mode :group 'page-break-lines) (global-page-break-lines-mode 1))) - (:name smart-tabs-mode :type elpa ; Indent with tabs, align with spaces + (:name smart-tabs-mode :type elpa ;; Indent with tabs, align with spaces :after (progn (smart-tabs-mode 1) (apply 'smart-tabs-insinuate (mapcar 'car smart-tabs-insinuate-alist)))) - ; Major modes + ;; Major modes (:name coffee-mode :type elpa :after (add-hook 'coffee-mode-hook '(lambda () @@ -108,18 +108,18 @@ :after (put 'nginx-indent-level 'safe-local-variable 'integerp)) (:name scss-mode :type elpa) )) -; What packages el-get should install, both from above, and it's -; internal list of sources. +;; What packages el-get should install, both from above, and it's +;; internal list of sources. (el-get 'sync '(el-get - ; Minor modes + ;; Minor modes dtrt-indent smart-tabs-mode page-break-lines - ; Major modes + ;; Major modes apel flim semi wanderlust markdown-mode nginx-mode - ;nxhtml ; nxhtml is invasive, only enable if actively using + ;;nxhtml ; nxhtml is invasive, only enable if actively using php-mode-improved )) -- cgit v1.2.3 From 10fe774027ba3b5230809a142a499802f977360b Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 6 Jan 2015 13:17:14 -0500 Subject: wmii: mark local variables as local --- .config/wmii-hg/config.sh | 19 ++++++++++--------- .config/wmii-hg/util.sh | 9 +++++---- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/.config/wmii-hg/config.sh b/.config/wmii-hg/config.sh index c560f3f..437c585 100644 --- a/.config/wmii-hg/config.sh +++ b/.config/wmii-hg/config.sh @@ -13,7 +13,7 @@ mkdir -p -- "${HIST%/*}" . theme-tango-dark Event() { - event=$1; shift; + local event=$1; shift; case "$event" in ## Mouse event meanings: ## MouseDown = mouse down @@ -42,7 +42,7 @@ Event() { # Clear the LBar and RBar find $WMII_DIR/{l,r}bar -type f -delete # Populate the LBar by emulating [Create|Focus]Tag events - seltag=`sed 1q $WMII_DIR/tag/sel/ctl` + local tag seltag="$(sed 1q $WMII_DIR/tag/sel/ctl)" while read -r tag; do Event CreateTag "$tag" if [ "$tag" = "$seltag" ]; then @@ -99,14 +99,14 @@ Event() { NotUrgent) ## $1=client $2=[Manager|Client] ;; ClientMouseDown) ## $1=client $2=button - client=$1 - button=$2 + local client=$1 + local button=$2 case $button in 1) ;; 2) ;; 3) { - case `wmii9menu Delete Fullscreen` in + case $(wmii9menu Delete Fullscreen) in Delete) echo kill >> $WMII_DIR/client/$client/ctl;; Fullscreen) @@ -117,8 +117,9 @@ Event() { ClientClick) ## $1=client $2=button ;; Unresponsive) ## $1=client - client=$1 - client_name=`cat $WMII_DIR/client/$client/label` + local client=$1 + local client_name=$(< $WMII_DIR/client/$client/label) + local msg resp msg="The client \`${client_name}' is not responding." msg+=" What would you like to do?" { @@ -166,7 +167,7 @@ Event() { } Key() { - key=$1 + local key=$1 case "$key" in ## Moving around @@ -239,7 +240,7 @@ Key() { } Action() { - prog=$(path_which "$WMII_CONFPATH" "$1"); shift + local prog=$(path_which "$WMII_CONFPATH" "$1"); shift if [ -n "$prog" ]; then "$prog" "$@" else diff --git a/.config/wmii-hg/util.sh b/.config/wmii-hg/util.sh index 2211d28..323d8a6 100644 --- a/.config/wmii-hg/util.sh +++ b/.config/wmii-hg/util.sh @@ -25,11 +25,12 @@ dquote() { # Usage: expand_variables # Expands variables read from /dev/stdin ## -expand_variables() { - while read; do - eval printf "'%s\n'" "$(dquote "$REPLY")" +expand_variables() ( + IFS='' + while read -r line; do + eval printf "'%s\n'" "$(dquote "$line")" done -} +) is_mounted() { local dir="$(readlink -m $1)" -- cgit v1.2.3 From d7128cd444fce3129a78e08fe643978fb25c3846 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 6 Jan 2015 13:17:44 -0500 Subject: wmii: think harder about when to fork --- .config/wmii-hg/config.sh | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/.config/wmii-hg/config.sh b/.config/wmii-hg/config.sh index 437c585..f7ea3f7 100644 --- a/.config/wmii-hg/config.sh +++ b/.config/wmii-hg/config.sh @@ -51,7 +51,7 @@ Event() { done < <(lstags) # Run the autostart action - Action autostart 2>/dev/null & + Action autostart ;; WmiircQuit) ## No args echo ' ==> Stopping wmiirc' @@ -218,24 +218,22 @@ Key() { ## Running programs $MODKEY-a) ## Open wmii actions menu - Action $(path_ls $WMII_CONFPATH | wimenu -h "${HIST}.actions" -n 5000) & ;; + local action="$(path_ls $WMII_CONFPATH | wimenu -h "${HIST}.actions" -n 5000)" + Action "$action" & ;; $MODKEY-x) ## Open program menu - (PATH=$_PATH exec setsid $(path_ls $PATH | wimenu -h "${HIST}.progs" -n 5000)) & ;; + local command="$(path_ls $PATH | wimenu -h "${HIST}.progs" -n 5000)" || return + ( PATH=$_PATH exec setsid $command ) & ;; $MODKEY-Return) ## Launch a terminal - (PATH=$_PATH exec setsid x-terminal-emulator) & ;; + ( PATH=$_PATH exec setsid x-terminal-emulator ) & ;; ## Tag actions $MODKEY-t) ## Change to another tag - { - tag=$(lstags | wimenu -h "${HIST}.tags" -n 50) || return - echo view $tag >> $WMII_DIR/ctl - }& ;; + local tag=$(lstags | wimenu -h "${HIST}.tags" -n 50) || return + echo view "$tag" >> $WMII_DIR/ctl;; $MODKEY-Shift-t) ## Retag the selected client - sel=$(sed 1q $WMII_DIR/client/sel/ctl) - { - tag=$(lstags | wimenu -h "${HIST}.tags" -n 50) || return - echo "$tag" >> $WMII_DIR/client/$sel/tags - }& ;; + local sel=$(sed 1q $WMII_DIR/client/sel/ctl) + local tag=$(lstags | wimenu -h "${HIST}.tags" -n 50) || return + echo "$tag" >> $WMII_DIR/client/$sel/tags;; esac } -- cgit v1.2.3 From 87428a01acb77a94d35c03264d376a2ee3853664 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 6 Jan 2015 13:18:31 -0500 Subject: wmii: re-jigger the rbar --- .config/wmii-hg/autostart | 6 ++++-- .config/wmii-hg/rbar_acpi | 15 +++++++++++++++ .config/wmii-hg/rbar_battery | 9 --------- .config/wmii-hg/rbar_clock | 8 ++++++-- .config/wmii-hg/rbar_cpu | 12 ------------ .config/wmii-hg/rbar_wifi | 17 +++++++++++++++-- 6 files changed, 40 insertions(+), 27 deletions(-) create mode 100755 .config/wmii-hg/rbar_acpi delete mode 100755 .config/wmii-hg/rbar_battery delete mode 100755 .config/wmii-hg/rbar_cpu diff --git a/.config/wmii-hg/autostart b/.config/wmii-hg/autostart index cee702a..156fe7d 100755 --- a/.config/wmii-hg/autostart +++ b/.config/wmii-hg/autostart @@ -10,5 +10,7 @@ daemon dunst &> /dev/null daemon blueman-applet &> /dev/null daemon clipit -dn &> /dev/null -#Action rbar_cpu 01 & -Action rbar_clock 99 & +PATH="$WMII_CONFPATH:$PATH" +daemon rbar_acpi 97_acpi &> /dev/null +daemon rbar_wifi 98_wifi &> /dev/null +daemon rbar_clock 99_clock &> /dev/null diff --git a/.config/wmii-hg/rbar_acpi b/.config/wmii-hg/rbar_acpi new file mode 100755 index 0000000..1771875 --- /dev/null +++ b/.config/wmii-hg/rbar_acpi @@ -0,0 +1,15 @@ +#!/bin/bash +. include.sh + +id=$1 +trap "rm -f ${WMII_DIR}/rbar/${id}.*" EXIT + +while connected_to_x_server; do + acpi -bt | sed -r \ + -e 's/^([A-Z])[a-z]+ ([0-9]+):/\1\2:/' \ + -e 's/\s*degrees\s*/°/g' | + cat -n | while read -r n line; do + printf "label %s\n" "$line" >> "${WMII_DIR}/rbar/${id}.${n}" + done + sleep 1 +done diff --git a/.config/wmii-hg/rbar_battery b/.config/wmii-hg/rbar_battery deleted file mode 100755 index f632f7e..0000000 --- a/.config/wmii-hg/rbar_battery +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -. include.sh - -priority=$1 - -while connected_to_x_server; do - printf 'label %s\n' "$(acpi -b)" >> "$WMII_DIR/rbar/${priority}_battery" - sleep 1 -done diff --git a/.config/wmii-hg/rbar_clock b/.config/wmii-hg/rbar_clock index 6aecb92..c1692da 100755 --- a/.config/wmii-hg/rbar_clock +++ b/.config/wmii-hg/rbar_clock @@ -1,9 +1,13 @@ #!/bin/bash . include.sh -priority=$1 +id=$1 +trap "rm -f ${WMII_DIR}/rbar/${id}" EXIT while connected_to_x_server; do - printf 'label %s\n' "$(date)" >> "$WMII_DIR/rbar/${priority}_clock" + { + printf 'label ' + date +'%a, %F %T %Z(%:::z)' + } |sponge >> "${WMII_DIR}/rbar/${id}" sleep .5 done diff --git a/.config/wmii-hg/rbar_cpu b/.config/wmii-hg/rbar_cpu deleted file mode 100755 index 5531e60..0000000 --- a/.config/wmii-hg/rbar_cpu +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -. include.sh - -priority=$1 - -while connected_to_x_server; do - # This doesn't work for me, it shows capacity - #echo -n 'Core MHz:' $(cat /proc/cpuinfo | grep 'cpu MHz' | sed 's/.*: //g; s/\..*//g;') >> "$WMII_DIR/rbar/${priority}_cpu" - # This actually displays %idle - echo 'label CPU: [ '$(tail -n3 ~/tmp/cputime|sed -ur 's/\s\s+/\t/g'|cut -f2,11|sed 's/\t\(.*\)/(\1)/')' ]' >> "$WMII_DIR/rbar/${priority}_cpu" - sleep 1 -done diff --git a/.config/wmii-hg/rbar_wifi b/.config/wmii-hg/rbar_wifi index 18395a3..53464dc 100755 --- a/.config/wmii-hg/rbar_wifi +++ b/.config/wmii-hg/rbar_wifi @@ -1,9 +1,22 @@ #!/bin/bash . include.sh -priority=$1 +id=$1 +trap "rm -f ${WMII_DIR}/rbar/${id}" EXIT + +iwinfo() { + interface=$1 + iwconfig "$interface" | + sed -r 's/ {2,}/\n/g' | + sed -e '/^\s*$/d' -e 's/:\s*/=/' \ + -e '1s/^/Interface=/' \ + -e '2s/^/MAC Protocol=/' +} while connected_to_x_server; do - echo 'label Wlan0:' $(iwconfig wlan0 | sed 's/ /\n/g' | grep Quality) >> "$WMII_DIR/rbar/${priority}_wifi" + { + printf 'label ' + iwinfo wlp2s0|grep -E '^(ESSID|Link Quality)='|sed 'N;s/\n/ | /' + } | sponge >> "${WMII_DIR}/rbar/${id}" sleep 1 done -- cgit v1.2.3 From 9316d6ee300ef980a38b7a3ba1da689065414795 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 6 Jan 2015 13:20:36 -0500 Subject: wmii: {Not,}UrgentTag's arguments are actually flipped from the man page. --- .config/wmii-hg/config.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.config/wmii-hg/config.sh b/.config/wmii-hg/config.sh index f7ea3f7..888c3ae 100644 --- a/.config/wmii-hg/config.sh +++ b/.config/wmii-hg/config.sh @@ -142,10 +142,10 @@ Event() { echo colors "$WMII_FOCUSCOLORS" >> $WMII_DIR/lbar/$1;; UnfocusTag) ## $1=tag echo colors "$WMII_NORMCOLORS" >> $WMII_DIR/lbar/$1;; - UrgentTag) ## $1=tag $2=[Manager|Client] - echo colors "$WMII_URGENTCOLORS" >> $WMII_DIR/lbar/$1;; - NotUrgentTag) ## $1=tag $2=[Manager|Client] - echo colors "$WMII_NORMCOLORS" >> $WMII_DIR/lbar/$1;; + UrgentTag) ## $1=[Manager|Client] $2=tag + echo colors "$WMII_URGENTCOLORS" >> $WMII_DIR/lbar/$2;; + NotUrgentTag) ## $1=[Manager|Client] $2=tag + echo colors "$WMII_NORMCOLORS" >> $WMII_DIR/lbar/$2;; ## LeftBar events (usually tag buttons) LeftBarMouseDown) ## $1=button $2=bar_item -- cgit v1.2.3 From 9472425275b9cfbaa99301621c338faa5e0a61f6 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 6 Jan 2015 13:21:03 -0500 Subject: ssh: clean up old hosts, add new hosts --- .config/ssh/config | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/.config/ssh/config b/.config/ssh/config index 2a5b79a..7d7704e 100644 --- a/.config/ssh/config +++ b/.config/ssh/config @@ -15,17 +15,7 @@ Host *.cs.purdue.edu # Parabola ################################################# -# short names -Host repo - HostName repo.parabolagnulinux.org -Host wiki - HostName wiki.parabolagnulinux.org -Host projects - HostName projects.parabolagnulinux.org -Host parabola - HostName parabolagnulinux.org - -Host *.parabolagnulinux.org parabolagnulinux.org *.parabola.nu parabola.nu +Host parabola.nu Port 1863 User lukeshu @@ -34,3 +24,12 @@ Host *.parabolagnulinux.org parabolagnulinux.org *.parabola.nu parabola.nu Host lukeshu.com Port 1863 User lukeshu + +Host build64-par + Port 22 + User luke + +Host build64-par-far + Port 1864 + HostName lukeshu.com + User luke -- cgit v1.2.3 From 952768c46ae11e0bb1cb01f527153f6cd2d9ba62 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 6 Jan 2015 13:22:47 -0500 Subject: clean up systemd configuration --- .../systemd/user/default.target.wants/emacs-daemon.service | 11 +---------- .config/systemd/user/default.target.wants/gpg-agent.service | 10 +--------- .../systemd/user/default.target.wants/maildirproc@att.service | 1 - .../user/default.target.wants/maildirproc@purdue.service | 1 - .config/systemd/user/default.target.wants/vncserver@1.service | 1 - .config/systemd/user/emacs-daemon.service | 10 ++++++++++ .config/systemd/user/gpg-agent.service | 9 +++++++++ .config/systemd/user/redshift@.service | 11 +++++++++++ .config/systemd/user/vncserver@.service | 2 +- 9 files changed, 33 insertions(+), 23 deletions(-) mode change 100644 => 120000 .config/systemd/user/default.target.wants/emacs-daemon.service mode change 100644 => 120000 .config/systemd/user/default.target.wants/gpg-agent.service delete mode 120000 .config/systemd/user/default.target.wants/maildirproc@att.service delete mode 120000 .config/systemd/user/default.target.wants/maildirproc@purdue.service delete mode 120000 .config/systemd/user/default.target.wants/vncserver@1.service create mode 100644 .config/systemd/user/emacs-daemon.service create mode 100644 .config/systemd/user/gpg-agent.service create mode 100644 .config/systemd/user/redshift@.service diff --git a/.config/systemd/user/default.target.wants/emacs-daemon.service b/.config/systemd/user/default.target.wants/emacs-daemon.service deleted file mode 100644 index 279d83a..0000000 --- a/.config/systemd/user/default.target.wants/emacs-daemon.service +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=Emacs deamon - -[Service] -Type=forking -ExecStart=/bin/bash -l -c 'emacs --daemon' -ExecStop=/bin/bash -l -c 'emacsclient -e "(kill-emacs)"' - -[Install] -WantedBy=default.target diff --git a/.config/systemd/user/default.target.wants/emacs-daemon.service b/.config/systemd/user/default.target.wants/emacs-daemon.service new file mode 120000 index 0000000..106cf42 --- /dev/null +++ b/.config/systemd/user/default.target.wants/emacs-daemon.service @@ -0,0 +1 @@ +/home/lukeshu-parabola/.config/systemd/user/emacs-daemon.service \ No newline at end of file diff --git a/.config/systemd/user/default.target.wants/gpg-agent.service b/.config/systemd/user/default.target.wants/gpg-agent.service deleted file mode 100644 index 93c12b0..0000000 --- a/.config/systemd/user/default.target.wants/gpg-agent.service +++ /dev/null @@ -1,9 +0,0 @@ -[Unit] -Description="GnuPG agent daemon" - -[Service] -Type=forking -ExecStart=/usr/bin/gpg-agent --daemon --write-env-file ${XDG_RUNTIME_DIR}/gpg - -[Install] -WantedBy=default.target diff --git a/.config/systemd/user/default.target.wants/gpg-agent.service b/.config/systemd/user/default.target.wants/gpg-agent.service new file mode 120000 index 0000000..5727454 --- /dev/null +++ b/.config/systemd/user/default.target.wants/gpg-agent.service @@ -0,0 +1 @@ +/home/lukeshu-parabola/.config/systemd/user/gpg-agent.service \ No newline at end of file diff --git a/.config/systemd/user/default.target.wants/maildirproc@att.service b/.config/systemd/user/default.target.wants/maildirproc@att.service deleted file mode 120000 index 1079515..0000000 --- a/.config/systemd/user/default.target.wants/maildirproc@att.service +++ /dev/null @@ -1 +0,0 @@ -/home/luke/.config/systemd/user/maildirproc@.service \ No newline at end of file diff --git a/.config/systemd/user/default.target.wants/maildirproc@purdue.service b/.config/systemd/user/default.target.wants/maildirproc@purdue.service deleted file mode 120000 index 1079515..0000000 --- a/.config/systemd/user/default.target.wants/maildirproc@purdue.service +++ /dev/null @@ -1 +0,0 @@ -/home/luke/.config/systemd/user/maildirproc@.service \ No newline at end of file diff --git a/.config/systemd/user/default.target.wants/vncserver@1.service b/.config/systemd/user/default.target.wants/vncserver@1.service deleted file mode 120000 index 2dcf488..0000000 --- a/.config/systemd/user/default.target.wants/vncserver@1.service +++ /dev/null @@ -1 +0,0 @@ -/home/luke/.config/systemd/user/vncserver@.service \ No newline at end of file diff --git a/.config/systemd/user/emacs-daemon.service b/.config/systemd/user/emacs-daemon.service new file mode 100644 index 0000000..279d83a --- /dev/null +++ b/.config/systemd/user/emacs-daemon.service @@ -0,0 +1,10 @@ +[Unit] +Description=Emacs deamon + +[Service] +Type=forking +ExecStart=/bin/bash -l -c 'emacs --daemon' +ExecStop=/bin/bash -l -c 'emacsclient -e "(kill-emacs)"' + +[Install] +WantedBy=default.target diff --git a/.config/systemd/user/gpg-agent.service b/.config/systemd/user/gpg-agent.service new file mode 100644 index 0000000..93c12b0 --- /dev/null +++ b/.config/systemd/user/gpg-agent.service @@ -0,0 +1,9 @@ +[Unit] +Description="GnuPG agent daemon" + +[Service] +Type=forking +ExecStart=/usr/bin/gpg-agent --daemon --write-env-file ${XDG_RUNTIME_DIR}/gpg + +[Install] +WantedBy=default.target diff --git a/.config/systemd/user/redshift@.service b/.config/systemd/user/redshift@.service new file mode 100644 index 0000000..41a0b7a --- /dev/null +++ b/.config/systemd/user/redshift@.service @@ -0,0 +1,11 @@ +[Unit] +Description=Redshift display colour temperature adjustment +Documentation=http://jonls.dk/redshift/ + +[Service] +Environment=DISPLAY=%I +ExecStart=/usr/bin/redshift +Restart=always + +[Install] +WantedBy=default.target diff --git a/.config/systemd/user/vncserver@.service b/.config/systemd/user/vncserver@.service index fa616d6..ef83ef2 100644 --- a/.config/systemd/user/vncserver@.service +++ b/.config/systemd/user/vncserver@.service @@ -3,7 +3,7 @@ Description=VNC desktop [Service] Type=simple -ExecStart=/bin/bash -l -c 'vncserver -fg :%I' +ExecStart=/bin/bash -l -c 'vncserver -fg %I' Restart=always ExecStopPost=/bin/rm /tmp/.X%I-lock /tmp/.X11-unix/X%I -- cgit v1.2.3 From e9ffdb22ece018ea6216e69b9ee5ed32950f61c8 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 6 Jan 2015 13:23:30 -0500 Subject: emacs: fix warning from the page-break-lines :after hook --- .config/emacs/init.el | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.config/emacs/init.el b/.config/emacs/init.el index 479db10..246ea6a 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -84,12 +84,12 @@ ;; Minor modes (:name dtrt-indent :type elpa ;; Detect indent style for existing files :after (dtrt-indent-mode 1)) - (:name page-break-lines :type elpa ; Display form-feeds pretty - :after '(lambda () - (define-global-minor-mode global-page-break-lines-mode - page-break-lines-mode page-break-lines-mode - :group 'page-break-lines) - (global-page-break-lines-mode 1))) + (:name page-break-lines :type elpa ;; Display form-feeds pretty + :after (progn + (define-global-minor-mode global-page-break-lines-mode + page-break-lines-mode page-break-lines-mode + :group 'page-break-lines) + (global-page-break-lines-mode 1))) (:name smart-tabs-mode :type elpa ;; Indent with tabs, align with spaces :after (progn (smart-tabs-mode 1) -- cgit v1.2.3 From 11e461d0fea5aaf33a31ebb88a17135b46c9483d Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 29 Jan 2015 00:32:22 -0500 Subject: .local/lib/xdg.sh: handle setting XDG_RUNTIME_DIR better This is based off of the TMPDIR hack I use on the Purdue CS boxes. --- .local/lib/xdg.sh | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/.local/lib/xdg.sh b/.local/lib/xdg.sh index 2241d2e..20fab4b 100644 --- a/.local/lib/xdg.sh +++ b/.local/lib/xdg.sh @@ -17,7 +17,28 @@ if [[ -n $XDG_RUNTIME_DIR ]] && [[ ! -d $XDG_RUNTIME_DIR ]]; then fi # Set XDG_RUNTIME_DIR if we can -if [[ -z $XDG_RUNTIME_DIR ]] && [[ -n $TMPDIR ]]; then - export XDG_RUNTIME_DIR="$TMPDIR/xdg-runtime" - install -dm0700 "$XDG_RUNTIME_DIR" +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" + readonly XDG_RUNTIME_DIR + # There's a race condition here, between the `ln -s` and `flock`. + # But it's not like I'll be hammering a box with logins. + if [[ ! -d "$XDG_CACHE_HOME" ]]; then + local tmp="$(mktemp --tmpdir -- "${USER}@${HOSTNAME}-runtime.XXXXXXXXXX")" + mkdir -p -- "$XDG_CACHE_HOME/xdg-runtime-dir" + ln -sfT -- "$tmp" "$XDG_RUNTIME_DIR" + fi + if ! [[ /dev/fd/7 -ef "$XDG_CACHE_HOME/xdg-runtime-dir/.lock" ]]; then + exec 7 >"$XDG_CACHE_HOME/xdg-runtime-dir/.lock" + fi + if flock -sn 7; then + trap _diy_xdg_runtime_logout EXIT + fi + } + _diy_xdg_runtime_logout() { + if flock -xn 7; then + rm -rf -- "$(readlink "$XDG_RUNTIME_DIR")" + fi + } + _diy_xdg_runtime_login fi -- cgit v1.2.3 From 7147501a1a7a60344c4a0b856abea25c5a382428 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 29 Jan 2015 00:34:11 -0500 Subject: .local/bin/x-*: exec not eval; I'm smert. --- .local/bin/x-pdf | 2 +- .local/bin/x-terminal-emulator | 2 +- .local/bin/x-www-browser | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.local/bin/x-pdf b/.local/bin/x-pdf index cfaa258..8f9ef60 100755 --- a/.local/bin/x-pdf +++ b/.local/bin/x-pdf @@ -1,3 +1,3 @@ #!/bin/sh -eval $(pick atril zathura mupdf okular evince xpdf 'emacsclient -c') "$@" +exec $(pick atril zathura mupdf okular evince xpdf 'emacsclient -c') "$@" diff --git a/.local/bin/x-terminal-emulator b/.local/bin/x-terminal-emulator index 075dda5..2e158cf 100755 --- a/.local/bin/x-terminal-emulator +++ b/.local/bin/x-terminal-emulator @@ -1,3 +1,3 @@ #!/bin/sh -eval $(pick 'emacsterm -c' 'urxvt' 'xterm' 'gnome-terminal') "$@" +exec $(pick 'emacsterm -c' 'urxvt' 'xterm' 'gnome-terminal') "$@" diff --git a/.local/bin/x-www-browser b/.local/bin/x-www-browser index 945dcfc..b0b05e0 100755 --- a/.local/bin/x-www-browser +++ b/.local/bin/x-www-browser @@ -1,3 +1,3 @@ #!/bin/sh -eval $(pick -s iceweasel icecat firefox conkeror) "$@" +exec $(pick -s iceweasel icecat firefox conkeror) "$@" -- cgit v1.2.3 From 435a7b5e8e590240340232cc1832ead32b87adc6 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 29 Jan 2015 00:34:26 -0500 Subject: .local/bin/xmessage: get in on the exec party --- .local/bin/xmessage | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/xmessage b/.local/bin/xmessage index bd30b5e..08fd95e 100755 --- a/.local/bin/xmessage +++ b/.local/bin/xmessage @@ -1,2 +1,2 @@ #!/bin/sh -gxmessage $@ -fn 'Monospace' +exec gxmessage $@ -fn 'Monospace' -- cgit v1.2.3 From a9935b7a12a522937d91cb44a0e138132b555e16 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 29 Jan 2015 00:48:11 -0500 Subject: Re-jigger to use systemd for the process monitor for the window manager --- .config/X11/clientrc | 17 ++++++++--------- .config/systemd/user/dunst@.service | 10 ++++++++++ .config/systemd/user/lxpanel@.service | 10 ++++++++++ .config/systemd/user/rbar@.service | 7 +++++++ .config/systemd/user/redshift@.service | 6 +++--- .config/systemd/user/wmii@.service | 12 ++++++++++++ .../systemd/user/wmii@.service.wants/lxpanel@.service | 1 + .../user/wmii@.service.wants/rbar@97_acpi.service | 1 + .../user/wmii@.service.wants/rbar@98_wifi.service | 1 + .../user/wmii@.service.wants/rbar@99_clock.service | 1 + .../systemd/user/wmii@.service.wants/redshift@.service | 1 + .../systemd/user/wmii@.service.wants/xcompmgr@.service | 1 + .config/systemd/user/xcompmgr@.service | 10 ++++++++++ .config/wmii-hg/autostart | 16 ---------------- .config/wmii-hg/config.sh | 3 --- .config/wmii-hg/rbar | 9 +++++++++ 16 files changed, 75 insertions(+), 31 deletions(-) create mode 100644 .config/systemd/user/dunst@.service create mode 100644 .config/systemd/user/lxpanel@.service create mode 100644 .config/systemd/user/rbar@.service create mode 100644 .config/systemd/user/wmii@.service create mode 120000 .config/systemd/user/wmii@.service.wants/lxpanel@.service create mode 120000 .config/systemd/user/wmii@.service.wants/rbar@97_acpi.service create mode 120000 .config/systemd/user/wmii@.service.wants/rbar@98_wifi.service create mode 120000 .config/systemd/user/wmii@.service.wants/rbar@99_clock.service create mode 120000 .config/systemd/user/wmii@.service.wants/redshift@.service create mode 120000 .config/systemd/user/wmii@.service.wants/xcompmgr@.service create mode 100644 .config/systemd/user/xcompmgr@.service delete mode 100755 .config/wmii-hg/autostart create mode 100755 .config/wmii-hg/rbar diff --git a/.config/X11/clientrc b/.config/X11/clientrc index 26455d3..d18d714 100644 --- a/.config/X11/clientrc +++ b/.config/X11/clientrc @@ -1,9 +1,7 @@ #!/bin/sh -# -# ~/.xinitrc -# -# Executed by startx (run your window manager from here) +# Load system xinit modules (disabled) +# Remove "false &&" to enable if false && [ -d /etc/X11/xinit/xinitrc.d ]; then echo ' ==> Running scripts in Entering xinitrc.d/*' for f in /etc/X11/xinit/xinitrc.d/*; do @@ -19,8 +17,9 @@ if [ -f "$usermodmap" ]; then xmodmap "$usermodmap" fi -# exec gnome-session -# exec startkde -# exec startxfce4 -# ...or the Window Manager of your choice -exec wmii +#exec wmii +wm=wmii +systemctl --user start "${wm}@${DISPLAY}.service" +mkfifo "${XDG_RUNTIME_DIR}/x11-wm@${DISPLAY}" +cat "${XDG_RUNTIME_DIR}/x11-wm@${DISPLAY}" >/dev/null +rm "${XDG_RUNTIME_DIR}/x11-wm@${DISPLAY}" diff --git a/.config/systemd/user/dunst@.service b/.config/systemd/user/dunst@.service new file mode 100644 index 0000000..2aff6be --- /dev/null +++ b/.config/systemd/user/dunst@.service @@ -0,0 +1,10 @@ +[Unit] +Description=Dunst notification-daemon +Documentation=man:dunst(1) +StopWhenUnneeded=true + +[Service] +Type=simple +Environment=DISPLAY=%I +ExecStart=/usr/bin/dunst +Restart=always diff --git a/.config/systemd/user/lxpanel@.service b/.config/systemd/user/lxpanel@.service new file mode 100644 index 0000000..3327ab4 --- /dev/null +++ b/.config/systemd/user/lxpanel@.service @@ -0,0 +1,10 @@ +[Unit] +Description=LXDE Desktop Panel +Documentation=man:lxpanel(1) +StopWhenUnneeded=true + +[Service] +Type=simple +Environment=DISPLAY=%I +ExecStart=/usr/bin/lxpanel +Restart=always diff --git a/.config/systemd/user/rbar@.service b/.config/systemd/user/rbar@.service new file mode 100644 index 0000000..18d6201 --- /dev/null +++ b/.config/systemd/user/rbar@.service @@ -0,0 +1,7 @@ +[Unit] +Description=WMII rbar %I +StopWhenUnneeded=true + +[Service] +Type=simple +ExecStart=/usr/bin/bash -c '%h/.wmii-hg/rbar %I' diff --git a/.config/systemd/user/redshift@.service b/.config/systemd/user/redshift@.service index 41a0b7a..149bb74 100644 --- a/.config/systemd/user/redshift@.service +++ b/.config/systemd/user/redshift@.service @@ -1,11 +1,11 @@ [Unit] Description=Redshift display colour temperature adjustment Documentation=http://jonls.dk/redshift/ +StopWhenUnneeded=true [Service] +Type=simple Environment=DISPLAY=%I ExecStart=/usr/bin/redshift +ExecStopPost=/usr/bin/redshift -x Restart=always - -[Install] -WantedBy=default.target diff --git a/.config/systemd/user/wmii@.service b/.config/systemd/user/wmii@.service new file mode 100644 index 0000000..10fc4e9 --- /dev/null +++ b/.config/systemd/user/wmii@.service @@ -0,0 +1,12 @@ +[Unit] +Description=Window Manager Improved Improved +Documentation=file:/usr/share/doc/wmii/wmii.pdf + +[Service] +Type=simple +Restart=no + +Environment=DISPLAY=%I +ExecStart=/usr/bin/bash -l -c /usr/bin/wmii +ExecStop=/usr/bin/wmiir xwrite /ctl Quit +ExecStopPost=/usr/bin/bash -c ": > ${XDG_RUNTIME_DIR}/x11-wm@%I" diff --git a/.config/systemd/user/wmii@.service.wants/lxpanel@.service b/.config/systemd/user/wmii@.service.wants/lxpanel@.service new file mode 120000 index 0000000..06ed03f --- /dev/null +++ b/.config/systemd/user/wmii@.service.wants/lxpanel@.service @@ -0,0 +1 @@ +../lxpanel@.service \ No newline at end of file diff --git a/.config/systemd/user/wmii@.service.wants/rbar@97_acpi.service b/.config/systemd/user/wmii@.service.wants/rbar@97_acpi.service new file mode 120000 index 0000000..286989e --- /dev/null +++ b/.config/systemd/user/wmii@.service.wants/rbar@97_acpi.service @@ -0,0 +1 @@ +../rbar@.service \ No newline at end of file diff --git a/.config/systemd/user/wmii@.service.wants/rbar@98_wifi.service b/.config/systemd/user/wmii@.service.wants/rbar@98_wifi.service new file mode 120000 index 0000000..286989e --- /dev/null +++ b/.config/systemd/user/wmii@.service.wants/rbar@98_wifi.service @@ -0,0 +1 @@ +../rbar@.service \ No newline at end of file diff --git a/.config/systemd/user/wmii@.service.wants/rbar@99_clock.service b/.config/systemd/user/wmii@.service.wants/rbar@99_clock.service new file mode 120000 index 0000000..286989e --- /dev/null +++ b/.config/systemd/user/wmii@.service.wants/rbar@99_clock.service @@ -0,0 +1 @@ +../rbar@.service \ No newline at end of file diff --git a/.config/systemd/user/wmii@.service.wants/redshift@.service b/.config/systemd/user/wmii@.service.wants/redshift@.service new file mode 120000 index 0000000..59234a7 --- /dev/null +++ b/.config/systemd/user/wmii@.service.wants/redshift@.service @@ -0,0 +1 @@ +../redshift@.service \ No newline at end of file diff --git a/.config/systemd/user/wmii@.service.wants/xcompmgr@.service b/.config/systemd/user/wmii@.service.wants/xcompmgr@.service new file mode 120000 index 0000000..be8518c --- /dev/null +++ b/.config/systemd/user/wmii@.service.wants/xcompmgr@.service @@ -0,0 +1 @@ +../xcompmgr@.service \ No newline at end of file diff --git a/.config/systemd/user/xcompmgr@.service b/.config/systemd/user/xcompmgr@.service new file mode 100644 index 0000000..c7844d2 --- /dev/null +++ b/.config/systemd/user/xcompmgr@.service @@ -0,0 +1,10 @@ +[Unit] +Description=Composite Window-Effects Manger +Documentation=man:xcompmgr(1) +StopWhenUnneeded=true + +[Service] +Type=simple +Environment=DISPLAY=%I +ExecStart=/usr/bin/xcompmgr +Restart=always diff --git a/.config/wmii-hg/autostart b/.config/wmii-hg/autostart deleted file mode 100755 index 156fe7d..0000000 --- a/.config/wmii-hg/autostart +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -. include.sh - -xrandr --output VGA-1 --off - -daemon xcompmgr &> /dev/null -daemon lxpanel &> /dev/null -#daemon nm-applet &> /dev/null -daemon dunst &> /dev/null -daemon blueman-applet &> /dev/null -daemon clipit -dn &> /dev/null - -PATH="$WMII_CONFPATH:$PATH" -daemon rbar_acpi 97_acpi &> /dev/null -daemon rbar_wifi 98_wifi &> /dev/null -daemon rbar_clock 99_clock &> /dev/null diff --git a/.config/wmii-hg/config.sh b/.config/wmii-hg/config.sh index 888c3ae..98c41a6 100644 --- a/.config/wmii-hg/config.sh +++ b/.config/wmii-hg/config.sh @@ -49,9 +49,6 @@ Event() { Event FocusTag "$tag" fi done < <(lstags) - - # Run the autostart action - Action autostart ;; WmiircQuit) ## No args echo ' ==> Stopping wmiirc' diff --git a/.config/wmii-hg/rbar b/.config/wmii-hg/rbar new file mode 100755 index 0000000..9aaa485 --- /dev/null +++ b/.config/wmii-hg/rbar @@ -0,0 +1,9 @@ +#!/bin/bash +IFS=: +read -r name prefix DISPLAY <<<"$1" +export DISPLAY + +id=$1 +name=${id#[0-9][0-9]_} + +exec "$0"_"$name" "${id}" -- cgit v1.2.3 From dd8c27a1c6562aeb8487b94f985d89408f5a3902 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 29 Jan 2015 00:48:29 -0500 Subject: Bash: disable the pager when running in emacs --- .config/bash/rc.d/emacs.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/bash/rc.d/emacs.sh b/.config/bash/rc.d/emacs.sh index 12fa9ad..4a7b9b8 100644 --- a/.config/bash/rc.d/emacs.sh +++ b/.config/bash/rc.d/emacs.sh @@ -5,6 +5,7 @@ if [[ $TERM == eterm* ]]; then EDITOR=$SELECTED_EDITOR VISUAL=$SELECTED_EDITOR export SELECTED_EDITOR EDITOR VISUAL + export PAGER=cat ## Primatives for interacting with Emacs ############################### -- cgit v1.2.3 From 42abf85db87f1ec4755a180da46d4149654f699f Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 29 Jan 2015 00:49:29 -0500 Subject: lxpanel: remove unused config lines --- .config/lxpanel/default/config | 3 --- 1 file changed, 3 deletions(-) diff --git a/.config/lxpanel/default/config b/.config/lxpanel/default/config index e19a7d1..e0d2b50 100644 --- a/.config/lxpanel/default/config +++ b/.config/lxpanel/default/config @@ -1,4 +1 @@ [Command] -FileManager=v-editor %s -Terminal=urxvt -c %s -Logout=bash -c 'echo quit >> $WMII_DIR/ctl' -- cgit v1.2.3 From f207384c99764edbac8f66ca82c717d99becb03e Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 29 Jan 2015 00:49:47 -0500 Subject: configure makepkg here instead of in /etc --- .config/pacman/makepkg.conf | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .config/pacman/makepkg.conf diff --git a/.config/pacman/makepkg.conf b/.config/pacman/makepkg.conf new file mode 100644 index 0000000..8dc4536 --- /dev/null +++ b/.config/pacman/makepkg.conf @@ -0,0 +1,8 @@ +PKGDEST="${LIBREHOME:-$HOME}/packages/pkgdest" +SRCDEST="${LIBREHOME:-$HOME}/packages/srcdest" +SRCPKGDEST="${LIBREHOME:-$HOME}/packages/srcpkgdest" +LOGDEST="${LIBREHOME:-$HOME}/packages/logdest" + +PACKAGER="Luke Shumaker " + +MAKEFLAGS="-j3" -- cgit v1.2.3 From 8396ed0fba3dc50d7f802dd1c6db282eb6fc73fa Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 29 Jan 2015 00:51:20 -0500 Subject: wmii: 2 fixes - unset _PATH in child processes - local=$(FAILURE) succeeds; delcare local on a separate line. --- .config/wmii-hg/config.sh | 18 +++++++++++------- .config/wmii-hg/wmiirc | 6 ++++-- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.config/wmii-hg/config.sh b/.config/wmii-hg/config.sh index 98c41a6..6f63f75 100644 --- a/.config/wmii-hg/config.sh +++ b/.config/wmii-hg/config.sh @@ -215,21 +215,25 @@ Key() { ## Running programs $MODKEY-a) ## Open wmii actions menu - local action="$(path_ls $WMII_CONFPATH | wimenu -h "${HIST}.actions" -n 5000)" + local action + action="$(path_ls "$WMII_CONFPATH" | wimenu -h "${HIST}.actions" -n 5000)" || return Action "$action" & ;; $MODKEY-x) ## Open program menu - local command="$(path_ls $PATH | wimenu -h "${HIST}.progs" -n 5000)" || return - ( PATH=$_PATH exec setsid $command ) & ;; + local command + command="$(path_ls "$_PATH" | wimenu -h "${HIST}.progs" -n 5000)" || return + ( PATH=$_PATH; unset _PATH; exec $command ) & ;; $MODKEY-Return) ## Launch a terminal - ( PATH=$_PATH exec setsid x-terminal-emulator ) & ;; + ( PATH=$_PATH; unset _PATH; exec x-terminal-emulator ) & ;; ## Tag actions $MODKEY-t) ## Change to another tag - local tag=$(lstags | wimenu -h "${HIST}.tags" -n 50) || return + local tag + tag=$(lstags | wimenu -h "${HIST}.tags" -n 50) || return echo view "$tag" >> $WMII_DIR/ctl;; $MODKEY-Shift-t) ## Retag the selected client - local sel=$(sed 1q $WMII_DIR/client/sel/ctl) - local tag=$(lstags | wimenu -h "${HIST}.tags" -n 50) || return + local sel tag + sel=$(sed 1q $WMII_DIR/client/sel/ctl) + tag=$(lstags | wimenu -h "${HIST}.tags" -n 50) || return echo "$tag" >> $WMII_DIR/client/$sel/tags;; esac } diff --git a/.config/wmii-hg/wmiirc b/.config/wmii-hg/wmiirc index a6585de..396bed2 100755 --- a/.config/wmii-hg/wmiirc +++ b/.config/wmii-hg/wmiirc @@ -2,8 +2,10 @@ unset WMII_NAMESPACE unset WMII_DIR -export _PATH="$PATH" -export PATH="$WMII_CONFPATH:$PATH" +if [[ -z $_PATH ]]; then + export _PATH="$PATH" + export PATH="$WMII_CONFPATH:$PATH" +fi . include.sh -- cgit v1.2.3 From dd4773d812f379a3b562e1f873418edc2036d98c Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 29 Jan 2015 00:51:50 -0500 Subject: wmii: remove fixes.sh --- .config/wmii-hg/fixes.sh | 24 ------------------------ .config/wmii-hg/util.sh | 3 --- 2 files changed, 27 deletions(-) delete mode 100644 .config/wmii-hg/fixes.sh diff --git a/.config/wmii-hg/fixes.sh b/.config/wmii-hg/fixes.sh deleted file mode 100644 index 5858859..0000000 --- a/.config/wmii-hg/fixes.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -# Fix various deficiencies in either the shell or the filesystem - -## -# Usage: ls DIRECTORY -# Linux's 9p kernel module sometimes omits entries in directory listings -## -unalias ls &>/dev/null -ls() { - local real_ls=("$(which ls)" -1F) - [ $# = 0 ] && set -- "$PWD" - f="${1/#${WMII_DIR}/}" - if [ "$f" = "$1" ]; then - "${real_ls[@]}" "$f" - else - wmiir ls "$f" - fi -} - -## -# Usage: setsid cmd [arguments...] -# I like wmiir's setsid better than linux-utils' -## -setsid() { wmiir setsid "$@"; } diff --git a/.config/wmii-hg/util.sh b/.config/wmii-hg/util.sh index 323d8a6..b28a3b6 100644 --- a/.config/wmii-hg/util.sh +++ b/.config/wmii-hg/util.sh @@ -1,8 +1,5 @@ #!/bin/bash -# I moved "fixes" into a separate file because it isn't so much configuration... -. fixes.sh - ################################################################################ # Added shell features # ################################################################################ -- cgit v1.2.3 From 8761e30b770ae0995dac884a04f2ac3818bcfc26 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 29 Jan 2015 00:52:30 -0500 Subject: wmii: tidy up --- .config/wmii-hg/config.sh | 9 ++++----- .config/wmii-hg/theme-tango | 1 - 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.config/wmii-hg/config.sh b/.config/wmii-hg/config.sh index 6f63f75..d1da234 100644 --- a/.config/wmii-hg/config.sh +++ b/.config/wmii-hg/config.sh @@ -36,8 +36,7 @@ Event() { < "`conffile rules`" expand_variables >> $WMII_DIR/rules < "`conffile ctl-init`" expand_variables >> $WMII_DIR/ctl scansection Key | cut -sf2 >> $WMII_DIR/keys - # Configure X11 - hsetroot -solid "$WMII_BACKGROUND" + #hsetroot -solid "$WMII_BACKGROUND" # Clear the LBar and RBar find $WMII_DIR/{l,r}bar -type f -delete @@ -62,7 +61,7 @@ Event() { echo " -> Unmounting WMII_DIR=$WMII_DIR..." 9umount "$WMII_DIR" echo " -> Removing mountpoint WMII_DIR=$WMII_DIR..." - rmdir "$WMII_DIR";; + rmdir -p "$WMII_DIR" 2>/dev/null;; ## WMII-meta events Quit) ## No args echo ' ==> wmii quit: unmounting' @@ -241,8 +240,8 @@ Key() { Action() { local prog=$(path_which "$WMII_CONFPATH" "$1"); shift if [ -n "$prog" ]; then - "$prog" "$@" + exec "$prog" "$@" else - false + exec false fi } diff --git a/.config/wmii-hg/theme-tango b/.config/wmii-hg/theme-tango index e0e35d4..f4c20a2 100644 --- a/.config/wmii-hg/theme-tango +++ b/.config/wmii-hg/theme-tango @@ -7,4 +7,3 @@ TANGO_plum=( "#ad7fa8" "#75507b" "#5c3566") TANGO_red=( "#ef2929" "#cc0000" "#a40000") TANGO_alum=( "#eeeeec" "#d3d7cf" "#babdb6" "#888a85" "#555753" "#2e3436") - -- cgit v1.2.3 From fd40e4ddaefc70acb2cedcbe69bce49077a62376 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 29 Jan 2015 00:53:11 -0500 Subject: wmii: Make rbar way cooler --- .config/wmii-hg/config.sh | 6 +++++- .config/wmii-hg/rbar.sh | 18 +++++++++++++++++ .config/wmii-hg/rbar_acpi | 27 +++++++++++++------------ .config/wmii-hg/rbar_clock | 23 ++++++++++++---------- .config/wmii-hg/rbar_wifi | 49 ++++++++++++++++++++++++++++++++++------------ 5 files changed, 88 insertions(+), 35 deletions(-) create mode 100644 .config/wmii-hg/rbar.sh diff --git a/.config/wmii-hg/config.sh b/.config/wmii-hg/config.sh index d1da234..be75d65 100644 --- a/.config/wmii-hg/config.sh +++ b/.config/wmii-hg/config.sh @@ -154,7 +154,11 @@ Event() { ## RightBar events RightBarMouseDown) ## $1=button $2=bar_item - ;; + local button=$1 + local item=$2 + local name=${item#[0-9][0-9]_} + name=${name%.*} + Action "rbar_$name" "$button" & ;; RightBarClick) ## $1=button $2=bar_item ;; RightMouseDND) ## $1=button $2=bar_item diff --git a/.config/wmii-hg/rbar.sh b/.config/wmii-hg/rbar.sh new file mode 100644 index 0000000..8297b71 --- /dev/null +++ b/.config/wmii-hg/rbar.sh @@ -0,0 +1,18 @@ +#!/bin/bash +setup_trap() { + trap "rm -f -- ${HOME}/n/wmii*/rbar/${1}" EXIT +} + +write() { + dirs=("${HOME}"/n/wmii*/rbar/) + sponge|tee -a "${dirs[@]/%/${1}}" > /dev/null +} + +set -eE +shopt -s nullglob +case "$1" in + 1) left-click;; + 2) middle-click;; + 3) right-click;; + *) update "$1";; +esac diff --git a/.config/wmii-hg/rbar_acpi b/.config/wmii-hg/rbar_acpi index 1771875..bdcdf0f 100755 --- a/.config/wmii-hg/rbar_acpi +++ b/.config/wmii-hg/rbar_acpi @@ -1,15 +1,18 @@ #!/bin/bash -. include.sh -id=$1 -trap "rm -f ${WMII_DIR}/rbar/${id}.*" EXIT +update() { + id=$1 + setup_trap "${id}.*" -while connected_to_x_server; do - acpi -bt | sed -r \ - -e 's/^([A-Z])[a-z]+ ([0-9]+):/\1\2:/' \ - -e 's/\s*degrees\s*/°/g' | - cat -n | while read -r n line; do - printf "label %s\n" "$line" >> "${WMII_DIR}/rbar/${id}.${n}" - done - sleep 1 -done + while true; do + acpi -bt | sed -r \ + -e 's/^([A-Z])[a-z]+ ([0-9]+):/\1\2:/' \ + -e 's/\s*degrees\s*/°/g' | + cat -n | while read -r n line; do + printf "label %s\n" "$line" | write "${id}.${n}" + done + sleep 1 + done +} + +. "$(dirname "$0")/rbar.sh" diff --git a/.config/wmii-hg/rbar_clock b/.config/wmii-hg/rbar_clock index c1692da..a09f016 100755 --- a/.config/wmii-hg/rbar_clock +++ b/.config/wmii-hg/rbar_clock @@ -1,13 +1,16 @@ #!/bin/bash -. include.sh -id=$1 -trap "rm -f ${WMII_DIR}/rbar/${id}" EXIT +update() { + id=$1 + setup_trap "$id" -while connected_to_x_server; do - { - printf 'label ' - date +'%a, %F %T %Z(%:::z)' - } |sponge >> "${WMII_DIR}/rbar/${id}" - sleep .5 -done + while true; do + { + printf 'label ' + date +'%a, %F %T %Z(%:::z)' + } | write "$id" + sleep .5 + done +} + +. "$(dirname "$0")/rbar.sh" diff --git a/.config/wmii-hg/rbar_wifi b/.config/wmii-hg/rbar_wifi index 53464dc..63dc653 100755 --- a/.config/wmii-hg/rbar_wifi +++ b/.config/wmii-hg/rbar_wifi @@ -1,11 +1,7 @@ #!/bin/bash -. include.sh - -id=$1 -trap "rm -f ${WMII_DIR}/rbar/${id}" EXIT iwinfo() { - interface=$1 + local interface=$1 iwconfig "$interface" | sed -r 's/ {2,}/\n/g' | sed -e '/^\s*$/d' -e 's/:\s*/=/' \ @@ -13,10 +9,39 @@ iwinfo() { -e '2s/^/MAC Protocol=/' } -while connected_to_x_server; do - { - printf 'label ' - iwinfo wlp2s0|grep -E '^(ESSID|Link Quality)='|sed 'N;s/\n/ | /' - } | sponge >> "${WMII_DIR}/rbar/${id}" - sleep 1 -done +update() { + local id + id=$1 + setup_trap "$id" + while true; do + { + printf 'label ' + iwinfo wlp2s0|grep -E '^(ESSID|Link Quality)='|sed 'N;s/\n/ | /' + } | write "$id" + sleep 1 + done +} + +right-click() { + local list cur item + + list=() + IFS='' + while read -r line; do + list+=("$line") + done < <(netctl-auto list | sed 's,$,$,' | column -s '$' -t) + + cur='' + for item in "${list[@]}"; do + if [[ "$item" = '* '* ]]; then + cur="$item" + fi + done + + item=$(wmii9menu -i "$cur" "${list[@]}") + if [[ -n $item ]] && [[ "$item" != '* '* ]]; then + netctl-auto switch-to "$item" + fi +} + +. "$(dirname "$0")/rbar.sh" -- cgit v1.2.3 From 5bba26995f6431f00f17a7a0eef8940b94ddbfd8 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 29 Jan 2015 00:53:48 -0500 Subject: ssh: X11 forward to build64-par when near by default --- .config/ssh/config | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.config/ssh/config b/.config/ssh/config index 7d7704e..7bab06d 100644 --- a/.config/ssh/config +++ b/.config/ssh/config @@ -28,6 +28,8 @@ Host lukeshu.com Host build64-par Port 22 User luke + ForwardX11 yes + ForwardX11Trusted yes Host build64-par-far Port 1864 -- cgit v1.2.3 From f565769cdc68b24343ce2d3dbf4e322fad3a6c20 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 29 Jan 2015 00:54:28 -0500 Subject: gpg-agent stuff is no longer nescessary --- .config/systemd/user/default.target.wants/gpg-agent.service | 1 - .config/systemd/user/gpg-agent.service | 9 --------- 2 files changed, 10 deletions(-) delete mode 120000 .config/systemd/user/default.target.wants/gpg-agent.service delete mode 100644 .config/systemd/user/gpg-agent.service diff --git a/.config/systemd/user/default.target.wants/gpg-agent.service b/.config/systemd/user/default.target.wants/gpg-agent.service deleted file mode 120000 index 5727454..0000000 --- a/.config/systemd/user/default.target.wants/gpg-agent.service +++ /dev/null @@ -1 +0,0 @@ -/home/lukeshu-parabola/.config/systemd/user/gpg-agent.service \ No newline at end of file diff --git a/.config/systemd/user/gpg-agent.service b/.config/systemd/user/gpg-agent.service deleted file mode 100644 index 93c12b0..0000000 --- a/.config/systemd/user/gpg-agent.service +++ /dev/null @@ -1,9 +0,0 @@ -[Unit] -Description="GnuPG agent daemon" - -[Service] -Type=forking -ExecStart=/usr/bin/gpg-agent --daemon --write-env-file ${XDG_RUNTIME_DIR}/gpg - -[Install] -WantedBy=default.target -- cgit v1.2.3 From 2a6dc16a75f4d7beed631d97a99b6a1fc82c4e79 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 29 Jan 2015 01:19:57 -0500 Subject: split login.sh into login.d --- .config/cron/make-config | 2 +- .config/login.d/00_coredumps.sh | 1 + .config/login.d/00_path.sh | 9 ++++ .config/login.d/00_umask.sh | 1 + .config/login.d/01_xdg.sh | 44 ++++++++++++++++++ .config/login.d/02_tmpdir.sh | 3 ++ .config/login.d/10_gpg.sh | 3 ++ .config/login.d/10_java.sh | 6 +++ .config/login.d/10_selected-editor.sh | 7 +++ .config/login.d/10_spell-check.sh | 3 ++ .config/login.d/10_xauthority.sh | 4 ++ .config/login.d/90_dot-runtime.sh | 1 + .config/login.sh | 84 ++--------------------------------- .local/lib/path.sh | 9 ---- .local/lib/xdg.sh | 44 ------------------ 15 files changed, 87 insertions(+), 134 deletions(-) create mode 100644 .config/login.d/00_coredumps.sh create mode 100644 .config/login.d/00_path.sh create mode 100644 .config/login.d/00_umask.sh create mode 100644 .config/login.d/01_xdg.sh create mode 100644 .config/login.d/02_tmpdir.sh create mode 100644 .config/login.d/10_gpg.sh create mode 100644 .config/login.d/10_java.sh create mode 100644 .config/login.d/10_selected-editor.sh create mode 100644 .config/login.d/10_spell-check.sh create mode 100644 .config/login.d/10_xauthority.sh create mode 100644 .config/login.d/90_dot-runtime.sh delete mode 100644 .local/lib/path.sh delete mode 100644 .local/lib/xdg.sh diff --git a/.config/cron/make-config b/.config/cron/make-config index 9ac5ac2..d079c92 100644 --- a/.config/cron/make-config +++ b/.config/cron/make-config @@ -1,2 +1,2 @@ #m h dom mon dow command -*/5 * * * * cronic bash -c '. $HOME/.local/lib/path.sh && . $HOME/.local/lib/xdg.sh && make -C $XDG_CONFIG_HOME' +*/5 * * * * cronic bash -l -c 'make -C "$XDG_CONFIG_HOME"' diff --git a/.config/login.d/00_coredumps.sh b/.config/login.d/00_coredumps.sh new file mode 100644 index 0000000..8fcc61b --- /dev/null +++ b/.config/login.d/00_coredumps.sh @@ -0,0 +1 @@ +ulimit -c unlimited # save core dumps diff --git a/.config/login.d/00_path.sh b/.config/login.d/00_path.sh new file mode 100644 index 0000000..a45f8fd --- /dev/null +++ b/.config/login.d/00_path.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +if type config-path &>/dev/null; then + config_path=config-path +else + # Bootstrap finding config-path + config_path="$HOME/.local/bin/config-path" +fi +eval "$("$config_path" | sed 's/^/export /')" diff --git a/.config/login.d/00_umask.sh b/.config/login.d/00_umask.sh new file mode 100644 index 0000000..8e71ad5 --- /dev/null +++ b/.config/login.d/00_umask.sh @@ -0,0 +1 @@ +umask 022 diff --git a/.config/login.d/01_xdg.sh b/.config/login.d/01_xdg.sh new file mode 100644 index 0000000..2e0b42c --- /dev/null +++ b/.config/login.d/01_xdg.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# This should be readable by /bin/sh, but I'm going to assume bash. + +# Sets up XDG environmental variables, so programs using them don't have to +# worry about checking if they are set. +# http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html + +[[ -n $XDG_DATA_HOME ]] || export XDG_DATA_HOME="$HOME/.local/share" +[[ -n $XDG_CONFIG_HOME ]] || export XDG_CONFIG_HOME="$HOME/.config" +[[ -n $XDG_DATA_DIRS ]] || export XDG_DATA_DIRS="/usr/local/share/:/usr/share/" +[[ -n $XDG_CONFIG_DIRS ]] || export XDG_CONFIG_DIRS="/etc/xdg" +[[ -n $XDG_CACHE_HOME ]] || export XDG_CACHE_HOME="$HOME/.cache" + +# Check if XDG_RUNTIME_DIR is set, but has a bogus setting +if [[ -n $XDG_RUNTIME_DIR ]] && [[ ! -d $XDG_RUNTIME_DIR ]]; then + unset XDG_RUNTIME_DIR +fi + +# Set XDG_RUNTIME_DIR if we can +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" + readonly XDG_RUNTIME_DIR + # There's a race condition here, between the `ln -s` and `flock`. + # But it's not like I'll be hammering a box with logins. + if [[ ! -d "$XDG_CACHE_HOME" ]]; then + local tmp="$(mktemp --tmpdir -- "${USER}@${HOSTNAME}-runtime.XXXXXXXXXX")" + mkdir -p -- "$XDG_CACHE_HOME/xdg-runtime-dir" + ln -sfT -- "$tmp" "$XDG_RUNTIME_DIR" + fi + if ! [[ /dev/fd/7 -ef "$XDG_CACHE_HOME/xdg-runtime-dir/.lock" ]]; then + exec 7 >"$XDG_CACHE_HOME/xdg-runtime-dir/.lock" + fi + if flock -sn 7; then + trap _diy_xdg_runtime_logout EXIT + fi + } + _diy_xdg_runtime_logout() { + if flock -xn 7; then + rm -rf -- "$(readlink "$XDG_RUNTIME_DIR")" + fi + } + _diy_xdg_runtime_login +fi diff --git a/.config/login.d/02_tmpdir.sh b/.config/login.d/02_tmpdir.sh new file mode 100644 index 0000000..d0079aa --- /dev/null +++ b/.config/login.d/02_tmpdir.sh @@ -0,0 +1,3 @@ +mkdir -p -- "$XDG_RUNTIME_DIR/tmpdir" +export TMPDIR="$XDG_RUNTIME_DIR/tmpdir" +ln -sfT -- "$TMPDIR" "$HOME/tmp" diff --git a/.config/login.d/10_gpg.sh b/.config/login.d/10_gpg.sh new file mode 100644 index 0000000..cf3c88c --- /dev/null +++ b/.config/login.d/10_gpg.sh @@ -0,0 +1,3 @@ +if [[ -z $GPGKEY ]] && [[ -f "${HOME}/.gnupg/gpg.conf" ]]; then + export GPGKEY=`sed -nr 's/^\s*default-key\s+//p' "${GNUPG_HOME:-${HOME}/.gnupg}/gpg.conf"` +fi diff --git a/.config/login.d/10_java.sh b/.config/login.d/10_java.sh new file mode 100644 index 0000000..3c49368 --- /dev/null +++ b/.config/login.d/10_java.sh @@ -0,0 +1,6 @@ +_JAVA_OPTIONS='' +_JAVA_OPTIONS+=' -Dawt.useSystemAAFontSettings=on' +_JAVA_OPTIONS+=' -Dswing.aatext=true' +_JAVA_OPTIONS+=' -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel' +_JAVA_OPTIONS+=" -Djava.io.tmpdir=$TMPDIR" +export _JAVA_OPTIONS diff --git a/.config/login.d/10_selected-editor.sh b/.config/login.d/10_selected-editor.sh new file mode 100644 index 0000000..f176b8a --- /dev/null +++ b/.config/login.d/10_selected-editor.sh @@ -0,0 +1,7 @@ +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 diff --git a/.config/login.d/10_spell-check.sh b/.config/login.d/10_spell-check.sh new file mode 100644 index 0000000..9a24b7e --- /dev/null +++ b/.config/login.d/10_spell-check.sh @@ -0,0 +1,3 @@ +if [[ -z "$DICTIONARY" ]] && [[ -n "$LANG" ]]; then + export DICTIONARY="${LANG%%.*}" +fi diff --git a/.config/login.d/10_xauthority.sh b/.config/login.d/10_xauthority.sh new file mode 100644 index 0000000..a27202c --- /dev/null +++ b/.config/login.d/10_xauthority.sh @@ -0,0 +1,4 @@ +# This was needed once with SSH and Fedora boxes. +if [[ -z $XAUTHORITY ]]; then + export XAUTHORITY="$HOME/.Xauthority" +fi diff --git a/.config/login.d/90_dot-runtime.sh b/.config/login.d/90_dot-runtime.sh new file mode 100644 index 0000000..d597cc7 --- /dev/null +++ b/.config/login.d/90_dot-runtime.sh @@ -0,0 +1 @@ +ln -sfT -- "$XDG_RUNTIME_DIR" ~/.runtime diff --git a/.config/login.sh b/.config/login.sh index 392dc88..b2cc80a 100644 --- a/.config/login.sh +++ b/.config/login.sh @@ -10,84 +10,8 @@ # the default umask is set in /etc/profile; for setting the umask # for ssh logins, install and configure the libpam-umask package. -umask 022 -ulimit -c unlimited # save core dumps -## Paths ############################################################# - -. "$HOME/.local/lib/path.sh" - -# 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" -ln -sfT -- "$XDG_RUNTIME_DIR" ~/.runtime - -# Settings ########################################################### - -# Spell check -if [[ -z "$DICTIONARY" ]] && [[ -n "$LANG" ]]; then - export DICTIONARY="${LANG%%.*}" -fi - -# 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 - echo 'login: Setting GPGKEY' - export GPGKEY=`sed -nr 's/^\s*default-key\s+//p' "${HOME}/.gnupg/gpg.conf"` -fi -if [[ -f ~/.runtime/gpg ]]; then - echo 'login: Setting gpg-agent info:' - cat ~/.runtime/gpg - . ~/.runtime/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" - #export XAUTHORITY=$HOME/.runtime/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 +for file in "${XDG_CONFIG_HOME:-$HOME/.config}/login.d/"*.sh; do + . "$file" +done +unset file diff --git a/.local/lib/path.sh b/.local/lib/path.sh deleted file mode 100644 index a45f8fd..0000000 --- a/.local/lib/path.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -if type config-path &>/dev/null; then - config_path=config-path -else - # Bootstrap finding config-path - config_path="$HOME/.local/bin/config-path" -fi -eval "$("$config_path" | sed 's/^/export /')" diff --git a/.local/lib/xdg.sh b/.local/lib/xdg.sh deleted file mode 100644 index 20fab4b..0000000 --- a/.local/lib/xdg.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash -# This should be readable by /bin/sh, but I'm going to assume bash. - -# Sets up XDG environmental variables, so programs using them don't have to -# worry about checking if they are set. -# http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html - -[[ -n $XDG_DATA_HOME ]] || export XDG_DATA_HOME="$HOME/.local/share" -[[ -n $XDG_CONFIG_HOME ]] || export XDG_CONFIG_HOME="$HOME/.config" -[[ -n $XDG_DATA_DIRS ]] || export XDG_DATA_DIRS="/usr/local/share/:/usr/share/" -[[ -n $XDG_CONFIG_DIRS ]] || export XDG_CONFIG_DIRS="/etc/xdg" -[[ -n $XDG_CACHE_HOME ]] || export XDG_CACHE_HOME="$HOME/.cache" - -# Check if XDG_RUNTIME_DIR is set, but has a bogus setting -if [[ -n $XDG_RUNTIME_DIR ]] && [[ ! -d $XDG_RUNTIME_DIR ]]; then - unset XDG_RUNTIME_DIR -fi - -# Set XDG_RUNTIME_DIR if we can -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" - readonly XDG_RUNTIME_DIR - # There's a race condition here, between the `ln -s` and `flock`. - # But it's not like I'll be hammering a box with logins. - if [[ ! -d "$XDG_CACHE_HOME" ]]; then - local tmp="$(mktemp --tmpdir -- "${USER}@${HOSTNAME}-runtime.XXXXXXXXXX")" - mkdir -p -- "$XDG_CACHE_HOME/xdg-runtime-dir" - ln -sfT -- "$tmp" "$XDG_RUNTIME_DIR" - fi - if ! [[ /dev/fd/7 -ef "$XDG_CACHE_HOME/xdg-runtime-dir/.lock" ]]; then - exec 7 >"$XDG_CACHE_HOME/xdg-runtime-dir/.lock" - fi - if flock -sn 7; then - trap _diy_xdg_runtime_logout EXIT - fi - } - _diy_xdg_runtime_logout() { - if flock -xn 7; then - rm -rf -- "$(readlink "$XDG_RUNTIME_DIR")" - fi - } - _diy_xdg_runtime_login -fi -- cgit v1.2.3 From 34bbf66a460e5c622e209211869b3a8bde8a68d5 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 29 Jan 2015 01:31:57 -0500 Subject: change the x0vncserver service unit to match the others --- .config/systemd/user/wmii@.service.wants/x0vncserver@.service | 1 + .config/systemd/user/x0vncserver@.service | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) create mode 120000 .config/systemd/user/wmii@.service.wants/x0vncserver@.service diff --git a/.config/systemd/user/wmii@.service.wants/x0vncserver@.service b/.config/systemd/user/wmii@.service.wants/x0vncserver@.service new file mode 120000 index 0000000..bc3be20 --- /dev/null +++ b/.config/systemd/user/wmii@.service.wants/x0vncserver@.service @@ -0,0 +1 @@ +../x0vncserver@.service \ No newline at end of file diff --git a/.config/systemd/user/x0vncserver@.service b/.config/systemd/user/x0vncserver@.service index 99e897c..476e822 100644 --- a/.config/systemd/user/x0vncserver@.service +++ b/.config/systemd/user/x0vncserver@.service @@ -3,8 +3,5 @@ Description=VNC server for X displays [Service] Type=simple -ExecStart=/bin/bash -l -c 'x0vncserver display=:%I PasswordFile="${HOME}/.vnc/passwd"' +ExecStart=/usr/bin/x0vncserver display=%I PasswordFile=%h/.vnc/passwd Restart=always - -[Install] -WantedBy=default.target -- cgit v1.2.3