Skip to content

Instantly share code, notes, and snippets.

@armamini
Created December 8, 2025 14:42
Show Gist options
  • Select an option

  • Save armamini/e7dfcfb909f8c793707e14faba757cfd to your computer and use it in GitHub Desktop.

Select an option

Save armamini/e7dfcfb909f8c793707e14faba757cfd to your computer and use it in GitHub Desktop.
A script for generating unique usernames

Preferred Installation

chmod +x idgen.sh && \
echo "alias idgen='$(pwd)/idgen.sh'" >> ~/.zshrc && \
source ~/.zshrc

Usage

idgen
#!/usr/bin/env bash
# ---------- 30 primary adjectives ----------
PRIMARY_ADJECTIVES=(
"ancient" "brilliant" "calm" "daring" "elegant" "fierce"
"gentle" "heroic" "infinite" "jovial" "keen" "luminous"
"mystic" "noble" "optimal" "primed" "quiet" "radiant"
"silent" "stellar" "timeless" "untamed" "vivid" "wild"
"youthful" "zealous" "robust" "crisp" "bold" "serene"
)
# ---------- 30 secondary adjectives ----------
SECONDARY_ADJECTIVES=(
"agile" "brisk" "crimson" "dynamic" "etheric" "fearless"
"glowing" "hollow" "icy" "jaded" "knotted" "lunar"
"massive" "nimble" "ornate" "polished" "quick" "rigid"
"shifting" "tender" "ultra" "velvet" "woven" "xenial"
"yearning" "zonal" "stark" "brutal" "gentlemanly" "sparkling"
)
# ---------- 30 animals ----------
ANIMALS=(
"lion" "tiger" "cheetah" "panther" "jaguar" "leopard"
"wolf" "fox" "bear" "eagle" "falcon" "owl"
"shark" "dolphin" "whale" "orca" "rhino" "hippo"
"elephant" "giraffe" "buffalo" "boar" "lynx" "cougar"
"otter" "badger" "raven" "crow" "hawk" "python"
)
# ---- Function to select a random element from any array ----
pick_random_element() {
local array=("$@")
local total=${#array[@]}
local index=$(( RANDOM % total ))
echo "${array[$index]}"
}
# ---- Generate unique identifier ----
first_adj=$(pick_random_element "${PRIMARY_ADJECTIVES[@]}")
second_adj=$(pick_random_element "${SECONDARY_ADJECTIVES[@]}")
animal=$(pick_random_element "${ANIMALS[@]}")
echo "${first_adj}-${second_adj}-${animal}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment