summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-04-14 12:25:16 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2017-04-14 12:25:16 -0400
commit41a3b584a31b708e0f5c5d45ecd258937cc0a1b1 (patch)
treef99300ded37bcb726d9c0b6327e91ef04252a852
parent94c9bdc5f7e832982947c903c258ea651e27c378 (diff)
parent05b500a6688c7a7ff9a04fe748a091d33df654a9 (diff)
Merge branch 'master' into build64-par/master
-rw-r--r--.config/bash/rc.d/10_aliases.sh9
-rw-r--r--.config/bash/rc.d/10_no_histexpand.sh4
-rw-r--r--.config/dunst/dunstrc4
-rw-r--r--.config/emacs/init.el36
-rw-r--r--.config/git/config2
-rw-r--r--.config/ssh/config11
-rw-r--r--.config/wmii-hg/config.sh29
-rwxr-xr-x.config/wmii-hg/rbar_acpi3
-rwxr-xr-x.config/wmii-hg/rbar_clock2
-rwxr-xr-x.config/wmii-hg/rbar_wifi11
-rwxr-xr-x.local/bin/config-path5
-rwxr-xr-x.local/bin/iwdata8
-rwxr-xr-x.local/bin/xrotate119
13 files changed, 205 insertions, 38 deletions
diff --git a/.config/bash/rc.d/10_aliases.sh b/.config/bash/rc.d/10_aliases.sh
index 2e28a5d..c3766da 100644
--- a/.config/bash/rc.d/10_aliases.sh
+++ b/.config/bash/rc.d/10_aliases.sh
@@ -100,8 +100,12 @@ alias l='ls -CF'
alias tree='tree --charset utf8'
alias cd=pushd
alias gitk='gitk --all --date-order'
-alias userctl='systemctl --user'
alias mv='mv -i'
+alias bc='bc -q'
+
+alias userctl='systemctl --user'
+alias journalctl='journalctl --no-hostname' # I know what host I'm on
+alias datetimectl=timedatectl # I forget which it is
######################################################################
# These are actually functions :P #
@@ -175,3 +179,6 @@ jarmain() {
grep -E '(^[a-z]|public static void main\(java\.lang\.String\[\]\))' |
grep -B1 '^ '
}
+calc() {
+ bc <<<"$*"
+}
diff --git a/.config/bash/rc.d/10_no_histexpand.sh b/.config/bash/rc.d/10_no_histexpand.sh
new file mode 100644
index 0000000..985b03d
--- /dev/null
+++ b/.config/bash/rc.d/10_no_histexpand.sh
@@ -0,0 +1,4 @@
+#!/hint/bash
+
+# Turn off (csh-style) '!' history expansion
+set +o histexpand
diff --git a/.config/dunst/dunstrc b/.config/dunst/dunstrc
index fc93a12..cf99d48 100644
--- a/.config/dunst/dunstrc
+++ b/.config/dunst/dunstrc
@@ -12,8 +12,8 @@
# %p progress value if set ([ 0%] to [100%]) or nothing
# Message format
- format = "<b>%s</b>\n%b"
- allow_markup = yes
+ markup = full # full:render-html strip:strip-html no:plaintext
+ format = "%a: <b>%s</b>\n%b"
ignore_newline = no
# Message word-wrap/scroll
word_wrap = yes # Split lines...
diff --git a/.config/emacs/init.el b/.config/emacs/init.el
index b7ee6df..200daad 100644
--- a/.config/emacs/init.el
+++ b/.config/emacs/init.el
@@ -2,19 +2,21 @@
;; Hey, Emacs: -*- Indent-tabs-mode: nil -*-
;; Without (advice-add) it should work in older versions of 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")
- ido-save-directory-list-file (concat xdg-cache-home "emacs/ido.last.el")
- el-get-dir (concat xdg-cache-home "emacs/el-get/")
- eshell-directory-name (concat xdg-cache-home "emacs/eshell/")
- wl-score-files-directory (concat xdg-cache-home "emacs/wl-score-files/")
- elmo-msgdb-directory (concat xdg-cache-home "emacs/elmo-msgdb/")
- elmo-cache-directory (concat xdg-cache-home "emacs/elmo-cache/")
- auto-save-list-file-prefix (concat xdg-cache-home "emacs/auto-save-list/saves-")
- tramp-persistency-file-name (concat xdg-cache-home "emacs/tramp-cache.el")
- wl-init-file (concat user-emacs-directory "wl.el")
- )
+(let ((xdg-cache-home (file-name-as-directory (or (getenv "XDG_CACHE_HOME") "~/.cache")))
+ (xdg-data-home (file-name-as-directory (or (getenv "XDG_DATA_HOME") "~/.local/share"))))
+ (setq
+ wl-init-file (concat user-emacs-directory "wl.el")
+ eshell-directory-name (concat xdg-data-home "emacs/eshell/") ;; actually should be split between config and data
+ ido-save-directory-list-file (concat xdg-data-home "emacs/ido.last.el")
+
+ package-user-dir (concat xdg-cache-home "emacs/elpa")
+ el-get-dir (concat xdg-cache-home "emacs/el-get/")
+ wl-score-files-directory (concat xdg-cache-home "emacs/wl-score-files/")
+ elmo-msgdb-directory (concat xdg-cache-home "emacs/elmo-msgdb/")
+ elmo-cache-directory (concat xdg-cache-home "emacs/elmo-cache/")
+ auto-save-list-file-prefix (concat xdg-cache-home "emacs/auto-save-list/saves-")
+ tramp-persistency-file-name (concat xdg-cache-home "emacs/tramp-cache.el")
+ ))
(setq custom-file (concat user-emacs-directory "custom.el"))
(load custom-file 'noerror)
@@ -71,6 +73,7 @@
(smart-tabs-mode 1)
(apply 'smart-tabs-insinuate
(mapcar 'car smart-tabs-insinuate-alist))))
+(use-package editorconfig)
;; Major modes
(use-package bison-mode
:mode (("\\.l\\'" . bison-mode)
@@ -95,7 +98,7 @@
;; '(lambda ()
;; (c-set-offset 'cpp-macro 0)
;; )))
-(use-package php-mode :mode ("\\.php[s345t]?\\'" "/\\.php_cs\\(\\.dist\\)?\\'" "\\.phtml\\'" "/Amkfile\\'" "\\.amk\\'"))
+(use-package cmake-mode :mode ("CMakeLists\\.txt\\'" "\\.cmake\\'"))
(use-package glsl-mode :mode ("\\.vert\\'" "\\.frag\\'" "\\.geom\\'" "\\.glsl\\'"))
(use-package go-mode :mode "\\.go\\'")
(use-package graphviz-dot-mode :mode ("\\.dot\\'" "\\.gv\\'"))
@@ -103,6 +106,7 @@
(use-package less-css-mode :mode "\\.less\\'")
(use-package markdown-mode :mode ("\\.markdown\\'" "\\.md\\'" "\\.ronn\\'"))
(use-package nginx-mode :mode ("nginx\\.conf\\'" "/nginx/.+\\.conf\\'"))
+(use-package php-mode :mode ("\\.php[s345t]?\\'" "/\\.php_cs\\(\\.dist\\)?\\'" "\\.phtml\\'" "/Amkfile\\'" "\\.amk\\'"))
(use-package scss-mode :mode "\\.scss\\'")
(use-package yaml-mode :mode "\\.e?ya?ml\\'")
@@ -179,6 +183,10 @@ sh-script.el is broken."
(if xterm-mouse-mode (xterm-mouse-mode 1))
)))
+;; Make TRAMP obey ~/.ssh/config for ControlMaster. For some reason,
+;; customize doesn't correctly set this.
+(setq tramp-use-ssh-controlmaster-options nil)
+
;; Use mailcrypt to encrypt/decrypt email
(when (require 'mailcrypt nil t)
(mc-setversion "gpg")
diff --git a/.config/git/config b/.config/git/config
index 2e85773..3404c0c 100644
--- a/.config/git/config
+++ b/.config/git/config
@@ -6,6 +6,6 @@
[push]
default = matching
[alias]
- lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
+ lg = log --graph --format='%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
hist = log --format='%h %ci -%C(yellow)%d%Creset %s %C(bold blue)<%an>%Creset' --abbrev-commit
graphviz = "!f() { echo 'digraph git {' ; git log --pretty='format: %h -> { %p }' \"$@\" | sed 's/[0-9a-f][0-9a-f]*/\"&\"/g' ; echo '}'; }; f"
diff --git a/.config/ssh/config b/.config/ssh/config
index 9dbf510..0703fb2 100644
--- a/.config/ssh/config
+++ b/.config/ssh/config
@@ -3,6 +3,8 @@ Host *
ControlMaster auto
ControlPath ~/.r/%l/ssh-%r@%h:%p
Compression yes
+ #ProxyCommand proxytunnel --proxy=lukeshu.com:8443 --proxyauth=frc4272:password --encrypt-proxy --dest=%h:%p
+ #ProxyCommand proxytunnel --proxy=lukeshu.com:8080 --proxyauth=frc4272:password --dest=%h:%p
# Purdue ###################################################
@@ -20,12 +22,13 @@ Host parabola.nu *.parabola.nu
# Personal #################################################
-Host lukeshu.com
+Host lukeshu.com *.lukeshu.com
Port 1863
User lukeshu
-Host ssl.lukeshu.com
+
+Host team4272.com
+ Port 1863
User lukeshu
- ProxyCommand proxytunnel --proxy=lukeshu.com:8443 --proxyauth=frc4272:password --encrypt-proxy --dest=lukeshu.com:1863
Match host build64-par exec "nslookup %n.lan."
HostName build64-par
@@ -37,6 +40,6 @@ Host build64-par
ForwardX11 yes
ForwardX11Trusted yes
-Host 192.168.*.1 10.*
+Host 192.168.*.1 10.* 169.254.* roborio-*-frc.local
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
diff --git a/.config/wmii-hg/config.sh b/.config/wmii-hg/config.sh
index 1b48cc4..e56166e 100644
--- a/.config/wmii-hg/config.sh
+++ b/.config/wmii-hg/config.sh
@@ -123,13 +123,17 @@ Event() {
2) ;;
3)
{
- case $(wmii9menu Delete Fullscreen ToggleFloat) in
+ case $(wmii9menu Delete Fullscreen ToggleFloat SendLeft SendRight) in
Delete)
echo kill >> $WMII_DIR/client/$client/ctl;;
Fullscreen)
echo Fullscreen on >> $WMII_DIR/client/$client/ctl;;
ToggleFloat)
echo send $client toggle >> $WMII_DIR/tag/sel/ctl;;
+ SendLeft)
+ echo send sel left >> $WMII_DIR/tag/sel/ctl;;
+ SendRight)
+ echo send sel right >> $WMII_DIR/tag/sel/ctl;;
esac
}& ;;
4) ;;
@@ -263,6 +267,28 @@ Key() {
sel=$(sed 1q $WMII_DIR/client/sel/ctl)
tag=$(lstags | wimenu -h "${HIST}.tags" -n 50) || return
echo "$tag" >> $WMII_DIR/client/$sel/tags;;
+
+ ## Hardware keys
+ XF86RotateWindows) ## Toggle between 'normal' an 'right'
+ local old new
+ old="$(xrotate|cut -d $'\t' -f3|sort -u)"
+ case "$old" in
+ normal) new=right;;
+ *) new=normal;;
+ esac
+ xrotate "$new"
+ ;;
+ $MODKEY-XF86RotateWindows) ## Rotate in 90° steps
+ local old new
+ old="$(xrotate|cut -d $'\t' -f3|sort -u)"
+ case "$old" in
+ normal) new=right;;
+ right) new=inverted;;
+ inverted) new=left;;
+ left) new=normal;;
+ esac
+ xrotate "$new"
+ ;;
esac
}
@@ -270,6 +296,7 @@ runcmd() (
PATH=$_PATH
unset NOTIFY_SOCKET # systemd
unset WMII_CONFPATH # wmii
+ unset WMII_ADDRESS # wmii
unset _PATH WMII_NAMESPACE WMII_DIR # wmiirc
exec 8>&- # xinit/systemd handshake
exec systemd-run --user --scope -- sh -c "$*"
diff --git a/.config/wmii-hg/rbar_acpi b/.config/wmii-hg/rbar_acpi
index 24742f8..9c557e0 100755
--- a/.config/wmii-hg/rbar_acpi
+++ b/.config/wmii-hg/rbar_acpi
@@ -15,7 +15,8 @@ update() {
-e 's/\s*remaining//g' \
-e 's/\s*until charged//g' \
-e 's/charging at zero rate - will never fully charge./∞/g' \
- -e 's/\s*ok,\s*//g' |
+ -e 's/\s*ok,\s*//g' \
+ -e 's/\s+//g' |
cat -n | while read -r n line; do
printf "label %s\n" "$line" | write "${id}.${n}"
done
diff --git a/.config/wmii-hg/rbar_clock b/.config/wmii-hg/rbar_clock
index e84d5c3..c66b21e 100755
--- a/.config/wmii-hg/rbar_clock
+++ b/.config/wmii-hg/rbar_clock
@@ -7,7 +7,7 @@ update() {
while true; do
{
printf 'label '
- date +'%a, %F %T %Z(%:::z)'
+ date +'%a %F %T %Z(%:::z)'
} | write "$id"
sleep .5
done
diff --git a/.config/wmii-hg/rbar_wifi b/.config/wmii-hg/rbar_wifi
index d201152..e740777 100755
--- a/.config/wmii-hg/rbar_wifi
+++ b/.config/wmii-hg/rbar_wifi
@@ -1,14 +1,5 @@
#!/usr/bin/env bash
-iwinfo() {
- local interface=$1
- iwconfig "$interface" |
- sed -r 's/ {2,}/\n/g' |
- sed -e '/^\s*$/d' -e 's/:\s*/=/' \
- -e '1s/^/Interface=/' \
- -e '2s/^/MAC Protocol=/'
-}
-
update() {
local iface=wlp2s0
@@ -18,7 +9,7 @@ update() {
while true; do
IFS=$'\n'
lines=($(
- iwinfo "$iface" | sed -rn 's@^(ESSID|Link Quality)=@@p'
+ iwdata "$iface" | sed -rn 's@^(ESSID|Link Quality)=@@p'
ifdata -pa "$iface"
))
IFS='|'
diff --git a/.local/bin/config-path b/.local/bin/config-path
index dcac0e8..cbecc95 100755
--- a/.local/bin/config-path
+++ b/.local/bin/config-path
@@ -9,6 +9,7 @@ prefixes=(
"$HOME/.prefix"
"$HOME"/.gem/ruby/*
"$HOME"/.npm-prefix
+ "$HOME"/go
)
in_array() {
@@ -50,7 +51,6 @@ main() {
IFS=:
# Import existing values
var_init PATH
- var_init MANPATH
var_init LD_LIBRARY_PATH
var_init PKG_CONFIG_PATH
var_init RUBYLIB
@@ -59,7 +59,6 @@ main() {
# Scan through prefixes
for prefix in "${prefixes[@]}"; do
var_add PATH "$prefix/bin" "$prefix/sbin"
- var_add MANPATH "$prefix/share/man"
var_add LD_LIBRARY_PATH "$prefix"/lib{,32,64}
var_add PKG_CONFIG_PATH "$prefix"/lib{,32,64}/pkgconfig
var_add RUBYLIB "$prefix"/lib{,32,64}
@@ -68,7 +67,7 @@ main() {
# Finally, print the values
lines=()
- for var in PATH MANPATH LD_LIBRARY_PATH PKG_CONFIG_PATH RUBYLIB PERL5LIB; do
+ for var in PATH LD_LIBRARY_PATH PKG_CONFIG_PATH RUBYLIB PERL5LIB; do
lines+=("$(var_done "$var")")
done
shopt -s extglob
diff --git a/.local/bin/iwdata b/.local/bin/iwdata
new file mode 100755
index 0000000..a631d6d
--- /dev/null
+++ b/.local/bin/iwdata
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+iwconfig "$1" |
+sed -r 's/ {2,}/\n/g' |
+sed -e '/^\s*$/d' -e 's/:\s*/=/' \
+ -e '1s/^/Interface=/' \
+ -e '2s/^/MAC Protocol=/' \
+ -e 's/^ESSID="\(.*\)"$/ESSID=\1/'
diff --git a/.local/bin/xrotate b/.local/bin/xrotate
new file mode 100755
index 0000000..c7d9f0d
--- /dev/null
+++ b/.local/bin/xrotate
@@ -0,0 +1,119 @@
+#!/usr/bin/env bash
+
+# xrandr (graphical output) ############################################
+type xrandr &>/dev/null && modules+=(xrandr)
+
+xrandr.get() {
+ # FIXME: I don't think simple column counting is reliable.
+ # I'll have to study the exact output format.
+ xrandr --query --verbose|awk -v OFS=$'\t' '/ connected /{print "xrandr", $1, $6}'
+}
+
+xrandr.set() {
+ xrandr --orientation "$1"
+}
+
+# xsetwacom (touchscreen input) ########################################
+type xsetwacom &>/dev/null && modules+=(xsetwacom)
+
+xsetwacom.get() {
+ local device
+ xsetwacom --list devices|cut -d $'\t' -f1|while read -r device; do
+ printf 'xsetwacom\t%s\t%s\n' "$device" "$(xsetwacom --get "$device" Rotate)"
+ done | sed -e $'s/\tnone$/\tnormal/' \
+ -e $'s/\tcw$/\tright/' \
+ -e $'s/\tccw$/\tleft/' \
+ -e $'s/\thalf$/\tinverted/'
+}
+
+xsetwacom.set() {
+ declare -A xrandr2wacom
+ xrandr2wacom[normal]=none
+ xrandr2wacom[left]=ccw
+ xrandr2wacom[right]=cw
+ xrandr2wacom[inverted]=half
+
+ local device
+ local r=0
+ xsetwacom --list devices|cut -d $'\t' -f1|while read -r device; do
+ xsetwacom --set "$device" Rotate ${xrandr2wacom[$1]} || r=$?
+ done
+ return $r
+}
+
+# xmodmap (D-pad input) ################################################
+type xmodmap &>/dev/null && modules+=(xmodmap)
+
+declare -A xrandr2xmodmap
+xrandr2xmodmap[keycode]=' 111 113 114 116 '
+xrandr2xmodmap[normal]=' Up Left Right Down '
+xrandr2xmodmap[left]=' Right Up Down Left '
+xrandr2xmodmap[right]=' Left Down Up Right'
+xrandr2xmodmap[inverted]='Down Right Left Up '
+
+xmodmap.get() {
+ local cur=malformed
+
+ local keys=($(xmodmap -pke | grep -f <(printf '^keycode %s =\n' ${xrandr2xmodmap[keycode]})|awk '{print $4}'))
+ local k
+ for k in normal left right inverted; do
+ if [[ "$(echo ${xrandr2xmodmap[$k]})" = "${keys[*]}" ]]; then
+ cur=$k
+ fi
+ done
+ printf 'xmodmap\t-\t%s\n' "$cur"
+}
+
+xmodmap.set() {
+ paste \
+ <(printf '%s\n' ${xrandr2xmodmap[keycode]}) \
+ <(printf '%s\n' ${xrandr2xmodmap[$1]}) \
+ | awk '{print "keycode", $1, "=", $2}' | xmodmap -
+}
+
+# main #################################################################
+
+usage() {
+ . libremessages
+ print 'Usage: %q [-h|--help|normal|left|right|inverted]' "${0##*/}"
+ print 'Get or set screen rotation.'
+ echo
+ prose 'Without any arguments, return the screen rotation as
+ reported by supported subsystems. The output format is:'
+ echo
+ print ' SUBSYSTEM <tab> DEVICE <tab> STATE <newline>'
+}
+
+xget() {
+ local r=0
+ local module
+ for module in "${modules[@]}"; do
+ "${module}.get" || r=$?
+ done
+ return $r
+}
+
+xset() {
+ local r=0
+ local module
+ for module in "${modules[@]}"; do
+ "${module}.set" "$1" || r=$?
+ done
+ return $r
+}
+
+main() {
+ case $# in
+ 0) xget;;
+ 1)
+ case "$1" in
+ normal|left|right|inverted) xset "$1";;
+ -h|--help) usage;;
+ *) usage >&2; exit 1;;
+ esac
+ ;;
+ *) usage >&2; exit 1;;
+ esac
+}
+
+main "$@"