| scripts | ||
| install.sh | ||
| README.md | ||
Overview
This repository is a toolkit of practical shell scripts for everyday development, media handling, and system management. Installation is straightforward—clone the repo, run the installer, and all scripts are linked system-wide. Included scripts:
- install.sh – Makes all
scripts/files executable and symlinks them into/usr/bin. - add-worktree-for-all-branches – Creates local branches for all remotes and sets up dedicated Git worktrees for each.
- add-worktree – Creates local branches a specific remote and sets up a dedicated git worktree.
- chtsh – Lets you search programming languages and system utilities on cht.sh via an interactive
fzf/tmuxinterface. - fastermp3 – Speeds up all
.mp3files in the current directory by 1.5× usingsox. - set-evn-git-identity – Applies a predefined Git identity to all repos within a certain directory.
- setmetadatamp3 – Adds artist, album, year, and title ID3 tags to all
.mp3files in the current directory. - tmux-sessionizer – Quickly jump into a chosen project directory in a new
tmuxwindow usingfzf. - tmux-name-window – Quickly rename the current
tmuxwindow after the currentPWD. - vpn-toggle – Toggles WireGuard VPN connections on or off interactively.
- datamine-zsh-history – Analyzes your
zshhistory to reveal the most-used subcommands for a given CLI tool, ranked by frequency.
Clone and Install
via ssh
git clone ssh://git@git.ramboe.io:9022/configuration/scripts.git "$HOME/ramboe_scripts" && \
cd "$HOME/ramboe_scripts" && \
. ./install.sh
or, via https:
git clone https://git@git.ramboe.io/configuration/scripts.git $HOME/ramboe_scripts && \
cd "$HOME/ramboe_scripts" && \
. ./install.sh
Scripts
install.sh
The install.sh script makes all files in scripts/ executable and symlinks them into /usr/bin for system-wide access. Run it from the repository root so $PWD/scripts resolves correctly.
scripts/add-worktree-for-all-branches
This script fetches all remote branches, creates local tracking branches for any that don’t exist, and then sets up separate Git worktrees for each branch in sibling directories. Run it from the repository root to organize all branches into dedicated folders.
scripts/chtsh
from inside tmux
This script uses fzf to let you choose a programming language or system utility, prompts for a query via whiptail, and then opens a tmux split showing results from cht.sh. Languages use slash-style queries (/), while core utilities use tilde-style (~).
Use it in your .zshrc like so
hit F5 to start chtsh query
# Define a function to run the chtsh script
run_cheatsheet() {
/usr/bin/chtsh
zle redisplay
}
## Bind F5 to the run_cheatsheet function
zle -N run_cheatsheet
bindkey "${terminfo[kf5]}" run_cheatsheet
scripts/fastermp3
This script processes all .mp3 files in the current directory, creating faster versions (1.5× speed) with filenames prefixed by faster_. Requires sox to be installed
scripts/set-evn-git-identity
Interactive script: uses fzf to let you pick a parent directory (from the current directory’s immediate subfolders), then prompts for user.name and user.email and applies them to every Git repo directly under that parent. Requires fzf; non-Git folders are skipped.
scripts/setmetadatamp3
This script prompts for an artist and album name, then applies ID3 tags (artist, album, year, and title) to all .mp3 files in the current directory using id3v2.
The title is taken from each filename.
scripts/tmux-name-window
from inside tmux
This script renames the current tmux window to match the name of the directory you’re in, making it easier to identify windows by their working folder.
scripts/tmux-sessionizer
from inside tmux
This script uses fzf to let you interactively pick a directory from several predefined paths, then opens a new tmux window named after that directory and starts in it.
It’s a quick way to jump into a project folder within your current tmux session.
Use it in your .zshrc like so
DEFAULT_DIRS - hit Ctrl-f to fzf through predefined directories
# Define a function to run the tmuxsesstionizer script
run_tmuxsesstionizer() {
/usr/bin/tmux-sessionizer
zle redisplay
}
# Bind Ctrl-f to the run_tmuxsesstionizer function
zle -N run_tmuxsesstionizer
bindkey '^F' run_tmuxsesstionizer
. - hit F3 to fzf down from the current directory
run_tmuxsesstionizer_here() {
/usr/bin/tmux-sessionizer .
zle redisplay
}
zle -N run_tmuxsesstionizer_here
# Bind F3 to the run_tmuxsesstionizer_here function
bindkey "${terminfo[kf3]}" run_tmuxsesstionizer_here
add-worktree
A small helper script to quickly create a Git worktree for any branch, chosen via fzf.
Features
- Fetches remote branches before selection
- Lets you pick a branch with
fzf, showing recent commits as a preview - Creates a local tracking branch if it only exists on
origin/ - Prevents duplicate worktrees and skips existing target directories
- Places new worktrees in
../<repo>-<branch>
Usage
./add-worktree
vpn-toggle
This script toggles WireGuard connections. If a WireGuard interface is active, it brings it down; otherwise, it lists available .conf files in /etc/wireguard, lets you choose one, and activates it using wg-quick.
datamine-zsh-history
This script analyzes your zsh history to show which subcommands you use most for a given CLI tool (e.g. git, dotnet), grouping similar commands and ranking them by percentage.
Example:
datamine-zsh-history git
---
# git add 45.00% (9)
# git commit 30.00% (6)
# git status 25.00% (5)