summaryrefslogtreecommitdiff
path: root/archive/bin
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2020-04-22 13:16:19 -0700
committerSean Whitton <spwhitton@spwhitton.name>2020-04-22 13:16:19 -0700
commitb45addaf1b954a77445f6e6ba7b5b3859daee33d (patch)
tree4d12b8172d66a6bc5d0ba2b7db30a98863ec85b8 /archive/bin
parentcb92043b165afb121225802cb997c460ef133861 (diff)
downloaddotfiles-b45addaf1b954a77445f6e6ba7b5b3859daee33d.tar.gz
get rid of additional archive/ dir
Diffstat (limited to 'archive/bin')
-rwxr-xr-xarchive/bin/bytecompile-emacsd32
-rwxr-xr-xarchive/bin/new_goodmorning38
-rwxr-xr-xarchive/bin/xmousetidy6
3 files changed, 76 insertions, 0 deletions
diff --git a/archive/bin/bytecompile-emacsd b/archive/bin/bytecompile-emacsd
new file mode 100755
index 00000000..7e0e5b03
--- /dev/null
+++ b/archive/bin/bytecompile-emacsd
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+# Byte-compile lisp files in ~/.emacs.d
+
+# `batch-byte-compile' doesn't recurse, but the layout of my
+# ~/.emacs.d means it doesn't need to -- see comments near top of
+# ~/.emacs.d/init.el
+
+# Don't use -q or -Q so that my load-path gets set correctly by
+# ~/.emacs.d/init.el, with Debian packages taking precedence
+
+# The big problem with this script is that there is no arrangement for
+# recompilation when, e.g., the version of Emacs installed on the
+# system changes
+
+set -e
+
+if which emacs >/dev/null 2>&1; then
+ if which chronic >/dev/null 2>&1; then
+ chronic emacs -L $HOME/.emacs.d/initlibs \
+ --batch --eval "(batch-byte-compile t)" \
+ $HOME/.emacs.d/*.el $HOME/.emacs.d/*/*.el
+
+ # a byte-compiled init file is inconvenient because it gets
+ # loaded before `load-prefer-newer' is set
+ rm $HOME/.emacs.d/init.elc
+ else
+ echo >&2 "W: not byte-compiling ~/.emacs.d: chronic unavailable"
+ fi
+else
+ echo >&2 "W: not byte-compiling ~/.emacs.d: Emacs unavailable"
+fi
diff --git a/archive/bin/new_goodmorning b/archive/bin/new_goodmorning
new file mode 100755
index 00000000..4e77901a
--- /dev/null
+++ b/archive/bin/new_goodmorning
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+. $HOME/.shenv
+
+# ---- CONFIG ----
+
+MUSIC="$(echo ~/lib/annex/doc/sounds/m*.mp3)"
+
+# ---- TASKS THAT SHOULD ALWAYS HAPPEN ----
+
+#movemymail
+
+# ---- TASKS THAT SHOULD HAPPEN ONLY IF LID IS CLOSED ----
+
+if grep -q open /proc/acpi/button/lid/LID/state; then
+ exit 0
+fi
+if ! [ -f "$MUSIC" ]; then
+ echo >&2 "no music to play"
+ exit 1
+fi
+
+# also see
+# https://github.com/sm-Fifteen/systemd-alarm/blob/master/alarmclock
+# for how to point all sources at the right sink if that becomes an
+# issue (e.g. if I habitually leave headphones plugged in)
+pactl set-sink-mute @DEFAULT_SINK@ 0
+pactl set-sink-volume @DEFAULT_SINK@ 100%
+ffplay "$MUSIC" -loop 0 -nodisp -loglevel quiet &
+music_pid=$!
+# TODO ignore the lid's state unless it was closed when this script
+# started? that would mean this script works on non-laptops too, and
+# on laptop if I suspend it with its lid open
+while grep -q closed /proc/acpi/button/lid/LID/state \
+ && acpi -a | grep -q on-line; do
+ sleep 0.5
+done
+kill $music_pid
diff --git a/archive/bin/xmousetidy b/archive/bin/xmousetidy
new file mode 100755
index 00000000..004c0998
--- /dev/null
+++ b/archive/bin/xmousetidy
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+xdotool mousemove \
+ $(xdpyinfo | \
+ perl -wne 'next unless /dimensions: ([0-9]+)x([0-9]+)/;
+ print "$1 $2"; exit')