Files
ansible-role-oh-my-zsh/README.md
2025-01-09 20:06:21 +01:00

61 lines
6.8 KiB
Markdown

# Ansible Role Oh My ZSH - Powerlevel10k
This is a basic Ansible role to enable and configure Oh My Zsh on Fedora, Ubuntu or Debian. It should also work on many other \*nix variants. It performs the following tasks:
- Install and minimally configure Zsh:
- make sure it exists,
- set it as the default shell for the user specified by the role.
- Install Oh My Zsh for each specified user (in `~/.oh-my-zsh` by default).
- Configure (Oh My) Zsh by optionally creating a `.zshrc` file for each
specified user.
- Alternately, configure Zsh by adding a block of lines to individual
users' `.zshrc` files.
- Installs and configure PowerLevel10k theme
## Role variables - ZSH - Oh My ZSH
| **Variable name** | **Default value** | **Description** |
|----------------|---------------|-------------|
| `zsh_users` | `{{ ansible_user_id }}` | List of users to install Zsh, Oh My ZSH and PowerLevel10K |
| `omz_install_zsh` | `false` | Defines whether or not the role should attempt to install Zsh. |
| `omz_custom_settings` | `-` | Extra settings (as a mult-line string) such as variable exports or aliases to add to the user's `.zshrc` file. Only used if `omz_zshrc_create` is `true`. |
| `omz_git_repository` | `https://github.com/robbyrussell/oh-my-zsh.git` | The git repo to clone Oh My Zsh from. |
| `omz_install_directory` | `.oh-my-zsh` | The name of the directory to clone Oh My Zsh into. |
| `omz_zshrc_create` | `true` | Whether or not to create `.zshrc`. If `true`, will create `.zshrc` from a template. |
| `omz_zshrc_template` | `templates/zshrc.zsh-template.j2` | The template used to create the user's `.zshrc` file when `omz_zshrc_create` is `true`. |
| `omz_zshrc_backup` | `true` | Whether or not to create backup the existing `.zshrc` files when the role changes it. |
| `omz_case_sensitive` | `false` | See `templates/zshrc.zsh-template`. |
| `omz_hyphen_insensitive` | `false` | See `templates/zshrc.zsh-template`. |
| `omz_disable_auto_update` | `false` | See `templates/zshrc.zsh-template`. |
| `omz_update_zsh_days` | `13` | See `templates/zshrc.zsh-template`. |
| `omz_disable_ls_colors` | `false` | See `templates/zshrc.zsh-template`. |
| `omz_disable_auto_title` | `false` | See `templates/zshrc.zsh-template`. |
| `omz_enable_correction` | `false` | See `templates/zshrc.zsh-template`. |
| `omz_completion_waiting_dots` | `false` | See `templates/zshrc.zsh-template`. |
| `omz_disable_untracked_files_dirty` | `false` | See `templates/zshrc.zsh-template`. |
| `omz_hist_stamps` | `mm/dd/yyyy` | See `templates/zshrc.zsh-template`. |
| `omz_zsh_custom` | `$ZSH/custom` | See `templates/zshrc.zsh-template`. |
| `omz_plugins` | `[]` | A list of Oh My Zsh plugins to enable. |
## Role variables - Oh My ZSH
| **Variable name** | **Default value** | **Description** |
|-----------------------------------|---------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------|
| `p10k_repository_url` | `'https://github.com/romkatv/powerlevel10k.git'` | GitHub repository URL for Powerlevel10k. |
| `p10k_prompt_style` | `"classic"` | Powerlevel10k theme style to use. |
| `p10k_prompt_time` | `"24-hour"` | Time format to display in the prompt. Valid values: no, 24-hour, 12-hour. |
| `p10k_prompt_separator` | `"angled"` | Prompt separator. Valid values: angled, vertical, slanted, round. |
| `p10k_prompt_head` | `"sharp"` | Prompt head. Valid values: sharp, blurred, slanted, round. |
| `p10k_prompt_tails` | `"flat"` | Prompt tail. Valid values: flat, blurred, sharp, slanted, round. |
| `p10k_prompt_height` | `"two-lines"` | Terminal prompt height. Valid values: one-line, two-lines. |
| `p10k_prompt_connection` | `"disconnected"` | Prompt connection (only used if `p10k_prompt_height` is set to `two-lines`). |
| `p10k_prompt_connection_color` | `"dark"` | Connection color for the prompt (only used if `p10k_prompt_connection` is `dotted` or `solid`). |
| `p10k_prompt_frame` | `"left"` | Prompt frame. Valid values: no, left, right, full. |
| `p10k_prompt_spacing` | `"compact"` | Prompt spacing. Valid values: compact, sparse. |
| `p10k_prompt_flow` | `"concise"` | Prompt flow. Valid values: concise, fluent. |
| `p10k_transient_prompt` | `"no"` | Enable or disable transient prompt. Valid values: yes, no. |
### Sources:
- https://github.com/diodonfrost/ansible-role-p10k/tree/master
- https://github.com/ctorgalson/ansible-role-oh-my-zsh/tree/master