From d4a62c18b666ac9673181ab76f3e3d28fc784da6 Mon Sep 17 00:00:00 2001
From: Ian Kelling <ian@iankelling.org>
Date: Fri, 12 May 2023 00:34:40 -0400
Subject: [PATCH] features

---
 brc2          | 41 ++++++++++++++++++++++++++++++++---------
 system-status |  4 ++++
 2 files changed, 36 insertions(+), 9 deletions(-)

diff --git a/brc2 b/brc2
index c747109..7f6011f 100644
--- a/brc2
+++ b/brc2
@@ -395,16 +395,27 @@ astudio() {
 # becomes
 # https://brains.fsf.org/wiki/sysadmin/interns/2022/nick_shrader/intro_blog_post
 iki() {
-  local url path
+  local url path input
   if [[ $1 ]]; then
-    path="$*"
+    input="$*"
   else
-    read -r -p "enter path" path
+    read -r -p "enter path or url" input
   fi
-  url=$(readlink -f "$path")
-  url="https://brains.fsf.org/wiki/${url#*brains/}"
-  url="${url%.mdwn}"
-  echo "$url"
+  case $input in
+    http*)
+      path="/f/brains/${input##https://brains.fsf.org/wiki/}"
+      if [[ $path == */ ]]; then
+        path=${path%/}.mdwn
+        fi
+      j printf "%s\n" "$path"
+      ;;
+    *)
+      url=$(readlink -f "$input")
+      url="https://brains.fsf.org/wiki/${url#*brains/}"
+      url="${url%.mdwn}"
+      j echo "$url"
+      ;;
+  esac
 
 }
 
@@ -1562,7 +1573,11 @@ dsign() {
 # set day start for use in other programs.
 # expected to do be in a format like 830, or 800 or 1300.
 ds() {
-  echo $1 >/b/data/daystart
+  if [[ $1 ]]; then
+    echo $1 >/b/data/daystart
+  else
+    cat /b/data/daystart
+  fi
 }
 
 #### begin bitcoin related things
@@ -2573,9 +2588,17 @@ otp() {
   oathtool --totp -b "$*" | xclip -selection clipboard
 }
 j() {
-  "$@" |& pee "xclip -r -selection clipboard"
+  "$@" |& pee "xclip -r -selection clipboard" cat
 }
 
+# x copy
+xc() {
+  xclip -r -selection clipboard
+}
+# echo copy
+ec() {
+  pee "xclip -r -selection clipboard" cat
+}
 
 pakaraoke() {
   # from http://askubuntu.com/questions/456021/remove-vocals-from-mp3-and-get-only-instrumentals
diff --git a/system-status b/system-status
index b2e3b16..87d8cf9 100755
--- a/system-status
+++ b/system-status
@@ -400,6 +400,8 @@ mute() {
   if $locked && (( mdiff < 6 || mdiff > 21 )); then
     case $(pactl get-sink-mute @DEFAULT_SINK@ | awk '{print $2}') in
       no)
+        # for log purposes
+        echo unmuted
         pactl set-sink-mute @DEFAULT_SINK@ true
         ;;
     esac
@@ -407,6 +409,8 @@ mute() {
   if ! $locked && ((  mdiff > 6 || mdiff < 12  )) && [[ ! -e /tmp/ianknap ]]; then
     case $(pactl get-sink-mute @DEFAULT_SINK@ | awk '{print $2}') in
       yes)
+        # for log purposes
+        echo muted
         pactl set-sink-mute @DEFAULT_SINK@ false
         ;;
     esac
-- 
2.30.2