## BEGIN_KITTY_SHELL_INTEGRATION
# if test -n "$KITTY_INSTALLATION_DIR" -a -e "$KITTY_INSTALLATION_DIR/shell-integration/bash/kitty.bash"; then source "$KITTY_INSTALLATION_DIR/shell-integration/bash/kitty.bash"; fi
## END_KITTY_SHELL_INTEGRATION
+
+# Automatically added by the Guix install script.
+if [ -n "$GUIX_ENVIRONMENT" ]; then
+ if [[ $PS1 =~ (.*)"\\$" ]]; then
+ PS1="${BASH_REMATCH[1]} [env]\\\$ "
+ fi
+fi
export SL_INFO_DIR=/p/sshinfo
+
# * include files
if [[ -s $bashrc_dir/path-add-function ]]; then
### begin FSF section ###
+# use for temporary functions
+y() {
+ m "${@//spring/fall}"
+}
+h() {
+ e "${@//spring/fall}"
+}
+
+
# Comments before functions are meant to be good useful
# documentation. If they fail at that, please improve them or send Ian a
# note.
prof() {
command prof &>/dev/null &
}
-
-
+# self chat
+sc() {
+ while read -r l; do
+ printf '\033[1A\033[K'; printf "%s\n" "$l"| ts "%F %T" | tee -a /p/self-chat.log
+ done
+}
nmt() {
# cant use s because sudo -i doesnt work for passwordless sudo command
c "$(mktemp -d)"
pkg=$1
# shellcheck disable=SC2012
- cached=$(ls -t /var/cache/apt/archives/$pkg* | tail -n1 2>/dev/null) ||:
+ cached=$(ls -t /var/cache/apt/archives/${pkg}_* | tail -n1 2>/dev/null) ||:
if [[ $cached ]]; then
- cp $cached .
+ m cp $cached .
else
- aptitude download $pkg || return 1
+ m aptitude download $pkg || return 1
fi
tmp=(*); f=${tmp[0]} # only 1 expected
- ex $f
- rm -f $f
+ m ex $f
+ m rm -f $f
}
# pgrep and kill
fi
}
+# make vim work with my light colortheme terminal.
+vim() {
+ if [[ -e ~/.vimrc ]]; then
+ command vim "$@"
+ else
+ command vim -c ':colorscheme peachpuff' "$@"
+ fi
+}
+
+# ls count. usage: pass a directory, get the number of files.
+# https://unix.stackexchange.com/questions/90106/whats-the-most-resource-efficient-way-to-count-how-many-files-are-in-a-director
+lsc() {
+ ls -Uq "$@"|wc -l
+}
+
+# run then notify. close notification after the next prompt.
+rn() {
+ "$@"
+ dunstify -u critical "$*"
+ _psrun=(dunstctl close-all)
+}
+n() {
+ dunstify -u critical n
+}
+
+catnew() {
+ local dir file
+ dir="$1"
+ inotifywait -m "$dir" -e create -e moved_to | while read -r _ _ file; do
+ hr
+ cat "$dir/$file"
+ done
+}
+# cat mail
+cm() {
+ catnew /m/md/$1/new
+}
+
+
# * misc stuff
if [[ $(jobs -p) ]]; then
jobs_char='j\j '
fi
+
+
+ # allow a function to specify a command to run after we run the next
+ # command. Use case: a function makes a persistent notification. If
+ # we happen to be using that terminal, we can just keep working by
+ # entering our next command, even a noop in order to dismiss the
+ # notification, instead of having to explicitly dismiss it.
+ if [[ ${_psrun[@]} ]]; then
+ if (( _psrun_count >= 1 )); then
+
+ "${_psrun[@]}" ||:
+ _psrun_count=0
+ unset _psrun
+ else
+ _psrun_count=$(( _psrun_count + 1 ))
+ fi
+ else
+ _psrun_count=0
+ fi
+
# We could test if sudo is active with sudo -nv
# but then we get an email and log of lots of failed sudo commands.
# We could turn those off, but seems better not to.
fi
PS1="${PS1%"${PS1#*[wW]}"} $jobs_char$psudo\[$ps_color\]$ps_char\[$term_nocolor\] "
+ # copy of what is automatically added by guix.
+ # adds [env] to PS1 if GUIX_ENVIRONMENT is set and PS1 contains '$';
+ if [ -n "$GUIX_ENVIRONMENT" ]; then
+ if [[ $PS1 =~ (.*)"\\$" ]]; then
+ PS1="${BASH_REMATCH[1]} [env]\\\$ "
+ fi
+ fi
+
+
# set titlebar. instead, using more advanced
# titelbar below
#echo -ne "$_title_escape $HOSTNAME ${PWD/#$HOME/~} \007"
# * functions
+
+
multimic() {
local i
local -a sources
fi
if $erasable_line; then
# https://stackoverflow.com/a/71286261
+ # erase line / delete line in terminal
printf '\033[1A\033[K'
fi
erasable_line=false
}
gse() {
- local email=ian@iankelling.org
+ local email=iank@fsf.org
git send-email --notes "--envelope-sender=<$email>" \
--suppress-cc=self "$@"
}
#
# -t = get recipient from header
exim -d -t <<EOF
-From: root@$(hostname -f)
-To: root@$(hostname -f)
-Subject: test2
+From: ian@iankelling.org
+To: submit@b.b8.nz
+Subject: testbug1
+
+Package: test
+Version:1
This is a test message.
EOF
# re all my files more expansively
rem() {
+ local paths
+ paths="/p/c /b"
+ find $paths -not \( -name .svn -prune -o -name .git -prune \
+ -o -name .hg -prune -o -name .editor-backups -prune \
+ -o -name .undo-tree-history -prune \) 2>/dev/null | grep -iP --color=auto -- "$*" ||:
+ rgv -- "$*" $paths /a/t.org /p/w.org /a/work.org ||:
+}
+reml() { # with limit to 5 matches per file
local paths
paths="/p/c /b"
find $paths -not \( -name .svn -prune -o -name .git -prune \
########### misc stuff
+
+xdg-settings set default-web-browser abrowser.desktop
+# see current with:
+# xdg-settings get default-web-browser
+
# pressing tab after sdf here:
# scp sdfbash: set +o noglob: command not found
# in t11, bash 5.1.16. this fixes it.
[Service]
# iank: on a laptop, when it is doing its catchup, it tends to jump
-# between 100% and 180% cpu and makes the fan spin annoyingly. Randomly
-# trying out 50% to see if it will make the fan quieter.
-CPUQuota=50%
+# between 100% and 180% cpu and makes the fan spin annoyingly.
+# 50% still had annoying fan spin. trying out 20%
+CPUQuota=20%
ExecStart=/usr/bin/bitcoind -daemonwait \
-pid=/run/bitcoind/bitcoind.pid \
-conf=/etc/bitcoin/bitcoin.conf \
# bindsym $mod+grave exec "t s lunch; t in; t out -a '45 minutes from now'"
-bindsym $mod+equal focus parent
+bindsym $mod+1 focus parent
+bindsym $mod+equal exec "dunstctl close-all"
# move firefox to current workspace.
# https://i3wm.org/docs/userguide.html#keybindings
# get class with xprop, example output
bindsym $mod+9 workspace 10
-# random keybind, feel free to change
bindsym $mod+Shift+m border toggle
# 65 = space.
#!/bin/bash
set -e; . /usr/local/lib/err; set +e
-# xrandr --auto
+if xrandr | grep -q '^HDMI2 disconnected' &>/dev/null; then
+ xrandr --auto
+else
+ xrandr --output HDMI2 --right-of eDP1 --mode 3840x2160
-# xrandr --output HDMI2 --right-of eDP1 --mode 3840x2160
-
-for i in 1 2 4 5 6 7 8 9 10; do
- # if the workspace is already there, this will fail
- i3-msg '[workspace="'$i'"]' move workspace to output HDMI2 ||:
-done
+ for i in 1 2 4 5 6 7 8 9 10; do
+ # if the workspace is already there, this will fail
+ i3-msg '[workspace="'$i'"]' move workspace to output HDMI2 ||:
+ done
+fi
LOCAL_DENY_EXCEPTIONS_LOCAL_ACL_FILE = /etc/exim4/conf.d/local_deny_exceptions_acl
acl_not_smtp = acl_check_not_smtp
+
+
+DEBBUGS_DOMAIN = b.b8.nz
+
EOF
if dpkg --compare-versions "$(dpkg-query -f='${Version}\n' --show exim4)" ge 4.94; then
fi
+# * debbugs
+
+pi debbugs
+# missing dependency. apache error log:
+# Can't locate List/AllUtils.pm in @INC (you may need to install the List::AllUtils module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.34.0 /usr/local/share/perl/5.34.0 /usr/lib/x86_64-linux-gnu/perl5/5.34 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.34 /usr/share/perl/5.34 /usr/local/lib/site_perl) at /var/lib/debbugs/www/cgi/pkgreport.cgi line 23.
+pi liblist-allutils-perl lynx
+# workarounds for broken debbugsconfig which is
+# itself deprecated. this is temporary before I
+# figure out how to install from git
+gunzip /usr/share/doc/debbugs/examples/text.gz
+mkdir -p /etc/debbugs/sources
+debbugsconfig
+
+
+# ld for local debbugs
+/a/exe/web-conf -t -a 127.0.1.1 -p 80 -r /var/lib/debbugs/www - apache2 ld <<'EOF'
+# copied from debbugs upstream example
+<Directory /var/lib/debbugs/www>
+ Options Indexes SymLinksIfOwnerMatch MultiViews
+ DirectoryIndex index.html
+ Require all granted
+</Directory>
+
+ScriptAlias /cgi/ /var/lib/debbugs/www/cgi/
+<Directory "/var/lib/debbugs/www/cgi/">
+ AllowOverride None
+ Options ExecCGI SymLinksIfOwnerMatch
+ Require all granted
+</Directory>
+
+RewriteEngine on
+RewriteCond %{HTTP_USER_AGENT} .*apt-listbugs.*
+RewriteRule .* /apt-listbugs.html [R,L]
+
+# RewriteLog /org/bugs.debian.org/apache-rewrite.log
+# RewriteLogLevel 0
+
+#RewriteRule ^/$ http://www.debian.org/Bugs/
+RewriteRule ^/(robots\.txt|release-critical|apt-listbugs\.html)$ - [L]
+# The following two redirect to up-to-date pages
+RewriteRule ^/[[:space:]]*#?([[:digit:]][[:digit:]][[:digit:]]+)([;&].+)?$ /cgi-bin/bugreport.cgi?bug=$1$2 [L,R,NE]
+RewriteRule ^/([^/+]*)([+])([^/]*)$ "/$1%%{%}2B$3" [N]
+RewriteRule ^/[Ff][Rr][Oo][Mm]:([^/]+\@.+)$ /cgi-bin/pkgreport.cgi?submitter=$1 [PT,NE]
+# Commented out, 'cuz aj says it will crash master. (old master)
+# RewriteRule ^/[Ss][Ee][Vv][Ee][Rr][Ii][Tt][Yy]:([^/]+\@.+)$ /cgi-bin/pkgreport.cgi?severity=$1 [L,R]
+RewriteRule ^/([^/]+\@.+)$ /cgi-bin/pkgreport.cgi?maint=$1 [PT,NE]
+RewriteRule ^/mbox:([[:digit:]][[:digit:]][[:digit:]]+)([;&].+)?$ /cgi-bin/bugreport.cgi?mbox=yes&bug=$1$2 [PT,NE]
+RewriteRule ^/src:([^/]+)$ /cgi-bin/pkgreport.cgi?src=$1 [PT,NE]
+RewriteRule ^/severity:([^/]+)$ /cgi-bin/pkgreport.cgi?severity=$1 [PT,NE]
+RewriteRule ^/tag:([^/]+)$ /cgi-bin/pkgreport.cgi?tag=$1 [PT,NE]
+# RewriteMap fix-chars int:noescape
+RewriteCond %{REQUEST_URI} ^/(Access\.html|Developer\.html|Reporting\.html|server-request\.html|server-control\.html|server-refcard\.html).* [NC]
+RewriteRule .* - [L]
+# PT|passthrough to bugreport.cgi and pkgreport.cgi
+RewriteRule ^/([0-9]+)$ /cgi-bin/bugreport.cgi?bug=$1 [PT,NE]
+RewriteRule ^/([^/]+)$ /cgi-bin/pkgreport.cgi?pkg=$1 [PT,NE]
+EOF
+
+
# * exim host conditional config
# ** exim certs
if [[ ! -e /etc/exim4/no-delay-eximids ]]; then
install -o iank -g iank <(echo) /etc/exim4/no-delay-eximids
fi
+
+ u /etc/exim4/conf.d/transport/30_debbugs <<'EOF'
+debbugs_pipe:
+ debug_print = "T: debbugs_pipe for $local_part@$domain"
+ driver = pipe
+ command = /usr/lib/debbugs/receive
+ return_output
+EOF
+
+
+ # We dont want delays or backups for mail being stored locally.
+ # We could put domain exclusion on other routes, but going for
+ # higher priority instead.
+ u /etc/exim4/conf.d/router/153_debbugs <<'EOF'
+debbugs:
+ debug_print = "R: debbugs for $local_part@$domain"
+ driver = accept
+ transport = debbugs_pipe
+ local_parts = submit : bugs : maintonly : quiet : forwarded : \
+ done : close : request : submitter : control : ^\\d+
+ domains = DEBBUGS_DOMAIN
+
+bounce_debbugs:
+ debug_print = "R: bounce_debbugs for $local_part@$domain"
+ driver = redirect
+ allow_fail
+ data = :fail: Unknown user
+ domains = DEBBUGS_DOMAIN
+EOF
+
u /etc/exim4/conf.d/router/155_delay <<'EOF'
# By default, delay sending email by 30-40 minutes in case I
# change my mind.
;;
# ** not MAIL_HOST|bk|je
*)
+ echo|u /etc/exim4/conf.d/transport/30_debbugs
+ echo|u /etc/exim4/conf.d/router/153_debbugs
echo|u /etc/exim4/conf.d/router/155_delay
# this one should be removed for all non mail_hosts. note
# bk and je never become mail_host
m find / /nocow -xdev -path ./var/tmp -prune -o -gid $gid -execdir chgrp -h 608 {} +
fi
+
+# note: example config has a debbugs user,
+# but my exim runs setuid as Debian-exim so it can't switch
+# to another user. Anyways, I'm not exposing this to the
+# internet at this time. If I do, the thing to do would
+# be to use a sudo config (or sudo alternative). This
+# would be how to setup
+
+# IFS=:; read -r _ _ uid _ < <(getent passwd debbugs||:) ||:; unset IFS
+# if [[ ! $uid ]]; then
+# # /a/opt/debbugs/debian/README.mail
+# adduser --uid 610 --system --group --home /o/debbugs \
+# --no-create-home --disabled-login --force-badname debbugs
+# m find /o/debbugs -xdev -path ./var/tmp -prune -o -uid $uid -execdir chown -h 610 {} +
+# m find /o/debbugs -xdev -path ./var/tmp -prune -o -gid $gid -execdir chgrp -h 610 {} +
+# elif [[ $uid != 610 ]]; then
+# err debbugs exist but is not uid 610: investigate
+# fi
+
# * start / stop services
reifactive dnsmasq nscd
fi
fstab <<EOF
/o/m /m none bind$mopts 0 0
+/o/debbugs /debbugs none bind$mopts 0 0
EOF
fi
manpages
manpages-dev
markdown
+ # probably add this in t12. it is utilities for maildir.
+ # for now, building from source
+ # mblaze
mb2md
mdadm
meld
log_today=$(date '+%Y_%m_%d').log
logdir=/home/iank/.local/share/profanity/chatlogs/iank_at_fsf.org
+ # when this fails, it has PIPESTATUS: 124 0 1 0 0, which seems to end up with 1 as the overall code, which is not what
+ # i expected. todo: investigate if and why that is, and narrow the ||:
timeout --foreground $secs_till_midnight tail -n0 -qF \
$(for u in ${xmpp_users[@]}; do echo $logdir/${u}_at_fsf.org/$log_today; done) 2>/dev/null \
- | awk '$3 != "me:" {print $3; fflush()}' | sed -u 's/^/pm /;s/@.*//' || [[ $? == 124 ]] &
+ | awk '$3 != "me:" {print $3; fflush()}' | sed -u 's/^/pm /;s/@.*//' ||: &
timeout --foreground $secs_till_midnight tail -n0 -qF \
$logdir/rooms/*/$log_today 2>/dev/null \
- | awk '$3 != "iank:"' | grep -i '\biank\b' | awk '{print $3; fflush()}' | sed 's/^/room /;s/@.*//' || [[ $? == 124 ]]
+ | awk '$3 != "iank:"' | grep -i '\biank\b' | awk '{print $3; fflush()}' | sed 's/^/room /;s/@.*//' ||:
sleep 1
+[global]
+ monitor = 0
+ follow = mouse
+ geometry = "300x5-30+20"
+ indicate_hidden = yes
+ shrink = no
+ transparency = 0
+ notification_height = 0
+ separator_height = 2
+ padding = 8
+ horizontal_padding = 8
+ frame_width = 3
+ frame_color = "#aaaaaa"
+ separator_color = frame
+ sort = yes
+ idle_threshold = 120
+ font = Monospace 8
+ line_height = 0
+ markup = full
+ format = "<b>%s</b>\n%b"
+ alignment = left
+ vertical_alignment = center
+ show_age_threshold = 60
+ word_wrap = yes
+ ellipsize = middle
+ ignore_newline = no
+ stack_duplicates = true
+ hide_duplicate_count = false
+ show_indicators = yes
+ icon_position = left
+ min_icon_size = 0
+ max_icon_size = 32
+ icon_path = /usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/
+ sticky_history = yes
+ history_length = 20
+ dmenu = /usr/bin/dmenu -p dunst:
+ browser = /usr/bin/sensible-browser
+ always_run_script = true
+ title = Dunst
+ class = Dunst
+ startup_notification = false
+ verbosity = mesg
+ corner_radius = 0
+ ignore_dbusclose = false
+ force_xinerama = false
+ mouse_left_click = close_current
+ mouse_middle_click = do_action, close_current
+ mouse_right_click = close_all
+[experimental]
+ per_monitor_dpi = false
+[shortcuts]
+ close = ctrl+space
+ close_all = ctrl+shift+space
+ history = ctrl+grave
+ context = ctrl+shift+period
+[urgency_low]
+ background = "#222222"
+ foreground = "#888888"
+ timeout = 10
+[urgency_normal]
+ background = "#285577"
+ foreground = "#ffffff"
+ timeout = 10
+[urgency_critical]
+ background = "#900000"
+ foreground = "#ffffff"
+ frame_color = "#ff0000"
+ timeout = 0
+
+# above are the defaults from t11 in /etc/xdg/dunst/dunstrc
+
[play_sound]
summary = "*"
script = /b/ds/sound-alert
# default light blue is too light
-[urgency_normal]
- background = "#335EA8"
+#[urgency_normal]
+# background = "#335EA8"
#keyserver hkp://pgp.mit.edu
#keyserver hkp://keyserver.pgp.com
#keyserver hkp://ipv4.pool.sks-keyservers.net
-#keyserver hkp://keys.gnupg.net
+keyserver hkp://keys.gnupg.net
#keyserver hkp://keyserver.ubuntu.com
-keyserver hkp://keyring.debian.org
+#keyserver hkp://keyring.debian.org
#keyserver keyserver.ubuntu.com
# more secure hkps, but had problems with my gpg version
#keyserver hkps://hkps.pool.sks-keyservers.net
--- /dev/null
+# iank: did create new from black on white, then changed
+# background to #f6f6f6
+[Background]
+Color=246,246,246
+
+[BackgroundFaint]
+Color=246,246,246
+
+[BackgroundIntense]
+Color=246,246,246
+
+[Color0]
+Color=0,0,0
+
+[Color0Faint]
+Color=0,0,0
+
+[Color0Intense]
+Color=104,104,104
+
+[Color1]
+Color=178,24,24
+
+[Color1Faint]
+Color=101,0,0
+
+[Color1Intense]
+Color=255,84,84
+
+[Color2]
+Color=24,178,24
+
+[Color2Faint]
+Color=0,101,0
+
+[Color2Intense]
+Color=84,255,84
+
+[Color3]
+Color=178,104,24
+
+[Color3Faint]
+Color=101,94,0
+
+[Color3Intense]
+Color=255,255,84
+
+[Color4]
+Color=24,24,178
+
+[Color4Faint]
+Color=0,0,101
+
+[Color4Intense]
+Color=84,84,255
+
+[Color5]
+Color=178,24,178
+
+[Color5Faint]
+Color=101,0,101
+
+[Color5Intense]
+Color=255,84,255
+
+[Color6]
+Color=24,178,178
+
+[Color6Faint]
+Color=0,101,101
+
+[Color6Intense]
+Color=84,255,255
+
+[Color7]
+Color=178,178,178
+
+[Color7Faint]
+Color=101,101,101
+
+[Color7Intense]
+Color=255,255,255
+
+[Foreground]
+Color=0,0,0
+
+[ForegroundFaint]
+Color=0,0,0
+
+[ForegroundIntense]
+Color=0,0,0
+
+[General]
+Blur=false
+ColorRandomization=false
+Description=ianktheme
+Opacity=1
+Wallpaper=
[Appearance]
-ColorScheme=BlackOnLightYellow
+ColorScheme=ianktheme
Font=DejaVu Sans Mono,12,-1,5,50,0,0,0,0,0
[General]