diff options
-rw-r--r-- | .gitmodules | 3 | ||||
-rw-r--r-- | emacs/.emacs.d/init/ycp-org.el | 1 | ||||
-rw-r--r-- | emacs/.emacs.d/init/ycp-web.el | 9 | ||||
m--------- | emacs/.emacs.d/lisp/exitter | 0 | ||||
-rw-r--r-- | emacs/.emacs.d/lisp/my/my-org.el | 6 | ||||
-rw-r--r-- | misc-root/etc/tlp.conf | 4 | ||||
-rw-r--r-- | misc/.gdbinit | 4 | ||||
-rwxr-xr-x | misc/bin/switch-display.sh | 35 |
8 files changed, 60 insertions, 2 deletions
diff --git a/.gitmodules b/.gitmodules index 6917752..521bfd7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -118,3 +118,6 @@ [submodule "emacs/.emacs.d/lisp/bom.el"] path = emacs/.emacs.d/lisp/bom.el url = https://g.ypei.me/bom.el.git +[submodule "exitter"] + path = emacs/.emacs.d/lisp/exitter + url = https://g.ypei.me/exitter.git diff --git a/emacs/.emacs.d/init/ycp-org.el b/emacs/.emacs.d/init/ycp-org.el index 430335a..eb5a63d 100644 --- a/emacs/.emacs.d/init/ycp-org.el +++ b/emacs/.emacs.d/init/ycp-org.el @@ -498,6 +498,7 @@ (advice-add 'org-insert-structure-template :after 'my-org-edit-special) (advice-add 'org-edit-src-exit :before 'my-org-edit-src-before-exit) (advice-add 'org-edit-src-exit :after 'my-org-edit-src-after-exit) + (advice-add 'org-edit-special :after 'my-org-edit-special-after) (my-setq-from-local my-org-task-categories)) (my-package my-org diff --git a/emacs/.emacs.d/init/ycp-web.el b/emacs/.emacs.d/init/ycp-web.el index d188afd..7521afd 100644 --- a/emacs/.emacs.d/init/ycp-web.el +++ b/emacs/.emacs.d/init/ycp-web.el @@ -325,4 +325,13 @@ ) (require 'w3m-load)) +(my-package exitter + (:delay 60) + (my-setq-from-local + exitter-oauth-consumer-key exitter-oauth-consumer-secret + exitter-access-token exitter-username exitter-password exitter-email + exitter-oauth-token exitter-oauth-token-secret exitter-oauth-token-ctime) + (setq exitter-debug t) + ) + (provide 'ycp-web) diff --git a/emacs/.emacs.d/lisp/exitter b/emacs/.emacs.d/lisp/exitter new file mode 160000 +Subproject 2a528e8643612ece0561b2e30a63e63e0782c93 diff --git a/emacs/.emacs.d/lisp/my/my-org.el b/emacs/.emacs.d/lisp/my/my-org.el index 4fea460..698b0d3 100644 --- a/emacs/.emacs.d/lisp/my/my-org.el +++ b/emacs/.emacs.d/lisp/my/my-org.el @@ -1364,6 +1364,12 @@ With a prefix arg, yank and exit immediately." (yank)) (org-edit-src-exit)))) +;; used to add an :after advice to `org-edit-special'. +(defun my-org-edit-special-after (_) + ;; some modes (e.g. diff mode) are read-only by default, which + ;; does not make sense when the intention is to edit + (read-only-mode 0)) + (defun my-link-to-line-number-in-prog-mode () "When in prog-mode, use line number as search item." (when (derived-mode-p 'prog-mode) diff --git a/misc-root/etc/tlp.conf b/misc-root/etc/tlp.conf index f1019a0..e94042e 100644 --- a/misc-root/etc/tlp.conf +++ b/misc-root/etc/tlp.conf @@ -530,9 +530,9 @@ # Default: <none> # Battery charge level below which charging will begin. -START_CHARGE_THRESH_BAT0=75 +START_CHARGE_THRESH_BAT0=80 # Battery charge level above which charging will stop. -STOP_CHARGE_THRESH_BAT0=80 +STOP_CHARGE_THRESH_BAT0=90 # BAT1: Secondary / Ultrabay / Slice / Replaceable battery # Note: primary on some laptops diff --git a/misc/.gdbinit b/misc/.gdbinit index b2c8a1f..b84dbef 100644 --- a/misc/.gdbinit +++ b/misc/.gdbinit @@ -19,6 +19,10 @@ alias wl = watch -l alias awl = awatch -l alias rwl = rwatch -l alias rt = restart +define bc + b $arg0 + c +end # Print backtrace of all threads alias abt = thread apply all bt set history save on diff --git a/misc/bin/switch-display.sh b/misc/bin/switch-display.sh new file mode 100755 index 0000000..4c3cba6 --- /dev/null +++ b/misc/bin/switch-display.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +logger "$1" "$2" "$3" +# Switch to the biggest display available. for use as an acpid hook + +# Make sure the variables from pipe can be assigned +# https://stackoverflow.com/questions/42963395/bash-assign-variable-from-pipe +shopt -s lastpipe + +# enable all monitors so that they show up in xrandr +# --listactivemonitors output. somehow this output is identical to +# that of xrandr --listmonitors +xrandr --auto + +# find the widest monitor +regex="^.*/([0-9]+)x.*/([0-9]+).* ([^ ]+)$" +widest=0 +widest_name="" +xrandr --listactivemonitors | while IFS=$'\n' read -r line; do + if [[ $line =~ $regex ]]; then + if (( "${BASH_REMATCH[1]}" > "$widest" )); then + widest="${BASH_REMATCH[1]}" + widest_name="${BASH_REMATCH[3]}" + fi + fi +done + +# turn off all other monitors +xrandr --listactivemonitors | while IFS=$'\n' read -r line; do + if [[ $line =~ $regex ]]; then + if [[ "${BASH_REMATCH[3]}" != "$widest_name" ]]; then + xrandr --output "${BASH_REMATCH[3]}" --off + fi + fi +done |