features
authorIan Kelling <ian@iankelling.org>
Fri, 12 May 2023 04:34:40 +0000 (00:34 -0400)
committerIan Kelling <ian@iankelling.org>
Fri, 12 May 2023 04:34:40 +0000 (00:34 -0400)
brc2
system-status

diff --git a/brc2 b/brc2
index c747109446d861432fdac44edf5fa2dfed694c6c..7f6011f43dd05b4cf61d19d7658449a3a5c4053d 100644 (file)
--- 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
index b2e3b160f80eb1cc2c174a57a71085b7cd04b0fd..87d8cf9d7939df5b2b55175e10015cca1d0f0f4f 100755 (executable)
@@ -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