b7239c572353

More
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Tue, 01 Feb 2022 10:49:39 -0500
parents c05932aa401f
children d7650a70ef26
branches/tags (none)
files gitconfig stumpwmrc vim/vimrc

Changes

--- a/gitconfig	Thu Nov 11 14:12:49 2021 -0500
+++ b/gitconfig	Tue Feb 01 10:49:39 2022 -0500
@@ -14,6 +14,8 @@
     remotes = remote -v
 
     make-the-fucking-branch-point-at-the-fucking-commit = "!sh -c 'git checkout $1 && git reset --hard $2' -"
+    mtfbpatfc                                           = "!sh -c 'git checkout $1 && git reset --hard $2' -"
+
     root = rev-parse --show-toplevel
 
     l   = log -18 --color=always --all --topo-order --pretty='format:%Cgreen%h%Creset %s%Cred%d%Creset %C(black bold)(by %an)%Creset'
--- a/stumpwmrc	Thu Nov 11 14:12:49 2021 -0500
+++ b/stumpwmrc	Tue Feb 01 10:49:39 2022 -0500
@@ -29,28 +29,32 @@
   (and (search needle string :test #'char=) t))
 
 (defun string-grep (needle text &key first-only)
-  (-<> text
-    (split-sequence:split-sequence #\newline <>)
+  (_ text
+    (split-sequence:split-sequence #\newline _)
     (if first-only
-      (find needle <> :test #'string-contains)
-      (remove-if-not (alexandria:curry #'string-contains needle) <>))))
+      (find needle _ :test #'string-contains)
+      (remove-if-not (alexandria:curry #'string-contains needle) _))))
 
 (defun string-split (delimiters string)
   (split-sequence:split-sequence delimiters string
                                  :test (lambda (bag ch)
                                          (find ch bag :test #'char=))))
 
+(defun run-and-echo-shell-command (command &rest args)
+  (message command)
+  (apply #'run-shell-command command args))
+
 
 (defun mod+ (n increment modulo)
   (mod (+ n increment) modulo))
 
 
 (defun volume ()
-  (-<> (run-shell-command "amixer sget Master" t)
-    (string-grep "Front Left:" <> :first-only t)
-    (string-split "[]" <>)
+  (_ (run-shell-command "amixer sget Master" t)
+    (string-grep "Front Left:" _ :first-only t)
+    (string-split "[]" _)
     second
-    (string-trim "%" <>)
+    (string-trim "%" _)
     parse-integer))
 
 
@@ -59,10 +63,10 @@
 
 
 (defun keywordize (string)
-  (-<> string
-    (string-trim (string #\newline) <>)
+  (_ string
+    (string-trim (string #\newline) _)
     string-upcase
-    (intern <> (find-package :keyword))))
+    (intern _ (find-package :keyword))))
 
 (defparameter *host* (keywordize (machine-instance)))
 
@@ -252,10 +256,13 @@
   (aref *brightness-values* *brightness-index*))
 
 (defun set-brightness (value)
-  (run-shell-command
+  (run-and-echo-shell-command
     (hostcase
-      ((:mobius :alephnull) (format nil "xbacklight -set ~D" value))
-      ((:papyrifera) (format nil "xrandr --output eDP --brightness ~D" (/ value 100.0)))
+      ((:mobius) (format nil "xbacklight -set ~D" value))
+      ((:papyrifera :alephnull) (format nil "xrandr --output ~A --brightness ~D"
+                                        (hostcase (:papyrifera "eDP")
+                                                  (:alephnull "eDP-1"))
+                                        (/ value 100.0)))
       (t (message "Not sure how to set brightness on this machine.")))))
 
 (defun rotate-brightness (delta)
@@ -263,6 +270,7 @@
         (mod+ *brightness-index* delta (length *brightness-values*)))
   (set-brightness (brightness)))
 
+
 (defcommand rotate-brightness-up () ()
   (rotate-brightness 1))
 
@@ -312,8 +320,8 @@
 
 (defcommand screen-laptop () ()
   (only)
-  (loop :with laptop = "eDP1"
-        :with extern = "DP1"
+  (loop :with laptop = "eDP-1"
+        :with extern = "DP-1"
         :for (output commands) :in `((,laptop ("--auto"))
                                    (,laptop ("--primary"))
                                    (,extern ("--off")))
@@ -321,14 +329,14 @@
 
 (defcommand screen-external () ()
   (only)
-  (loop :with laptop = "eDP1"
-        :with extern = "DP1"
+  (loop :with laptop = "eDP-1"
+        :with extern = "DP-1"
         :for (output commands) :in `(
-                                     (,laptop ("--off"))
+                                     ;; (,laptop ("--off"))
                                      (,extern ("--auto"))
                                      (,extern ("--primary"))
-                                     ;; (,laptop ("--auto"))
-                                     ;; (,laptop ("--right-of" ,extern))
+                                     (,laptop ("--auto"))
+                                     (,laptop ("--left-of" ,extern))
                                      )
         :do (uiop:run-program `("xrandr" "--output" ,output ,@commands))))
 
--- a/vim/vimrc	Thu Nov 11 14:12:49 2021 -0500
+++ b/vim/vimrc	Tue Feb 01 10:49:39 2022 -0500
@@ -851,6 +851,14 @@
 augroup END
 
 " }}}
+" Bazel {{{
+
+augroup ft_bazel
+    au!
+    au FileType bzl nnoremap <buffer> gi :Neoformat buildifier<cr>
+augroup END
+
+" }}}
 " C {{{
 
 augroup ft_c