From 7f7ab9652d2a2d1135e11150f6a548171a93bf79 Mon Sep 17 00:00:00 2001 From: c0dev0id Date: Mon, 10 Apr 2023 13:00:38 +0200 Subject: [PATCH] Update 2023-04-10 13:00 OpenBSD/amd64 --- .bin/setaudio | 34 ++++++++++++++++++++++------------ .bin/sp | 3 ++- .kshrc | 1 + .mutt/mailcap | 20 ++++++++++---------- .mutt/rc-common | 7 +++---- 5 files changed, 38 insertions(+), 27 deletions(-) diff --git a/.bin/setaudio b/.bin/setaudio index 500679b..bf40adc 100755 --- a/.bin/setaudio +++ b/.bin/setaudio @@ -1,15 +1,25 @@ -#!/bin/sh +#!/bin/ksh -LIST=$(dmesg | grep "^uaudio.*configuration.*interface*" | sed 's/uaudio\(.\).*"\(.*\)".*/\1 - \2/g') -DEV=$(sndioctl -n server.device) -echo "Select sound device (current=$(( DEV - 1 ))):" +[ ! -z $1 ] && sndioctl -q server.device=$1 -echo "s - System Audio (PCI)" -echo "$LIST" -echo -n "=> " -read -r +DUMP=$(dmesg) +_cur=$(sndioctl -n server.device) -case $REPLY in - s) sndioctl -q server.device=0; ;; - [0-9]) sndioctl -q server.device=$(( REPLY + 1 )); ;; -esac +examine() { + _type=$(echo "$1" | cut -d" " -f3) + _number=$(echo "$1" | cut -d" " -f1 | sed 's/[a-z]//g') + _desc=$(echo "$DUMP" | grep -E "^$_type at.*" | tail -1 | cut -d'"' -f2) + [ -z $_number ] && return + + if [ $_cur -eq $_number ] + then + [ ! -z $_number ] && echo "> $_number: $_desc" + else + [ ! -z $_number ] && echo " $_number: $_desc" + fi +} + +for i in 0 1 2 3 4 5 6 +do + examine "$(echo "$DUMP" | grep -E "^audio$i\ at.*" | tail -1)" +done diff --git a/.bin/sp b/.bin/sp index b2dd383..e8d09fd 100755 --- a/.bin/sp +++ b/.bin/sp @@ -14,7 +14,8 @@ else if xwininfo -id $WID | fgrep -q IsUnMapped then # move window to current workspace - wmctrl -i -r $WID -t $(xprop -root _NET_CURRENT_DESKTOP | cut -d'=' -f2) + #wmctrl -i -r $WID -t $(xprop -root _NET_CURRENT_DESKTOP | cut -d'=' -f2) + wmctrl -i -r $WID -t $(wmctrl -d | grep '*' | cut -d ' ' -f '1') # remove hidden flag wmctrl -i -r $WID -b remove,hidden # activate (give focus) diff --git a/.kshrc b/.kshrc index 20214fe..ea9e39e 100644 --- a/.kshrc +++ b/.kshrc @@ -289,6 +289,7 @@ l() { } # cam +alias camformats="ffplay -f v4l2 -list_formats all -i /dev/video" alias cam="ffplay -loglevel quiet -f v4l2 -input_format mjpeg -video_size 640x480 -i /dev/video" setcam() { _dev=$1 diff --git a/.mutt/mailcap b/.mutt/mailcap index 9070967..d1db170 100644 --- a/.mutt/mailcap +++ b/.mutt/mailcap @@ -21,21 +21,21 @@ # Tests: # test -n "$DISPLAY" true when X is running - # html +text/html; ~/.mutt/scripts/call-browser.sh %s; test=test -n "$DISPLAY"; needsterminal; text/html; w3m -I %{charset} -T %t -cols "$COLUMNS" -s -no-graph -o display_link=1 -o display_link_number=1; copiousoutput; # documents -application/pdf; mupdf-gl %s; nametemplate=%s.pdf; -application/vnd.openxmlformats-officedocument.wordprocessingml.document; libreoffice %s; -application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; libreoffice %s; -application/vnd.openxmlformats-officedocument.presentationml.presentation; libreoffice %s; -application/vnd.oasis.opendocument.text; libreoffice %s; -application/vnd.oasis.opendocument.spreadsheet; libreoffice %s; -application/vnd.oasis.opendocument.presentation; libreoffice %s; +application/pdf; ~/.mutt/scripts/call.sh mupdf-gl %s; nametemplate=%s.pdf; +application/vnd.openxmlformats-officedocument.wordprocessingml.document; ~/.mutt/scripts/call.sh libreoffice %s; +application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; ~/.mutt/scripts/call.sh libreoffice %s; +application/vnd.openxmlformats-officedocument.presentationml.presentation; ~/.mutt/scripts/call.sh libreoffice %s; +application/vnd.oasis.opendocument.text; ~/.mutt/scripts/call.sh libreoffice %s; +application/vnd.oasis.opendocument.spreadsheet; ~/.mutt/scripts/call.sh libreoffice %s; +application/vnd.oasis.opendocument.presentation; ~/.mutt/scripts/call.sh libreoffice %s; # media -image/*; nsxiv %s; needsterminal; +image/*; ~/.mutt/scripts/call.sh nsxiv %s; video/*; mpv %s; needsterminal; audio/*; mpv %s; needsterminal; application/ogg; mpv %s; needsterminal; @@ -49,4 +49,4 @@ application/ms-tnef; tnef -w %s # fallback application/*; vim %s; needsterminal; -#text/*; cat %s; copiousoutput; +text/*; cat %s; copiousoutput; diff --git a/.mutt/rc-common b/.mutt/rc-common index 1152b65..bcba54b 100644 --- a/.mutt/rc-common +++ b/.mutt/rc-common @@ -207,10 +207,6 @@ alternative_order text/plain text/enriched text/html auto_view text/html text/enriched text/calendar # Preview HTML -macro pager  "cat - > /tmp/mutt.html && luakit /tmp/mutt.html" - -#macro pager  "~/.mutt/scripts/search-msgid.sh" - macro pager,attach  "cat > /tmp/muttpatch.diff~/.mutt/scripts/portpatch2.sh /tmp/muttpatch.diff" # Save Patch @@ -290,6 +286,9 @@ bind pager,index ,S save-message # urlview macro pager \cb "'urlview'" 'Follow links with urlview' +# attachments +bind attach view-mailcap + # TOFU settings # macro pager T ":unset display_filter:set display_filter='$my_tprot'" 'TOFU protection'