summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Vink <mike@pionative.com>2024-02-11 12:16:07 +0100
committerMike Vink <mike@pionative.com>2024-02-11 12:16:28 +0100
commit1022a09fc4d8ac7c28031d777097c22799507007 (patch)
tree783f6c746f3b2e74892e84eee701fca678248b95
parentc5ce00c6ffbf3be933c28b5c0d34afb987da26c3 (diff)
some random stuff
-rwxr-xr-xmut/bin/notmuch-hook2
-rwxr-xr-xmut/bin/sb-volume39
m---------mut/dwmblocks0
-rw-r--r--mut/neovim/fnl/conf/init.fnl20
-rw-r--r--profiles/core/neovim.nix1
-rw-r--r--profiles/email/gmail.nix1
-rw-r--r--profiles/email/neomutt.nix1
7 files changed, 61 insertions, 3 deletions
diff --git a/mut/bin/notmuch-hook b/mut/bin/notmuch-hook
index 147559e..8203558 100755
--- a/mut/bin/notmuch-hook
+++ b/mut/bin/notmuch-hook
@@ -1,7 +1,5 @@
-. <(pass show personal/notmuch)
notmuch new --quiet
notmuch tag -new +unread +jobs -- 'tag:new and (from:jobs-listings* or from:jobs-noreply*)'
-notmuch tag -new +unread +houses -- 'tag:new and (from:"'$MAKELAAR'" or thread:{'$MAKELAAR'})'
notmuch tag -new +unread +dev -- 'tag:new and (from:/.*github.com/ or thread:{from:/.*github.com/})'
# New needs to be removed, otherwise it will re add inbox unread
diff --git a/mut/bin/sb-volume b/mut/bin/sb-volume
new file mode 100755
index 0000000..e66dea7
--- /dev/null
+++ b/mut/bin/sb-volume
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+# Prints the current volume or 🔇 if muted.
+
+case $BLOCK_BUTTON in
+ 1) setsid -w -f "$TERMINAL" -e pulsemixer; pkill -RTMIN+10 "${STATUSBAR:-dwmblocks}" ;;
+ 2) wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle ;;
+ 4) wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%+ ;;
+ 5) wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%- ;;
+ 3) notify-send "📢 Volume module" "\- Shows volume 🔊, 🔇 if muted.
+- Middle click to mute.
+- Scroll to change." ;;
+ 6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
+esac
+
+vol="$(wpctl get-volume @DEFAULT_AUDIO_SINK@)"
+
+# If muted, print 🔇 and exit.
+[ "$vol" != "${vol%\[MUTED\]}" ] && echo 🔇 && exit
+
+vol="${vol#Volume: }"
+
+split() {
+ # For ommiting the . without calling and external program.
+ IFS=$2
+ set -- $1
+ printf '%s' "$@"
+}
+
+vol="$(printf "%.0f" "$(split "$vol" ".")")"
+
+case 1 in
+ $((vol >= 70)) ) icon="🔊" ;;
+ $((vol >= 30)) ) icon="🔉" ;;
+ $((vol >= 1)) ) icon="🔈" ;;
+ * ) echo 🔇 && exit ;;
+esac
+
+echo "$icon$vol%"
diff --git a/mut/dwmblocks b/mut/dwmblocks
-Subproject f8aaf481e40c8ce60f4fe795368b9bca59fb09b
+Subproject 4d792732191817ced096f6f89559e1bcfd20403
diff --git a/mut/neovim/fnl/conf/init.fnl b/mut/neovim/fnl/conf/init.fnl
index aec028f..5a0826a 100644
--- a/mut/neovim/fnl/conf/init.fnl
+++ b/mut/neovim/fnl/conf/init.fnl
@@ -20,9 +20,29 @@
(local action (require :fzf-lua.actions))
(fzf.setup [:max-perf])
+(local
+ draw
+ (fn [toggle]
+ (if
+ toggle
+ (do
+ (vim.cmd "set virtualedit=all")
+ (vim.keymap.set "n" "J" "<C-v>j:VBox<CR>")
+ (vim.keymap.set "n" "K" "<C-v>k:VBox<CR>")
+ (vim.keymap.set "n" "L" "<C-v>l:VBox<CR>")
+ (vim.keymap.set "n" "H" "<C-v>h:VBox<CR>"))
+ (do
+ (vim.cmd "set virtualedit=")
+ (vim.keymap.del "n" "J")
+ (vim.keymap.del "n" "K")
+ (vim.keymap.del "n" "L")
+ (vim.keymap.del "n" "H")))))
+
(local cope #(vim.cmd (.. ":copen " (math.floor (/ vim.o.lines 2.1)))))
(local oil (require :oil.actions))
(let [map vim.keymap.set]
+ (map :n :<leader>d<cr> (fn [] (draw true)))
+ (map :n :<leader>d<bs> (fn [] (draw false)))
(map :n :- ::Oil<cr>)
(map :n :_ #(oil.open_cwd.callback))
(map :v :y "<Plug>OSCYankVisual|gvy")
diff --git a/profiles/core/neovim.nix b/profiles/core/neovim.nix
index 3f9f5f7..c4f7a2e 100644
--- a/profiles/core/neovim.nix
+++ b/profiles/core/neovim.nix
@@ -45,6 +45,7 @@
bat
nil
shellcheck
+ vale
];
plugins = with pkgs.vimPlugins; [
# highlighting
diff --git a/profiles/email/gmail.nix b/profiles/email/gmail.nix
index 765f584..229738b 100644
--- a/profiles/email/gmail.nix
+++ b/profiles/email/gmail.nix
@@ -1,5 +1,4 @@
{
- inputs,
config,
pkgs,
...
diff --git a/profiles/email/neomutt.nix b/profiles/email/neomutt.nix
index 7ee2346..7940fc6 100644
--- a/profiles/email/neomutt.nix
+++ b/profiles/email/neomutt.nix
@@ -184,6 +184,7 @@
macros = [
{ map = ["index" "pager"]; key = ","; action = "<pipe-message>khard add-email<return>"; }
{ map = ["index"]; key = "X"; action = "<save-message>=Spam<enter>y"; }
+ { map = ["index"]; key = "Ma"; action = "<save-message>=Archive<enter>y"; }
{ map = ["index"]; key = "A"; action = "<modify-labels-then-hide>+archive -unread -inbox<enter><mark-message>z<enter><change-folder>^<enter>'z"; }
{ map = ["index"]; key = "D"; action = "<delete-message>"; }
{ map = ["index" "pager"]; key = "S"; action = "<sync-mailbox>!notmuch-hook<enter><mark-message>z<enter><change-folder>^<enter>'z"; }