https://z.digitalclouds.dev | GitHub | Twitter | Join the team
This plugin provides a unique number that identifies a running Zshell session, in its shell variable
Besides this unique number, also a unique codename is provided, in shell variable
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
$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
so that two different Zshells will not write to the same file at the same time.
Default codenames are:
- atlantis (for
- echelon (for
- quantum (etc.)
Zstyle configuration allows to customize the codenames:
zstyle :plugin:zuid codenames paper metal wood plastic # first 4 shells will have those codenames
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:
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.
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.
antigen bundle z-shell/zsh-unique-id to your
Antigen will handle cloning the plugin for you automatically the next time you start zsh.
git clone firstname.lastname@example.org:z-shell/zsh-unique-id.git
zsh-unique-idto your plugin list.
zgen load z-shell/zsh-unique-id to your .zshrc file in the same place you're doing your other
zgen load calls in.
Top comments (0)