X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=brc2;h=ea1faafd479eb2b1f5128728f71c41a5853fd991;hb=fa264ab2ec907b4ebc8d7dd0f8b239b0d0202362;hp=346f8da55bb9abd998ad2ace1e66f889e0aff691;hpb=fde3746c622eb042ce1fd051cdfea2f9a247cd53;p=distro-setup diff --git a/brc2 b/brc2 index 346f8da..ea1faaf 100644 --- a/brc2 +++ b/brc2 @@ -115,11 +115,11 @@ 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 - } +} slemacs() { local arg rtime v @@ -303,19 +303,6 @@ abrowserrmcompat() { fi ngreset } -ngset() { - if shopt nullglob >/dev/null; then - ngreset=false - else - shopt -s nullglob - ngreset=true - fi -} -ngreset() { - if $ngreset; then - shopt -u nullglob - fi -} checkre() { s checkrestart -b /a/bin/ds/checkrestart-blacklist -pv @@ -1058,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&2 + return 1 fi - [[ -e $src ]] || { echo "src:$src does not exist"; return 1; } m mv -T $src $dst - m ln -sf -T $dst $link + m ln -sf -T $dst $ln_path done } -mbdisable() { - local mb=$1 - dst=/m/md/$mb - src=/m/4e/$mb - set -x - [[ -e $src ]] || { set +x; return 1; } - if [[ -L $dst ]]; then rm $dst; fi - mv -T $src $dst - set +x +md2enable() { + mdenable -2 "$@" } -mb2disable() { - local mb=$1 - dst=/m/md/$mb - src=/m/4e2/$mb - set -x - [[ -e $src ]] || { set +x; return 1; } - if [[ -L $dst ]]; then rm $dst; fi - mv -T $src $dst - set +x +mddisable() { + local md=$1 + dst=/m/md/$md + + ### begin copied from mdenable, but different d ### + for d in /m/4e/$md /m/4e2/$md; do + if [[ -d $d && ! -L $d ]]; then + src=$d + break + fi + done + if [[ ! $src ]]; then + echo "error: could not find $md" >&2 + return 1 + fi + ### end copy from mdenable ### + + if [[ -L $dst ]]; then m rm $dst; fi + m mv -T $src $dst } @@ -1436,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*) : ;; @@ -1449,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 } @@ -1461,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 @@ -1825,15 +1831,29 @@ testexim() { # exim -t 'test@zroe.org, t2@zroe.org' <<'EOF' # # -t = get recipient from header - exim -d -t <<'EOF' -From: root@$(hostname-f) -To: root@$(hostname-f) + exim -d -t <' $to < +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