;;; ll-alpha.el --- frame transparency interface -*- lexical-binding: t -*- ;;; Commentary: ;;; Code: (require 'cl-lib) (cl-pushnew "." load-path :test #'string=) (require 'll) (defun ll-alpha (&optional a) (i) (if (& (! a) (! (called-interactively-p 'interactive))) (- 1 (frame-parameter nil 'alpha-background)) (when (n a) (setf a (min 1.0 (max 0.0 a))) (set-frame-parameter nil 'alpha-background (- 1 a))) ($ "alpha: %.0f%%" (* 100 (- 1 (frame-parameter nil 'alpha-background)))))) (defun ll-insert-above (&optional n) (or (integerp n) (setf n (prefix-numeric-value current-prefix-arg))) (let* ((cur (current-column)) (pos (+ (pos-bol 0) cur)) (chr (char-after pos))) (when (and (characterp chr) (< (line-number-at-pos pos) (line-number-at-pos))) (dotimes (_ n) (when chr (goto-char (+ (pos-bol 2) cur)) (insert chr) (delete-char 1) (backward-char)))))) (defun ll-alpha-8 () (i) (ll-alpha 1.000 )) ; open your mind (defun ll-alpha-7 () (i) (ll-alpha 0.875 )) ; you can (not) advance (defun ll-alpha-6 () (i) (ll-alpha 0.750 )) ; affluent society (defun ll-alpha-5 () (i) (ll-alpha 0.625 )) ; the world is not enough (defun ll-alpha-4 () (i) (ll-alpha 0.500 )) ; black and white incal (defun ll-alpha-3 () (i) (ll-alpha 0.375 )) ; hunger games (defun ll-alpha-2 () (i) (ll-alpha 0.250 )) ; survival is our law (defun ll-alpha-1 () (i) (ll-alpha 0.125 )) ; ignorence is a bliss (defun ll-alpha-0 () (i) (ll-alpha 0.000 )) ; thou art dead (defun ll-alpha-inc (&optional step) (i) (or step (setf step 0.125)) (ll-alpha (+ (ll-alpha) step))) (defun ll-alpha-dec (&optional step) (i) (or step (setf step 0.125)) (ll-alpha-inc (- step))) (<- 'll-alpha) ;;; ll-alpha.el ends here