This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defpackage #:scratch/clx-test | |
(:use #:cl) | |
(:export #:run)) | |
(in-package #:scratch/clx-test) | |
;;; A minimum test case for properly handling window close events from the window manager. | |
(defun delete-window-event-p (display type data) | |
(and (eq type :wm_protocols) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun parse-tree/fix-anchors (tree base-url) | |
"Fix anchor URLs in the `TREE' to work correctly with the <base> tag." | |
(plump:traverse tree | |
(lambda (node) | |
(when (starts-with-subseq "#" (plump:attribute node "href")) | |
(setf (plump:attribute node "href") (concatenate 'string base-url (plump:attribute node "href"))))) | |
:test (lambda (node) | |
(and (plump:element-p node) | |
(string-equal (plump:tag-name node) "a"))))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#F2:: | |
WinGetClass, class, A | |
Gui, Emojiwin: New, +ToolWindow , Emoji Picker (%class%) | |
Gui, Font, s12, Segoe UI | |
Gui, Add, Text,, Pick an emoji: | |
Gui, Add, Button, gEFacepalm, &1. 🤦 Facepalm | |
Gui, Add, Button, gEPizza, &2. 🍕 Pizza | |
Gui, Add, Button, gEParty, &3. 🎉 Party | |
Gui, Show | |
Return |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define-module (my packages) | |
#:use-module ((guix licenses) #:prefix license:) | |
#:use-module (gnu packages linux) | |
#:use-module (guix build-system trivial) | |
#:use-module (gnu) | |
#:use-module (guix download) | |
#:use-module (guix git-download) | |
#:use-module (guix packages)) | |
(define (linux-nonfree-urls version) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(in-package :sdl2-ttf) | |
;;This file contains function definitions that could not be correctly wrapped by cl-autowrap (mainly due to no support for pass by value as of writing 6-22-2015) | |
(cffi:defcstruct (sdl-color) | |
(r :uint8) | |
(g :uint8) | |
(b :uint8) | |
(a :uint8)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; Volume control | |
(defun current-volume-settings () | |
"Return current volume settings as multiple values (`MUTEDP', `VOLUME-LEFT-%', `VOLUME-RIGHT-%')." | |
(let* ((raw-output (run-shell-command "pactl list sinks" t)) | |
(raw-mute (nth-value 1 (cl-ppcre:scan-to-strings "Mute: ([a-z]+)" raw-output))) | |
(raw-volume (nth-value 1 (cl-ppcre:scan-to-strings "Volume: .+/\\s+(\\d+).+/.+/\\s+(\\d+).+/" raw-output))) | |
(mutedp (string= (svref raw-mute 0) "yes")) | |
(vol%-l (parse-integer (svref raw-volume 0))) | |
(vol%-r (parse-integer (svref raw-volume 1)))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;;; A webserver in Emacs, because why not. | |
;;;; Basically a fast replacement for serve_this in Fish. | |
(use-package web-server | |
:config | |
(defvar my/file-server nil "Is the file server running? Holds an instance if so.") | |
(defun my/ws-start (handlers port &optional log-buffer &rest network-args) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; Remember to set `slime-enable-evaluate-in-emacs' to t in Emacs. | |
;;; Also remember that it basically allows your Lisp to execute any code in your Emacs. | |
(defmacro with-output-to-emacs-buffer ((stream buffer-name) &body body) | |
`(let ((results (with-output-to-string (,stream) | |
,@body))) | |
(swank:eval-in-emacs `(with-current-buffer (get-buffer-create ,,buffer-name) | |
(erase-buffer) | |
(insert ,results))))) | |
;;; Use example: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define-key *top-map* (kbd "s-f") "fselect") ; for faster access to select frame by number | |
;;; This is like fnext, but restricted to current head only. | |
(defun focus-next-frame-on-current-head (group) | |
"Focus next frame, limited to current head." | |
(let ((current-head (group-current-head group))) | |
(focus-frame-after group | |
(remove-if-not (lambda (frame) | |
(eql (frame-head group frame) | |
current-head)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defhydra hydra-host-os (:color teal :hint nil) | |
" | |
^Shell^ ^Other^ | |
^^^^-------------------------------------- | |
_e_: eshell _q_: quit | |
_E_: eshell here | |
_s_: shell command | |
_S_: shell command on region | |
_a_: async shell command |