Skip to content
islomarPublic

About

All general purpose dot files with preferences and settings.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Contents

dotfiles

All general purpose dot files with preferences and settings.

git clone git@github.com:islomar/dotfiles.git ~/.dotfiles

Some references used:

OS setups

Git hooks

The hooks in hooks/ run in every repository on the machine, or only in the repositories you choose.

Setup

Both options set core.hooksPath. A repository's local value overrides the global one.

Option Script Where the setting goes
Every repository scripts/configure-global-git-hooks.sh Global Git config: core.hooksPath = ~/.dotfiles/hooks
One repository scripts/configure-local-git-hooks.sh [repository-path] That repository's .git/config

~/.gitconfig links to home/.gitconfig, which already contains the global setting. A machine that links home/.gitconfig gets the hooks in every repository. To use only the local option, remove hooksPath from home/.gitconfig on that machine.

configure-local-git-hooks.sh uses the current directory if you pass no path. It does not replace an existing local core.hooksPath, such as one set by Husky, because that turns off the other tool's hooks. It prints the command to replace it anyway. To undo it, run git config --unset core.hooksPath in the repository.

A repository with its own local core.hooksPath ignores the global hooks.

Turn the hooks off in one repository

With the global option, run this in the repository:

git config core.hooksPath .git/hooks

Git then runs only the repository's own hooks from .git/hooks. To turn the global hooks back on, run git config --unset core.hooksPath.

Hooks

Each file in hooks/ only calls the script with its name in scripts/, passing on its arguments and stdin. The script holds all the logic.

Hook Git runs it Script What the script runs Can block
pre-commit Before a commit pre-commit.sh The checks below Yes
pre-push Before a push pre-push.sh detect-push-without-tests.sh Yes
post-merge After a merge or a fast-forward pull post-merge.sh install-dependencies-on-change.sh No
post-rewrite After a rebase or commit --amend post-rewrite.sh install-dependencies-on-change.sh, on rebase only No

scripts/pre-commit.sh runs three checks:

  1. detect-commit-without-tests.sh rejects a commit that changes JS/TS or Elixir source files without a test file. pre-push runs the same check on the pushed commits. A repository can leave paths out of it with a .no-tests-ignore file at its root: one extended regex per line, matched against paths relative to the root. The check skips blank lines and lines that start with #. This repository's .no-tests-ignore leaves out ^apps/.
  2. generate-markdown-toc.sh updates the doctoc table of contents in staged Markdown files and stages the result. It decodes percent-encoded anchors (#d%C3%ADa to #día), because rumdl only accepts the decoded form.
  3. check-markdown.sh --staged runs rumdl and Vale on staged Markdown files. rumdl fixes what it can and stages the fixes. Vale only reports: it blocks the commit only when it cannot run. Vale uses the repository's .vale.ini if present, otherwise config/vale/.vale.ini.

install-dependencies-on-change.sh compares the commit before the pull with HEAD and runs one command per changed dependency file:

Changed file Command
pyproject.toml, poetry.lock make build
package.json, yarn.lock yarn install if yarn.lock exists, otherwise npm install; then npm run build
mix.exs, mix.lock mix deps.get && mix compile
.tool-versions asdf install, then the Elixir setup steps from the stonehenge workflow

These commands come from the repository you pull. A pull in an untrusted repository runs that repository's build and install scripts.

With pull.rebase = true, a pull without local commits runs post-merge. A pull with local commits rebases them and runs post-rewrite instead. Both run the same dependency check.

Repository hooks

Git skips .git/hooks when core.hooksPath has a value. Each hook script calls scripts/run-local-git-hook.sh at the end, which runs the repository's own hook of the same name, if present. This covers pre-commit, pre-push, post-merge and post-rewrite only. Other hooks in .git/hooks, such as commit-msg, do not run.

Requirements

  • Markdown checks: rumdl, Vale and doctoc (npm install --global doctoc). Download the Vale styles once with vale sync --config ~/.dotfiles/config/vale/.vale.ini. Spell checking accepts English and Spanish. The Spanish dictionary lives in config/vale/styles/config/dictionaries, so it needs no extra install. It comes from the LibreOffice dictionaries (Debian package hunspell-es), tri-licensed under GPL, LGPL and MPL.
  • Dependency check: the tools of each project, such as make, npm, yarn, mix and asdf.

Skip the hooks

  • One commit or push: git commit --no-verify, git push --no-verify.
  • One pull: git -c core.hooksPath=/dev/null pull.

Interesting tools

OSX

Linux

IntelliJ settings

  • I'm using the "IDE Settings Sync" plugin, which syncs the IDE settings on every instance where I'm logged in.
  • Still, the exported settings are included in this repo as a ZIP file

Android: Tasker step automation

Tasker writes 25,000 steps per day into Health Connect. Setup for a new phone, the ADB helper script and the Tasker backup are in apps/tasker.

How to set up my Stream Deck Mini

  • elgato Stream Deck Mini
  • https://help.elgato.com/hc/en-us/articles/360028232451-Elgato-Stream-Deck-Plugins
  • App: StreamController, installed with Flatpak
  • Run install_elgato_stream_deck.sh. It installs StreamController, adds the udev rule for the device and restores the pages from apps/streamcontroller/ if StreamController has none.
  • On GNOME, the script also sets up automatic page switching by window: it sets XDG_CURRENT_DESKTOP=GNOME for the Flatpak and requests the StreamController GNOME extension. Approve the GNOME dialog, then restart StreamController.
  • In StreamController, open the menu > Open Store and install what the pages use:
    • Plugins: OS, Deck, OBS, Clocks, Weather, Battery and Speedtest.
    • Icon packs: Material Icons and Bootstrap Icons. The pages refer to these icons, and export_apps.sh does not export them.
  • In Settings > Plugins > OBS, enter the OBS WebSocket password.
  • The OBS buttons run obs-ctl (scripts/obs-ctl), linked into ~/.local/bin by install-home-files.sh.
  • export_apps.sh exports the current pages to apps/streamcontroller/.
  • StreamController adds its own autostart entry.
  • Focus the browser tab that plays sound: apps/focus-audible-tab-extension. An OS plugin Hotkey action sends Alt+Shift+M. The browser must have focus.
  • Google Meet controls: streamdeck-googlemeet.
    • Version 1.6.3. The release page has the Chrome extension, the Firefox extension and the Stream Deck plugin.
    • The browser extension connects to the plugin on ws://127.0.0.1:2394.
    • The plugin runs in OpenDeck, which runs Elgato Stream Deck plugins on Linux. OpenDeck installs it as ~/.config/opendeck/plugins/com.chrisregado.googlemeet.sdPlugin.
    • Chrome loads the extension unpacked from apps/chrome-extension-v1.6.3. Do not move or delete this folder. Chrome does not keep its own copy.
    • Firefox installs the extension from the .xpi file and keeps its own copy in the profile.
  • Icons:

ydotool

Wacom tablet

Installation

Software

OpenBoard installation

About

All general purpose dot files with preferences and settings.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages