various improvements
[distro-setup] / brc2
diff --git a/brc2 b/brc2
index 754f9a0ca1b37a784bad5ebfee9fb14d6abacabc..ea1faafd479eb2b1f5128728f71c41a5853fd991 100644 (file)
--- a/brc2
+++ b/brc2
@@ -115,9 +115,9 @@ rootrsync() {
 }
 
 zcheck() {
-  s ssh bow DISPLAY=:0 scrot /tmp/oegu.jpg
-  s scp bow:/tmp/oegu.jpg /t
-  s ssh bow rm /tmp/oegu.jpg
+  ssh bow DISPLAY=:0 scrot /tmp/oegu.jpg
+  scp bow:/tmp/oegu.jpg /t
+  ssh bow rm /tmp/oegu.jpg
   feh /t/oegu.jpg
 }
 
@@ -1045,8 +1045,9 @@ hstatus() {
 
 # work log
 wlog() {
-  local day now i
-  for (( i=0; i<60; i++ )); do
+  local day now i days_back
+  days_back=${1:-16}
+  for (( i=0; i<days_back; i++ )); do
     day=$( date +%F -d @$((EPOCHSECONDS - 86400*i )) )
     date "+%a %b %d" -d @$((EPOCHSECONDS - 86400*i )) | tr '\n' ' '
     /a/opt/timetrap/bin/t d -ftotal -s $day -e $day all -m '^w|lunch$'
@@ -1435,7 +1436,8 @@ allmyirc() {
 }
 
 mygajim() {
-  local time time_sec time_pretty
+  local time time_sec time_pretty days
+  days=${1:-16}
   sqlite3 -separator ' ' /p/c/subdir_files/.local/share/gajim/logs.db "select time, message from logs where contact_name = 'iank' and jid_id = 17;" | while read -r time l; do
     case $time in
       16*) : ;;
@@ -1448,7 +1450,7 @@ mygajim() {
     echo $time_pretty "$l"
     time_sec=${time%%.*}
     # only look at the last 18 days. generally just use this for timesheet.
-    if (( time_sec < EPOCHSECONDS - 60 * 60 * 24 * 18 )); then break; fi
+    if (( time_sec < EPOCHSECONDS - 60 * 60 * 24 * days )); then break; fi
   done
 }
 
@@ -1460,6 +1462,11 @@ gajlogs() {
   sqlite3 -separator ' ' /p/c/subdir_files/.local/share/gajim/logs.db "select time, message from logs" | less
 }
 
+# slow down ploopy trackball
+ploop() {
+xinput --set-prop $(xinput list | grep -F 'Ploopy Corporation Trackball Mouse' | sed -rn 's/.*[[:space:]]id=([^[:space:]]*).*/\1/p') 'libinput Accel Speed' -0.9
+}
+
 net-dev-info() {
   e "lspci -nnk|gr -iA2 net"
   lspci -nnk|gr -iA2 net
@@ -1833,6 +1840,20 @@ This is a test message.
 EOF
 }
 
+# test bounce exim
+testbexim() {
+  to=$1
+  exim -d -f '<>' $to <<EOF
+From: Mail Delivery System <Mailer-Daemon@gnu.org>
+To: $to
+Subject: Mail delivery failed: returning message to sender
+
+This message was created automatically by mail delivery software.
+EOF
+
+}
+
+
 # toggle keyboard
 tk() {
   # based on