DEV Community

Cover image for ⚙️ ❮ Unique ID ❯
❮ ZI ❯ for Z-Shell

Posted on • Edited on • Originally published at z.digitalclouds.dev

2 2

⚙️ ❮ Unique ID ❯

❮ ZI ❯

https://z.digitalclouds.dev | GitHub | Twitter


This plugin provides a unique number that identifies a running Zshell session, in its shell variable $ZUID_ID.

Besides this unique number, also a unique codename is provided, in shell variable $ZUID_CODENAME.

Once you load this plugin, the two parameters will be set, and their values will not be available to other Zshell sessions (being thus unique).

$ZUID_ID is a progressing number starting from 1.

$ZUID_CODENAME is chosen from a list of predefined codenames, see the default list below.

An example use case is to hold logs in files .../mylog-${ZUID_CODENAME}.log,

so that two different Zshells will not write to the same file at the same time.


Default codenames are:

  • atlantis (for ZUID_ID == 1)
  • echelon (for ZUID_ID == 2)
  • quantum (etc.)
  • ion
  • proxima
  • polaris
  • solar
  • momentum
  • hyper
  • gloom
  • velocity
  • future
  • enigma
  • andromeda
  • saturn
  • jupiter
  • aslan
  • commodore
  • falcon
  • persepolis
  • dharma
  • samsara
  • prodigy
  • ethereal
  • epiphany
  • aurora
  • oblivion

Zstyle configuration allows to customize the codenames:

zstyle :plugin:zuid codenames paper metal wood plastic # first 4 shells will have those codenames
Enter fullscreen mode Exit fullscreen mode

Install Zsh Unique ID

The plugin is "standalone", which means that only sourcing it is needed (without using a plugin manager).

So to install, unpack zsh-unique-id somewhere and add:

source {where-zsh-unique-id-is}/zsh-unique-id.plugin.zsh
Enter fullscreen mode Exit fullscreen mode

to zshrc.

Sourcing is recommended, because it can be done early,
at top of zshrc, without a plugin manager – to acquire the unique identification as early as possible.

With ZI

Add zi load z-shell/zsh-unique-id to your .zshrc file. ZI will clone the plugin the next time you start zsh.

To update issue zi update z-shell/zsh-unique-id.

With Antigen

Add antigen bundle z-shell/zsh-unique-id to your .zshrc file.

Antigen will handle cloning the plugin for you automatically the next time you start zsh.

With Oh-My-Zsh

  1. cd ~/.oh-my-zsh/custom/plugins
  2. git clone git@github.com:z-shell/zsh-unique-id.git
  3. Add zsh-unique-id to your plugin list.

With Zgen

Add zgen load z-shell/zsh-unique-id to your .zshrc file in the same place you're doing your other zgen load calls in.

Quadratic AI

Quadratic AI – The Spreadsheet with AI, Code, and Connections

  • AI-Powered Insights: Ask questions in plain English and get instant visualizations
  • Multi-Language Support: Seamlessly switch between Python, SQL, and JavaScript in one workspace
  • Zero Setup Required: Connect to databases or drag-and-drop files straight from your browser
  • Live Collaboration: Work together in real-time, no matter where your team is located
  • Beyond Formulas: Tackle complex analysis that traditional spreadsheets can't handle

Get started for free.

Watch The Demo 📊✨

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay