This file contains 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
#!/bin/bash | |
function get_active_sink () | |
{ | |
input=$(pactl list short sinks | awk '$7=="RUNNING" {print $2}') | |
echo -n "$input" | |
} | |
function mute_toggle () | |
{ |
This file contains 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
(ql:quickload :cl-ppcre) | |
(defun decompress (in) | |
(multiple-value-bind (string matchp) | |
(cl-ppcre:regex-replace "([0-9]+)\\[([^][]*)\\]" | |
in | |
(lambda (match reg1 reg2) |
This file contains 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 :my-first-app | |
;; Imports the appropriate CLIM library | |
(:use :clim :clim-lisp) | |
;; The package will only export a function to run the app | |
(:export run-my-first-app)) | |
;; Good practice | |
(in-package :my-first-app) | |
;; Definition of the structure of a minimum app |
This file contains 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 :next) | |
(defhydra switch-buffer | |
("p" switch-buffer-previous) | |
("n" switch-buffer-next)) | |
(define-key *global-map* (kbd "M-s") #'switch-buffer) | |
(defhydra load-url | |
("l" set-url-current-buffer) |
This file contains 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
;;; Make multiple binding with a common prefix | |
(in-package :next) | |
(defmacro defhydra (name &body suffixes) | |
"Define a hydra named 'name'" | |
(let ((hydra-object (gensym)) | |
(completion-function (gensym))) | |
`(progn | |
(defclass ,hydra-object () | |
((key :accessor key :initarg :key) |
This file contains 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
;;; Make multiple binding with a common prefix | |
(in-package :next) | |
(defmacro defhydra (name prefix &body suffixes) | |
`(progn | |
(defun ,name () | |
(with-result (suffix (read-from-minibuffer | |
(mode *minibuffer*))) | |
(cond ,@(map 'list (lambda (arg) | |
(list (list 'equal 'suffix (first arg)) |