A collection of small shell utilities.
| Script | Description |
|---|---|
| git-co | Fuzzy-matching git branch checkout with typo correction and interactive selection |
| git-branch-clean | Prune stale remote refs and delete local branches whose remote is gone |
| git-branch-close | Fast-forward merge current branch into default branch, push, and delete it |
| git-commit-msg | Generate a commit message from staged (or unstaged) changes using Claude |
| idle-power-manager.sh | Automatic CPU power profile switcher based on GNOME idle detection |
| neon2json | Convert NEON (Nette Object Notation) to JSON, for LLMs and tools that don't speak NEON |
Run install.sh to symlink all scripts to ~/.local/bin/ in one command:
./install.shUse --force to overwrite existing symlinks:
./install.sh --force~/.local/bin/ is created automatically if it does not exist. Each script is
symlinked from the repository directory, so you can update scripts with a
git pull and the changes take effect immediately.
Fuzzy-matching git branch checkout.
Checks out a branch by name. If the exact name is not found, falls back to fuzzy matching and either auto-switches to the single closest match or presents a numbered menu when multiple candidates exist.
Fallback chain: fzf (if installed) → substring match → Levenshtein distance
git-co <branch>
git-co -h | --help
git-co main # exact match — switches immediately
git-co feat/login # tracks origin/feat/login if not local yet
git-co logn # typo → finds 'feat/login', auto-checks out
git-co feat # multiple matches → interactive numbered menuCopy or symlink git-co to any directory on your $PATH:
ln -s "$PWD/git-co" ~/.local/bin/git-cofzf is optional but recommended for better fuzzy matching.
Prune stale remote refs and delete local branches whose remote is gone.
Runs git fetch --prune, then deletes every local branch that tracked a remote
branch which no longer exists. Safe to run routinely after merging or closing
feature branches.
git-branch-clean [-h|--help]
$ git-branch-clean
Fetching and pruning...
Deleted branch feature/login (was abc1234).
Deleted branch fix/typo (was def5678).ln -s "$PWD/git-branch-clean" ~/.local/bin/git-branch-cleanFast-forward merge current branch into the default branch, push, and delete it.
A single command to finish a feature branch: fast-forwards main (or master)
to the current branch, pushes to origin, and removes the branch locally and
remotely. The default branch is auto-detected from origin/HEAD; falls back to
checking for main then master. Refuses to proceed if a fast-forward is not
possible.
git-branch-close [-h|--help]
$ git-branch-close
Closing branch: feature/login → main
Fetching latest changes...
Switching to main...
Fast-forwarding main to feature/login...
Pushing main to origin...
Branch feature/login successfully closed and merged into main.ln -s "$PWD/git-branch-close" ~/.local/bin/git-branch-closeGenerate a commit message from staged (or unstaged) changes using Claude.
Inspects the current diff (staged changes first; falls back to all unstaged changes if nothing is staged), asks Claude to draft a concise commit message in plain imperative style, then opens your configured git editor pre-filled with the result so you can review and edit before committing.
git-commit-msg [-h|--help]
$ git-commit-msg
Generating commit message...
# editor opens pre-filled with:
# Fix null pointer in auth middleware when session token is missingclaude— Claude CLI (npm install -g @anthropic-ai/claude-codeor see claude.ai/code)
ln -s "$PWD/git-commit-msg" ~/.local/bin/git-commit-msgAutomatic CPU power profile switcher based on idle detection.
Monitors user activity via GNOME Mutter DBus (Wayland-native, no sudo needed). Switches to a powersave tuned profile after a configurable idle timeout and restores the performance profile as soon as activity is detected. The performance profile is auto-detected from the active tuned profile at startup.
Requirements: gdbus (glib2), tuned + tuned-adm, GNOME session (Wayland), wheel group membership
idle-power-manager.sh [-h|--help]
IDLE_THRESHOLD_MINS=20 idle-power-manager.sh
All settings are controlled via environment variables:
| Variable | Default | Description |
|---|---|---|
IDLE_THRESHOLD_MINS |
15 |
Minutes of inactivity before switching profiles |
PERFORMANCE_PROFILE |
auto-detected from current tuned profile | Profile to restore when activity is detected |
IDLE_PROFILE |
powersave |
Profile to apply when idle |
CHECK_INTERVAL |
30 |
Seconds between idle checks |
WAKE_THRESHOLD_SECS |
3 |
Idle must drop below this to count as "woke up" |
LOG_FILE |
~/.local/share/idle-power-manager.log |
Log file path |
| Dependency | Notes |
|---|---|
gdbus |
DBus CLI tool from the glib2 package — usually pre-installed on GNOME |
tuned |
Must be installed and the system service running |
tuned-adm |
CLI for tuned, part of the tuned package |
polkit / wheel group |
Profile switching calls tuned via system DBus; polkit grants access to wheel group members without sudo |
| GNOME session (Wayland) | Idle time is read from org.gnome.Mutter.IdleMonitor |
Install and enable tuned if not present:
sudo dnf install tuned # Fedora/RHEL
sudo systemctl enable --now tunedVerify your user is in the wheel group:
groups $USER # should include 'wheel'The service starts automatically after login when the GNOME graphical session is ready.
1. Copy the script to ~/bin/ (or adjust ExecStart to your preferred path):
cp idle-power-manager.sh ~/bin/
chmod +x ~/bin/idle-power-manager.sh2. Create the service file at ~/.config/systemd/user/idle-power-manager.service:
[Unit]
Description=Idle Power Manager - switch to powersave on inactivity
After=graphical-session.target
Wants=graphical-session.target
[Service]
Type=simple
ExecStart=%h/bin/idle-power-manager.sh
Restart=on-failure
RestartSec=10s
Environment="IDLE_THRESHOLD_MINS=15"
Environment="IDLE_PROFILE=powersave"
Environment="CHECK_INTERVAL=30"
Environment="WAKE_THRESHOLD_SECS=3"
[Install]
WantedBy=graphical-session.target3. Enable and start:
systemctl --user daemon-reload
systemctl --user enable --now idle-power-manager.service4. Check status / logs:
systemctl --user status idle-power-manager.service
journalctl --user -u idle-power-manager.service -fsystemctl --user edit idle-power-manager.serviceAdd an override section, for example:
[Service]
Environment="IDLE_THRESHOLD_MINS=20"Then reload: systemctl --user daemon-reload && systemctl --user restart idle-power-manager.service
Convert NEON (Nette Object Notation) to JSON.
Parses NEON from a file argument or stdin using Nette's NEON library and prints the corresponding JSON to stdout. Useful for feeding Nette config files into LLMs and other tools that don't know the NEON format.
DateTime values are rendered as ISO 8601 strings. NEON entities (e.g.
Service(arg: 1)) are rendered as objects with __neon_entity: true, value,
and attributes keys.
neon2json [-h|--help] [file]
neon2json config.neon # read file
cat config.neon | neon2json # read stdin
neon2json < config.neon # read stdinphp— PHP 8.1+composer— runcomposer installin this repo to fetchnette/neon
composer install
ln -s "$PWD/neon2json" ~/.local/bin/neon2json