diff options
| author | Mike Vink <mike@pionative.com> | 2024-02-11 12:16:07 +0100 |
|---|---|---|
| committer | Mike Vink <mike@pionative.com> | 2024-02-11 12:16:28 +0100 |
| commit | 1022a09fc4d8ac7c28031d777097c22799507007 (patch) | |
| tree | 783f6c746f3b2e74892e84eee701fca678248b95 /mut | |
| parent | c5ce00c6ffbf3be933c28b5c0d34afb987da26c3 (diff) | |
some random stuff
Diffstat (limited to 'mut')
| -rwxr-xr-x | mut/bin/notmuch-hook | 2 | ||||
| -rwxr-xr-x | mut/bin/sb-volume | 39 | ||||
| m--------- | mut/dwmblocks | 0 | ||||
| -rw-r--r-- | mut/neovim/fnl/conf/init.fnl | 20 |
4 files changed, 59 insertions, 2 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") |
