Skip to content
mb6ockatfPublic

Latest commit

 

History

282 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dotfiles -- mb6ockatf's configuration files
===========================================

mb6ockatf's configuration files, installed into $HOME with GNU stow.

Install
-------

    make install      link everything into $HOME, enable the git hooks
    make dry-run      show what install would do
    make uninstall    remove the links
    make check        syntax-check shell files, scan for personal data,
                      test-run clawd-banner
    make lint         shellcheck the shell files
    make man          regenerate the manual pages from man/*.m4

or by hand:

    stow -t $HOME -R .
    stow -t $HOME -D .

What is not linked
------------------

.stow-local-ignore keeps these out of $HOME: README, NEWS, TODO,
Makefile, man/, system/, .githooks/, .github/, archive/, .shellcheckrc
and *.bak backups.

man/ holds the m4 sources of the manual pages.  Edit those, not the
generated pages under .local/share/man; make man (and make install)
regenerates them.

system/ holds root-owned files that live outside $HOME, laid out like
their paths under /.  make system installs them with sudo (stow does
not touch them):

    system/usr/local/sbin/nala-predownload
    system/etc/cron.d/nala-predownload

        Every 15 minutes, cron checks whether the laptop has been on AC
        and awake for 8 hours without a break, last downloaded at least
        8 hours ago, and can reach the first apt mirror.  If so, it runs
        "nala upgrade --full --download-only" at idle priority, so the
        next upgrade only installs.  Log: /var/log/nala-predownload.log.

    system/etc/cron.weekly/fstrim

        Trims the SSD weekly through anacron (there is no systemd
        fstrim timer here).  Log: /var/log/fstrim.log.

    system/etc/sysctl.d/90-zram.conf

        vm.swappiness 180 and vm.page-cluster 0, which suit zram, plus
        vm.watermark_scale_factor 125 and vm.watermark_boost_factor 0,
        so the kernel reclaims memory in the background before programs
        stall on it.

    system/etc/default/zramswap

        zram swap of 100% of RAM (zstd, priority 100, used before the
        disk swap); it only takes RAM for what is swapped into it.
        Takes effect at the next boot.

    system/usr/local/sbin/zram-compact
    system/etc/cron.d/zram-compact

        Compacts the zram swap every night at 04:00, so memory freed
        inside it goes back to the system.  Log: /var/log/zram-compact.log
        (zram RAM use before -> after).

    system/etc/cron.d/morning-report

        Runs ~/.local/bin/morning-report as mb6ockatf every day at 07:00.

    system/etc/cron.d/telegram-restart

        Runs ~/.local/bin/telegram-restart as mb6ockatf every day at 04:30.

Docker, PostgreSQL, exim4 and CUPS do not start at boot
(update-rc.d NAME disable); start one with "sudo service NAME start"
when needed (docker, postgresql, exim4, cups and cups-browsed).
Without the exim4 daemon, local mail such as cron output is still
delivered when it is sent, but deferred mail is not retried.

archive/ holds configs for software that is no longer installed (NixOS,
pacman, PowerShell, fish, kakoune, csh, Tor Browser, neofetch, htop,
nano, GIMP 2.6, and vim and vi, replaced by neovim).  Move a file back
out of archive/ and restow to use it again.

Generated files stay untracked: ~/.fehbg (rewritten by feh).  The
neovim vim-stats plugin keeps its data in ~/.local/state/nvim/vim-stats.

Private and machine-specific settings
-------------------------------------

Nothing personal belongs in this repository.  Put private or
machine-specific settings in ~/.profile.local, which ~/.profile sources
if it exists.  It may call path_prepend, for example:

    path_prepend "${HOME}/.local/opt/gcc-16/bin"
    export SOME_HOST=...

Your git name and email go in ~/.gitconfig.local, which the tracked
~/.gitconfig includes:

    [user]
    	name = ...
    	email = ...

.githooks/pre-commit refuses commits that add email addresses, IPv4
addresses, ssh logins, private keys or credentials.  Harmless matches go
in .githooks/allowlist.

GitHub
------

.github/workflows/check.yml runs make check, make lint and a stow
install into an empty directory on every push.
.github/workflows/gitleaks.yml scans the whole history for secrets.
.github/dependabot.yml opens a monthly pull request for the workflow
actions.

Shell start-up
--------------

~/.profile       PATH and ~/.profile.local; POSIX sh, safe to re-run
~/.bash_profile  sources ~/.profile and ~/.bashrc
~/.bashrc        sources ~/.profile, then the interactive settings,
                 ~/.bash_aliases and ~/.config/functions.sh
~/.bash_aliases  aliases and the option variables they use, plus the
                 claude killswitch guard (managed by ~/killswitch-*.sh)
~/.config/functions.sh
                 shell functions: rm, find, make, za, ed, mkcd, the
                 claude -p helpers (ask, howto, why, explain, askclip)
~/.xsessionrc    read by lightdm (Debian Xsession); sources ~/.profile
                 and ~/.xprofile
~/.xprofile      X settings: compose key, Xresources
~/.xinitrc       sources ~/.xprofile, then starts bspwm (startx)

~/.bashrc ends with a banner: the UNIX emblem from
~/.config/clawd-banner/emblem framed by Clawds, Claude Code's mascot,
in random poses and in Anthropic's orange, blue and green, with some
mid- and light-gray ghosts.  The poses follow the time of day: mostly
sleeping from 23:00 to 6:00, waving and cheering from 6:00 to 11:00,
anything otherwise.  The season nudges colours and poses a little and
may scatter specks around the frame: winter (Dec-Feb, a little more
blue, snowflakes ✻), spring (Mar-May, more green, waving and hopping),
summer (Jun-Aug, more orange and blue, hopping) and autumn (Sep-Nov,
more orange and gray, looking around).  Holidays override the season
and add a greeting line: Halloween (Oct 24 - Nov 1, ghosts with floating
tails), New Year (Dec 28 - Jan 8, cheering, confetti), Programmer's Day
(day 256 of the year, green, binary digits) and Claude Code's birthday
week (Feb 24 - Mar 2, orange, cheering).  In the first shell after each
boot, a Clawd spins once (about 0.6 s) before the banner.

From the 100th prompt of a shell on, before about one prompt in 100, a
small scene appears: Clawd having a coffee, coding, fishing, juggling,
humming, reading man bash, ...  After a failed command (not Ctrl-C or
Ctrl-Z) it is a comforting one, and at night it is often a sleepy one.
clawd scene shows one on demand
(clawd scene 1: one for a failed command).

Under the art come three lines: the host, OS, kernel, uptime, date and
ISO week (dropping parts that do not fit); a random tip from the blesh,
fzf, kitty, sxhkd, info and Texinfo guides in man7; and, when the
weekly dotfiles commit is due (uncommitted changes and a last commit 7
or more days old), a reminder with the staged and unstaged counts.

An unknown command gets a puzzled Clawd instead of "command not
found" (command_not_found_handle in ~/.bashrc): it suggests the command
one typo away (a swapped, missing, extra or wrong character), preferring
swaps and then names with the same first letter, e.g. gti -> git,
sl -> ls.  The exit status stays 127.

The desktop matches kitty's Claude Warm theme: polybar's [colors] and
~/.config/rofi/claude-warm.rasi (set in ~/.config/rofi/config.rasi)
use the same palette.  sudo-askpass keeps its own grey and orange
style so that a password prompt stays hard to miss.  Above the command
it shows the keyboard layout active when the prompt opened (read by
~/.local/bin/xkb-layout, which prints the current XKB group's layout
name, or its index with --index); any layout but the first is in red,
so a password is not typed in the wrong one.

~/.local/bin/clawd-banner pregenerates the art into
~/.cache/clawd-banner/art: 8 random variants (-n COUNT) of each layout,
full (100 columns, Clawds all around) and narrow (64 columns, a row
above and below), in truecolor and 256 colours, for each time of day;
plus the spin frames, the scenes, the tips, the greeting and the season
with its end date.  CLAWD_BANNER_DATE=YYYY-MM-DD clawd-banner previews
another day's season (into the real cache; run clawd-banner again to
go back).  Only
one instance generates at a time (flock); others exit at once.
clawd-banner --dotfiles refreshes the reminder, which ~/.bashrc does in
the background at most once an hour.  ~/.bashrc picks a variant for the
terminal's width (narrower than 64 columns: only the text lines) and
colour depth (truecolor when COLORTERM says so).  The banner shows only
in a shell started directly by kitty, login or sshd, not in tmux panes,
nvim's :terminal or nested shells; the clawd command shows it again
anywhere, without the spin.  When the art is missing, older than the
emblem or the script, or the season has ended, ~/.bashrc regenerates it
in the background, so that shell gets the text lines only.  The
FGCLAUDE* colour variables in ~/.bashrc follow the same colour depth.

~/.local/bin/clean-history tidies ~/.bash_history with
~/.config/clean_history.sed.  It is not run automatically.

~/.local/bin/morning-report lists what is worth closing to free memory
and closes nothing: Claude Code sessions open for over a day, dev
servers (next-server, vite, webpack, uvicorn, gunicorn, flask run,
http.server, jupyter, npm run/start) up for over a day, and Firefox tab
processes over 1 GB (find the page in about:processes), under a line
with the available memory and swap use.  It shows a dunst popup that
stays until dismissed, finding the X session through dunst's
environment when run from cron; --print writes to stdout instead.
Each report is appended to ~/.local/state/morning-report.log.

~/.local/bin/vocab prints the emoji shorthand shared with Claude Code,
kept in ~/.config/emoji-vocab/words as "emoji<TAB>word" lines (lines
starting with # are comments) and imported by ~/.claude/CLAUDE.md, so
either side may write the emoji in place of the word.  With arguments,
it translates each word to its emoji or each emoji to its word, ignoring
case and the emoji variation selector, and exits 1 if one is missing.

~/.local/bin/telegram-restart restarts Telegram Desktop into the tray
to drop the caches it piles up, only when it runs, uses more than
300 MB and the X session has been idle for 15 minutes.  It quits it with
SIGTERM and leaves it alone if it is still running 30 seconds later.
Log: ~/.local/state/telegram-restart.log.

~/.local/bin/manual-pkgs lists the packages apt marks as manually
installed (not pulled in as dependencies), each with its one-line
description, grouped by Debian section.  System packages are hidden:
those dpkg records with priority "required" or "important", or as
Essential or Protected (dpkg, debconf, sysvinit-core, bash, ...).
--system lists only them, --all lists everything with system packages
marked "sys".  --flat gives one alphabetical list, --section NAME shows
one section.  On a terminal the output is colored and paged with less
when it is longer than the screen; piped, it is
"name<TAB>section<TAB>summary", plus a "system"/"user" field with
--all.  NO_COLOR disables colors.  "Manual" still includes the other
packages the OS installer put in through its tasks (e.g. plocate):
apt cannot tell those from later installs.

Credits
-------

@adi1090x's configuration setup https://github.com/adi1090x/rofi

Copying
-------

Copyright (C) 2022-2026 mb6ockatf

These files are free software: you can redistribute them and/or modify
them under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or (at
your option) any later version, except where a file says otherwise.
See COPYING.