From d48e13dd41d9793478ff10ca136a8f6908ef1dd3 Mon Sep 17 00:00:00 2001 From: Andrew Scott Date: Sat, 13 Jan 2024 01:07:16 -0500 Subject: [PATCH 1/3] Unload seq before elpaca build, redefine zig-compile --- dot_config/emacs/init.el | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/dot_config/emacs/init.el b/dot_config/emacs/init.el index f9a9848..ee3772d 100644 --- a/dot_config/emacs/init.el +++ b/dot_config/emacs/init.el @@ -78,6 +78,17 @@ (add-hook 'after-init-hook #'elpaca-process-queues) (elpaca `(,@elpaca-order)) +;; Unload seq before elpaca build - also see `use-package' declaration for seq below +;; https://github.com/progfolio/elpaca/issues/216#issuecomment-1868444883 +(defun +elpaca-unload-seq (e) + (and (featurep 'seq) (unload-feature 'seq t)) + (elpaca--continue-build e)) + +(defun +elpaca-seq-build-steps () + (append (butlast (if (file-exists-p (expand-file-name "seq" elpaca-builds-directory)) + elpaca--pre-built-steps elpaca-build-steps)) + (list '+elpaca-unload-seq 'elpaca--activate-package))) + ;; use-package (elpaca elpaca-use-package (elpaca-use-package-mode) @@ -231,6 +242,10 @@ (setq save-place-file (concat xdg_cache_home "places")) (save-place-mode)) +(use-package seq + ; Unload seq before elpaca build + :elpaca `(seq :build ,(+elpaca-seq-build-steps))) + (use-package simple :elpaca nil :config @@ -708,7 +723,12 @@ ;; Zig (use-package zig-mode :commands (zig-mode) - :config (setq-local fill-column 100)) + :config + (defun zig-compile () + (interactive) + (save-buffer) + (zig--run-cmd "build")) + (setq-local fill-column 100)) ;;; File format/markup support (use-package markdown-mode From 4c50bd571b6a64d1983acfa411a9560f310376f4 Mon Sep 17 00:00:00 2001 From: Andrew Scott Date: Sat, 13 Jan 2024 01:13:06 -0500 Subject: [PATCH 2/3] Add keybinds for playback control --- dot_config/river/executable_init.tmpl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/dot_config/river/executable_init.tmpl b/dot_config/river/executable_init.tmpl index 257740f..7f231a5 100644 --- a/dot_config/river/executable_init.tmpl +++ b/dot_config/river/executable_init.tmpl @@ -197,6 +197,11 @@ do riverctl map "$mode" None XF86AudioRaiseVolume spawn 'pactl set-sink-volume @DEFAULT_SINK@ +5%' riverctl map "$mode" None XF86AudioMicMute spawn 'pactl set-source-mute @DEFAULT_SOURCE@ toggle' + # Media + riverctl map "$mode" None XF86AudioPrev spawn '' + riverctl map "$mode" None XF86AudioPlay spawn '' + riverctl map "$mode" None XF86AudioNext spawn '' + # Backlight riverctl map $mode None XF86MonBrightnessDown spawn 'light -U 5' riverctl map $mode None XF86MonBrightnessUp spawn 'light -A 5' @@ -249,7 +254,7 @@ riverctl map-switch normal lid close 'waylock-launcher' riverctl focus-output DP-1 {{- end }} -# -app-id and title -"foo" start floating +# Start floating riverctl rule-add -app-id 'Bitwarden' float riverctl rule-add -app-id 'Blueman-manager' float riverctl rule-add -app-id 'connman-gtk' float @@ -259,10 +264,7 @@ riverctl rule-add -app-id 'mousepad' float riverctl rule-add -app-id 'com.nextcloud.dextopclient.Nextcloud' float riverctl rule-add -app-id 'vlc' float -# -app-id "bar" and any title use client-side decorations -riverctl rule-add -app-id 'emacs' csd - -# Default layout generator +# Layout generator riverctl default-layout rivertile rivertile -view-padding 4 -outer-padding 4 -main-ratio .55 & From 8bfa54e30d16b603a817d288587b10c6037a53e7 Mon Sep 17 00:00:00 2001 From: Andrew Scott Date: Sat, 13 Jan 2024 01:14:19 -0500 Subject: [PATCH 3/3] Add wrapper script for exiting session --- dot_config/wleave/layout | 6 +++--- dot_local/bin/executable_river-exit | 26 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 dot_local/bin/executable_river-exit diff --git a/dot_config/wleave/layout b/dot_config/wleave/layout index 61fa2fd..16a0169 100644 --- a/dot_config/wleave/layout +++ b/dot_config/wleave/layout @@ -12,13 +12,13 @@ } { "label" : "logout", - "action" : "${HOME}/.local/bin/river-logout", + "action" : "${HOME}/.local/bin/river-exit logout", "text" : "Logout", "keybind" : "e" } { "label" : "shutdown", - "action" : "loginctl poweroff", + "action" : "${HOME}/.local/bin/river-exit poweroff", "text" : "Shutdown", "keybind" : "s" } @@ -30,7 +30,7 @@ } { "label" : "reboot", - "action" : "loginctl reboot", + "action" : "${HOME}/.local/bin/river-exit reboot", "text" : "Reboot", "keybind" : "r" } diff --git a/dot_local/bin/executable_river-exit b/dot_local/bin/executable_river-exit new file mode 100644 index 0000000..c2137bb --- /dev/null +++ b/dot_local/bin/executable_river-exit @@ -0,0 +1,26 @@ +#!/bin/sh + +river=$(ps -C river | awk '/river/') + +if [ -z "$river" ]; then + echo "error: $0: River is not running" + exit 1 +elif [ $# -ne 1 ]; then + echo "Usage: river-exit [command]" + echo "Commands: logout, poweroff, or reboot" + exit 1 +fi + +if [ "$1" = "logout" ]; then + riverctl spawn 'reset' + riverctl exit +elif [ "$1" = "poweroff" ]; then + riverctl spawn 'reset' + loginctl poweroff +elif [ "$1" = "reboot" ]; then + riverctl spawn 'reset' + loginctl reboot +else + echo "error: $0: unexpected argument" + exit 1 +fi