From 726b7668f92ce2f9b45a883ff1f720e66695138f Mon Sep 17 00:00:00 2001 From: NaeiKinDus Date: Sun, 19 Nov 2023 00:00:00 +0000 Subject: [PATCH] feat: added new roles to match daily driver desktop; full idempotency; several fixes and tweaks; re-added hosts in inventory --- .editorconfig | 15 + .gitattributes | 2 + .gitignore | 1 - README.md | 66 +- TODO | 7 + Taskfile.yml | 2 +- .../infrastructure/playbooks/main_desktop.yml | 18 + .../plugins/modules/github_artifact.py | 261 +- .../plugins/tests/github_artifact.json | 48 +- .../fonts/JetBrainsMonoNerdFontMono-Bold.ttf | 3 + .../JetBrainsMonoNerdFontMono-BoldItalic.ttf | 3 + .../JetBrainsMonoNerdFontMono-Italic.ttf | 3 + .../JetBrainsMonoNerdFontMono-Regular.ttf | 3 + .../fonts/Meslo LG S NF Mono Bold Italic.ttf | 3 + .../assets/fonts/Meslo LG S NF Mono Bold.ttf | 3 + .../fonts/Meslo LG S NF Mono Italic.ttf | 3 + .../fonts/Meslo LG S NF Mono Regular.ttf | 3 + .../roles/common/defaults/main.yml | 8 + .../roles/common/handlers/main.yml | 4 + .../roles/common/tasks/home_setup.yml | 41 + .../roles/common/tasks/main.yml | 66 +- .../common/tasks/shell_customization.yml | 89 + .../roles/common/templates/home/.gitconfig.j2 | 107 + .../roles/common/templates/home/.lessfilter | 68 + .../roles/common/templates/home/.p10k.zsh | 1834 ++++++ .../roles/common/templates/home/.pythonrc | 7 + .../roles/common/templates/home/.zsh_aliases | 34 + .../common/templates/home/.zsh_completions | 21 + .../roles/common/templates/home/.zsh_exports | 29 + .../common/templates/home/.zsh_functions | 21 + .../roles/common/templates/home/.zshrc | 54 + .../templates/system/sysctld.local.conf.j2 | 3 + .../roles/development/defaults/main.yml | 2 + .../roles/development/handlers/main.yml | 7 +- .../roles/development/tasks/main.yml | 373 +- .../templates/docker-ce/daemon.json.j2 | 4 + .../roles/development/vars/main.yml | 2 +- .../roles/gaming/defaults/main.yml | 2 + .../roles/gaming/handlers/main.yml | 1 + .../infrastructure/roles/gaming/meta/main.yml | 21 + .../roles/gaming/tasks/main.yml | 56 + .../roles/gaming/tests/inventory | 2 + .../infrastructure/roles/gaming/vars/main.yml | 1 + .../roles/security/handlers/main.yml | 5 + .../roles/security/tasks/main.yml | 94 +- .../roles/workstation/defaults/main.yml | 4 +- .../roles/workstation/handlers/main.yml | 1 - .../roles/workstation/tasks/main.yml | 182 +- .../workstation/tasks/window_manager.yml | 150 + .../templates/.config/awesome/background.png | 3 + .../templates/.config/awesome/battery.lua | 138 + .../templates/.config/awesome/rc.lua | 759 +++ .../themes/powerarrow/theme-personal.lua | 386 ++ .../templates/.config/terminator/config | 21 + .../workstation/templates/.config/vlc/vlcrc | 5160 +++++++++++++++++ .../roles/workstation/templates/.xsession | 3 + .../workstation/templates/bin_wrapper.sh.j2 | 9 + .../workstation/templates/system/xorg.conf | 105 + inventory/host_vars/lithium/vars.yml | 3 + inventory/host_vars/localhost/vars.yml | 19 + inventory/host_vars/unobtainium/vars.yml | 19 + inventory/inventory.yml.dist | 12 + inventory/vault.yml.dist | 5 +- playbooks/internal.yml | 8 + scripts/generate_ansible_config.sh | 2 +- 65 files changed, 10012 insertions(+), 377 deletions(-) create mode 100644 .editorconfig create mode 100644 .gitattributes create mode 100644 TODO create mode 100644 collections/ansible_collections/nullified/infrastructure/playbooks/main_desktop.yml create mode 100644 collections/ansible_collections/nullified/infrastructure/roles/common/assets/fonts/JetBrainsMonoNerdFontMono-Bold.ttf create mode 100644 collections/ansible_collections/nullified/infrastructure/roles/common/assets/fonts/JetBrainsMonoNerdFontMono-BoldItalic.ttf create mode 100644 collections/ansible_collections/nullified/infrastructure/roles/common/assets/fonts/JetBrainsMonoNerdFontMono-Italic.ttf create mode 100644 collections/ansible_collections/nullified/infrastructure/roles/common/assets/fonts/JetBrainsMonoNerdFontMono-Regular.ttf create mode 100644 collections/ansible_collections/nullified/infrastructure/roles/common/assets/fonts/Meslo LG S NF Mono Bold Italic.ttf create mode 100644 collections/ansible_collections/nullified/infrastructure/roles/common/assets/fonts/Meslo LG S NF Mono Bold.ttf create mode 100644 collections/ansible_collections/nullified/infrastructure/roles/common/assets/fonts/Meslo LG S NF Mono Italic.ttf create mode 100644 collections/ansible_collections/nullified/infrastructure/roles/common/assets/fonts/Meslo LG S NF Mono Regular.ttf create mode 100644 collections/ansible_collections/nullified/infrastructure/roles/common/tasks/home_setup.yml create mode 100644 collections/ansible_collections/nullified/infrastructure/roles/common/tasks/shell_customization.yml create mode 100644 collections/ansible_collections/nullified/infrastructure/roles/common/templates/home/.gitconfig.j2 create mode 100755 collections/ansible_collections/nullified/infrastructure/roles/common/templates/home/.lessfilter create mode 100644 collections/ansible_collections/nullified/infrastructure/roles/common/templates/home/.p10k.zsh create mode 100644 collections/ansible_collections/nullified/infrastructure/roles/common/templates/home/.pythonrc create mode 100644 collections/ansible_collections/nullified/infrastructure/roles/common/templates/home/.zsh_aliases create mode 100644 collections/ansible_collections/nullified/infrastructure/roles/common/templates/home/.zsh_completions create mode 100644 collections/ansible_collections/nullified/infrastructure/roles/common/templates/home/.zsh_exports create mode 100644 collections/ansible_collections/nullified/infrastructure/roles/common/templates/home/.zsh_functions create mode 100644 collections/ansible_collections/nullified/infrastructure/roles/common/templates/home/.zshrc create mode 100644 collections/ansible_collections/nullified/infrastructure/roles/common/templates/system/sysctld.local.conf.j2 create mode 100644 collections/ansible_collections/nullified/infrastructure/roles/development/templates/docker-ce/daemon.json.j2 create mode 100644 collections/ansible_collections/nullified/infrastructure/roles/gaming/defaults/main.yml create mode 100644 collections/ansible_collections/nullified/infrastructure/roles/gaming/handlers/main.yml create mode 100644 collections/ansible_collections/nullified/infrastructure/roles/gaming/meta/main.yml create mode 100644 collections/ansible_collections/nullified/infrastructure/roles/gaming/tasks/main.yml create mode 100644 collections/ansible_collections/nullified/infrastructure/roles/gaming/tests/inventory create mode 100644 collections/ansible_collections/nullified/infrastructure/roles/gaming/vars/main.yml create mode 100644 collections/ansible_collections/nullified/infrastructure/roles/workstation/tasks/window_manager.yml create mode 100644 collections/ansible_collections/nullified/infrastructure/roles/workstation/templates/.config/awesome/background.png create mode 100644 collections/ansible_collections/nullified/infrastructure/roles/workstation/templates/.config/awesome/battery.lua create mode 100644 collections/ansible_collections/nullified/infrastructure/roles/workstation/templates/.config/awesome/rc.lua create mode 100644 collections/ansible_collections/nullified/infrastructure/roles/workstation/templates/.config/awesome/themes/powerarrow/theme-personal.lua create mode 100644 collections/ansible_collections/nullified/infrastructure/roles/workstation/templates/.config/terminator/config create mode 100644 collections/ansible_collections/nullified/infrastructure/roles/workstation/templates/.config/vlc/vlcrc create mode 100644 collections/ansible_collections/nullified/infrastructure/roles/workstation/templates/.xsession create mode 100644 collections/ansible_collections/nullified/infrastructure/roles/workstation/templates/bin_wrapper.sh.j2 create mode 100644 collections/ansible_collections/nullified/infrastructure/roles/workstation/templates/system/xorg.conf create mode 100644 inventory/host_vars/lithium/vars.yml create mode 100644 inventory/host_vars/localhost/vars.yml create mode 100644 inventory/host_vars/unobtainium/vars.yml diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..89d94e7 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = true +charset = utf-8 +max_line_length = 160 + +[*.{py,py3}] +indent_style = space +indent_size = 4 + +[*.{yml,yaml,json}] +indent_style = space +indent_size = 2 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..d73f78a --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +*.ttf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore index 0d49b81..e7e20b8 100644 --- a/.gitignore +++ b/.gitignore @@ -7,5 +7,4 @@ collections/ansible_collections/*/*/logs/* !collections/ansible_collections/*/*/tests/config.yml vault.yml inventory/inventory.yml -inventory/host_vars/* !.gitkeep diff --git a/README.md b/README.md index a1f3e2a..c8d082a 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,11 @@ - Python3.9+, - PIP, - Virtualenv + +***Dependencies installed using the `Installation` instructions*** - [Task](https://taskfile.dev/), - Debian packages: + - curl - libcurl4-openssl-dev, - libssl-dev, - libcairo2, @@ -22,9 +25,8 @@ ## Installation ```shell # Debian amd64 - -TASK_VERSION=3.29.1; sudo apt install -y \ + curl \ libcurl4-openssl-dev \ libssl-dev \ libcairo2 \ @@ -32,18 +34,46 @@ sudo apt install -y \ libffi-dev \ python3-virtualenv \ python3-dev; -wget https://github.com/go-task/task/releases/download/v"${TASK_VERSION}"/task_linux_amd64.deb; +TASK_VERSION=$(curl -fsSL -XGET https://api.github.com/repos/go-task/task/releases/latest | grep tag_name | tr -d ' ",' | cut -d ':' -f 2) +curl -fsSLO https://github.com/go-task/task/releases/download/"${TASK_VERSION}"/task_linux_amd64.deb; sudo dpkg -i task_linux_amd64.deb; -task venv; +rm task_linux_amd64.deb; ``` -## General Setup +## Setup +```shell +# Generate default ansible configuration +./scripts/generate_ansible_config.sh > "${HOME}"/.ansible.cfg + +# Setup Python virtualenv +task venv:setup + +# Prepare and edit your inventory as needed +cp inventory/inventory.yml.dist inventory/inventory.yml + +# Prepare and edit the global vault as needed +cp inventory/vault.yml.dist inventory/vault.yml +``` + +## Usage +```shell +# encrypt vault +task venv -- ansible-vault encrypt configuration/host_vars/vault.yml +# decrypt vault if needed +task venv -- ansible-vault decrypt configuration/host_vars/vault.yml +# run ansible command with vault-encrypted data for one specific host +task venv -- ansible-playbook --ask-vault-password -l my_host playbooks/test.yml +# run a specific role, e.g. security, for a host +task venv -- ansible --ask-vault-password -m import_role --args 'name=nullified.infrastructure.security' my_host +``` + +### Generic collection / roles commands ```shell mkdir -p collections/ansible_collections cd collections/ansible_collections -ansible-galaxy collection init nullified.infrastructure +task venv -- ansible-galaxy collection init nullified.infrastructure cd nullified/infrastructure/roles -ansible-galaxy collection init tooling +task venv -- ansible-galaxy collection init tooling ``` --- @@ -59,8 +89,8 @@ ansible-galaxy collection init tooling ***handlers*** invoked by a task through `notify`, executed only if caller triggered a state change; runs at the end of the play in the order they are declared; --> force handlers to run: ```yaml +# -> force handlers to run: - name: some task meta: flush_handlers ``` @@ -112,18 +142,8 @@ tasks: ### Notes / Todo ***dir layout*** -- collections: ansible root dir for all modules, playbooks and collections -- configuration: ansible root dir for inventory -- images: docker images, mostly used for ansible-test / molecule -- scripts: scripts used by go-task - -### Setup -```shell -cp configuration/group_vars/vault.yml.dist configuration/group_vars/vault.yml -# encrypt vault -ansible-vault encrypt configuration/group_vars/vault.yml -# decrypt vault -ansible-vault decrypt configuration/group_vars/vault.yml -# run ansible command with vault-encrypted data -ansible-playbook --ask-vault-password -i inventories/test playbooks/test.yml -``` +- collections: ansible root dir for all collections to reside in; +- images: docker images, mostly used for ansible-test / molecule; +- inventory: all inventory related files are stored here; +- playbooks: top level playbooks, describe the way the infrastructure is laid out; +- scripts: various scripts and helpers; diff --git a/TODO b/TODO new file mode 100644 index 0000000..37c9bb3 --- /dev/null +++ b/TODO @@ -0,0 +1,7 @@ +- /etc/lvm/lvm.conf -> issue_discards = 1 +- deploy hashicorp/vault to store encrypted files: + - user SSH keys + - user passwords + - secure files +- setup fstab with sshfs, noatime +- add smartmontools & conf diff --git a/Taskfile.yml b/Taskfile.yml index a1bc4ef..d8bd07e 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -37,7 +37,7 @@ tasks: preconditions: - test -d tests cmds: - - '{{.PYTHON_WRAPPER}} ansible-test sanity --docker default' + - '{{.PYTHON_WRAPPER}} ansible-test sanity --venv' test:collections: desc: run molecule tests for all roles and collections. diff --git a/collections/ansible_collections/nullified/infrastructure/playbooks/main_desktop.yml b/collections/ansible_collections/nullified/infrastructure/playbooks/main_desktop.yml new file mode 100644 index 0000000..47104d7 --- /dev/null +++ b/collections/ansible_collections/nullified/infrastructure/playbooks/main_desktop.yml @@ -0,0 +1,18 @@ +--- +- hosts: main_desktop + tasks: + - name: include common role + ansible.builtin.include_role: + name: nullified.infrastructure.common + - name: include workstation role + ansible.builtin.include_role: + name: nullified.infrastructure.workstation + - name: include development role + ansible.builtin.include_role: + name: nullified.infrastructure.development + - name: include security role + ansible.builtin.include_role: + name: nullified.infrastructure.security + - name: include gaming role + ansible.builtin.include_role: + name: nullified.infrastructure.gaming diff --git a/collections/ansible_collections/nullified/infrastructure/plugins/modules/github_artifact.py b/collections/ansible_collections/nullified/infrastructure/plugins/modules/github_artifact.py index 60bc167..9c10941 100644 --- a/collections/ansible_collections/nullified/infrastructure/plugins/modules/github_artifact.py +++ b/collections/ansible_collections/nullified/infrastructure/plugins/modules/github_artifact.py @@ -17,43 +17,41 @@ description: vaguely similar to a package manager, but for GitHub artifacts. version_added: "2.15.0" options: - artifacts: - description: a list of artifacts to retrieve - type: list + asset_name: + description: filename of the asset to retrieve, used only for release type; supports templating + type: str + required: false + default: "" + asset_type: + description: whether the asset is a release or just a tagged asset + type: str required: true - elements: dict - suboptions: - asset_name: - description: filename of the asset to retrieve, used only for release type; supports templating - type: str - required: false - default: "" - asset_type: - description: whether the asset is a release or just a tagged asset - type: str - required: true - choices: - - release - - tag - cmds: - description: commands to execute in order to install the downloaded asset; supports templating - type: list - elements: str - required: false - default: [] - repository: - description: repository to query, formatted like "/" - required: true - type: str - version: - description: version of the asset to fetch; defaults to `latest` - required: false - type: str - default: latest + choices: + - release + - tag + cmds: + description: commands to execute in order to install the downloaded asset; supports templating + type: list + elements: str + required: false + default: [] + creates: + description: if provided and target file / directory exists, this step will **not** be run + type: str + required: false github_token: description: a GitHub app token if you have one; limits impact of rate-limiting errors type: str required: false + repository: + description: repository to query, formatted like "/" + required: true + type: str + version: + description: version of the asset to fetch; defaults to `latest` + required: false + type: str + default: latest notes: - "Strings that allow the use of templating variables support the following:" @@ -72,23 +70,18 @@ author: EXAMPLES = r''' - name: Install dependencies from GitHub - become: yes + become: true tags: - molecule-idempotence-notest - github_artifact: - artifacts: - - asset_type: tag - repository: smxi/inxi - cmds: - - tar -zxf {asset_dirname}/{asset_filename} - - install --group=root --mode=755 --owner=root smxi-inxi-*/inxi /usr/bin - - install --group=root --mode=644 --owner=root smxi-inxi-*/inxi.1 /usr/share/man/man1 - - apt-get install libdata-dump-perl - - asset_name: dive_{version}_linux_amd64.deb - asset_type: release - repository: wagoodman/dive - cmds: - - dpkg -i {asset_dirname}/{asset_filename} + nullified.infrastructure.github_artifact: + asset_type: tag + repository: smxi/inxi + cmds: + - tar -zxf {asset_dirname}/{asset_filename} + - install --group=root --mode=755 --owner=root smxi-inxi-*/inxi /usr/bin + - install --group=root --mode=644 --owner=root smxi-inxi-*/inxi.1 /usr/share/man/man1 + - apt-get install libdata-dump-perl + creates: /usr/bin/inxi ''' RETURN = r''' @@ -122,7 +115,7 @@ try: from datetime import datetime from difflib import SequenceMatcher from json import loads - from os import environ, sep + from os import environ, sep, path from platform import system, machine from typing import Any LIB_IMPORTED = True @@ -260,7 +253,7 @@ def get_tagged_asset(artifact: dict[str, Any]) -> tuple[dict[str, str], dict[str }, info -def fetch_metadata(artifact: dict[str, str]) -> dict[str, str] | None: +def fetch_metadata(artifact: dict[str, str | list[str]]) -> dict[str, str] | None: """ retrieve metadata from the specified repository """ if artifact["asset_type"] == "tag": metadata, info = get_tagged_asset(artifact) @@ -278,37 +271,34 @@ def main(): global ANSIBLE_MODULE module_args: dict[str, dict[str, Any]] = { - "artifacts": { - "type": "list", - "elements": "dict", + "asset_name": { + "type": "str", + "required": False, + "default": "" + }, + "asset_type": { + "type": "str", "required": True, - "options": { - "asset_name": { - "type": "str", - "required": False, - "default": "" - }, - "asset_type": { - "type": "str", - "required": True, - "choices": ["release", "tag"], - }, - "cmds": { - "type": "list", - "elements": "str", - "required": False, - "default": [] - }, - "repository": { - "type": "str", - "required": True - }, - "version": { - "type": "str", - "required": False, - "default": "latest" - } - } + "choices": ["release", "tag"], + }, + "cmds": { + "type": "list", + "elements": "str", + "required": False, + "default": [] + }, + "creates": { + "type": "str", + "required": False + }, + "repository": { + "type": "str", + "required": True + }, + "version": { + "type": "str", + "required": False, + "default": "latest" }, "github_token": { "type": "str", @@ -317,9 +307,13 @@ def main(): }, } result: dict[str, Any] = { - "artifacts": [], "changed": False, - "msg": "" + "commands": [], + "failed": False, + "filepath": "", + "msg": "", + "state": "", + "version": "" } ANSIBLE_MODULE = AnsibleModule(argument_spec=module_args, supports_check_mode=True) @@ -328,6 +322,11 @@ def main(): if ANSIBLE_MODULE.params["github_token"]: DEFAULT_HEADERS["Authorization"] = "Bearer {}".format(ANSIBLE_MODULE.params["github_token"]) + creates_file: str | None = ANSIBLE_MODULE.params.get("creates", None) + if creates_file and path.exists(creates_file): + result["state"] = "ignored" + ANSIBLE_MODULE.exit_json(**result) + if not LIB_IMPORTED: ANSIBLE_MODULE.fail_json(msg=missing_required_lib(IMPORT_LIB_NAME), exception=IMPORT_LIB_ERROR) # pylint: disable=used-before-assignment @@ -335,66 +334,58 @@ def main(): TEMPLATE_ASSET_NAME_VARS.update({key.lower(): value for key, value in freedesktop_os_release().items()}) TEMPLATE_ASSET_NAME_VARS["system"] = system().lower() TEMPLATE_ASSET_NAME_VARS["machine"] = machine().lower() - for artifact in ANSIBLE_MODULE.params["artifacts"]: - # fetch artifact metadata - artifact_result: dict[str, Any] = { - "asset_data": fetch_metadata(artifact), - "repository": artifact.get("repository"), - "version": artifact.get("version"), - "cmds": [] - } - result["rate_limit_remaining"] = artifact_result["asset_data"].get("rate_limit_remaining", "unknown") - result["rate_limit_max"] = artifact_result["asset_data"].get("rate_limit_max", "unknown") - if "error" in artifact_result["asset_data"]: - result["artifacts"].append(artifact_result) - result["msg"] = artifact_result["asset_data"].get("error") - result["failed"] = True - ANSIBLE_MODULE.fail_json(**result) + artifact: dict[str, str | list[str]] = {} + for param_name in ["asset_name", "asset_type", "cmds", "repository", "version"]: + artifact[param_name] = ANSIBLE_MODULE.params[param_name] - # download artifact - if ANSIBLE_MODULE.check_mode: - artifact_result["download_dir"] = "unknown" - else: - artifact_result["download_dir"] = fetch_file(ANSIBLE_MODULE, artifact_result["asset_data"].get("download_url", "unknown"), decompress=False) - TEMPLATE_ASSET_NAME_VARS["asset_name"] = artifact_result["asset_data"].get("asset_name", "unknown") - TEMPLATE_ASSET_NAME_VARS["asset_version"] = artifact_result["asset_data"].get("version", "unknown") - parts = artifact_result["download_dir"].rsplit(sep, 1) - TEMPLATE_ASSET_NAME_VARS["asset_dirname"] = parts[0] if len(parts) > 1 else "" - TEMPLATE_ASSET_NAME_VARS["asset_filename"] = parts[1] if len(parts) > 1 else parts[0] + asset_data: dict[str, str] = fetch_metadata(artifact) + result["rate_limit_remaining"] = asset_data.get("rate_limit_remaining", "unknown") + result["rate_limit_max"] = asset_data.get("rate_limit_max", "unknown") + result["version"] = asset_data.get("version", artifact.get("version")) - # install artifact - artifact_commands = [line.format(**TEMPLATE_ASSET_NAME_VARS) for line in artifact["cmds"]] - if ANSIBLE_MODULE.check_mode: - artifact_result["stdout"] = artifact_result["stderr"] = "" - artifact_result["ret_code"] = None - artifact_result["cmds"] = artifact_commands - artifact_result["state"] = "should be installed" if len(artifact_commands) else "should be downloaded" - else: - for command_line in artifact_commands: - cmd_rc, cmd_out, cmd_err = ANSIBLE_MODULE.run_command(command_line, use_unsafe_shell=True, cwd=ANSIBLE_MODULE.tmpdir) - result["changed"] = True - artifact_result["cmds"].append({ - "command": command_line, - "stdout": cmd_out, - "stderr": cmd_err, - "ret_code": cmd_rc - }) + if "error" in asset_data: + result["state"] = "fetch failed" + result["msg"] = asset_data.get("error", "unknown error encountered") + result["failed"] = True + ANSIBLE_MODULE.fail_json(**result) - if cmd_rc: - artifact_result["state"] = "installation failed" - result["failed"] = True - result["artifacts"].append(artifact_result) - ANSIBLE_MODULE.fail_json(**result) + # download artifact + if ANSIBLE_MODULE.check_mode: + result["filepath"] = "unknown" + else: + result["filepath"] = fetch_file(ANSIBLE_MODULE, asset_data.get("download_url", "unknown"), decompress=False) + TEMPLATE_ASSET_NAME_VARS["asset_name"] = asset_data.get("asset_name", "unknown") + TEMPLATE_ASSET_NAME_VARS["asset_version"] = asset_data.get("version", "unknown") + parts = result["filepath"].rsplit(sep, 1) + TEMPLATE_ASSET_NAME_VARS["asset_dirname"] = parts[0] if len(parts) > 1 else "" + TEMPLATE_ASSET_NAME_VARS["asset_filename"] = parts[1] if len(parts) > 1 else parts[0] - try: - del artifact_result["command"], artifact_result["stdout"], artifact_result["stderr"], artifact_result["ret_code"] - except: # pylint: disable=bare-except # noqa: 722 - pass - artifact_result["state"] = "installed" if len(artifact_commands) else "downloaded" + # install artifact + artifact_commands = [line.format(**TEMPLATE_ASSET_NAME_VARS) for line in artifact["cmds"]] + if ANSIBLE_MODULE.check_mode: + result["commands"] = artifact_commands + result["state"] = "should be installed" if len(artifact_commands) else "should be downloaded" + else: + for command_line in artifact_commands: + cmd_rc, cmd_out, cmd_err = ANSIBLE_MODULE.run_command(command_line, use_unsafe_shell=True, cwd=ANSIBLE_MODULE.tmpdir) + result["changed"] = True + result["commands"].append({ + "command": command_line, + "stdout": cmd_out, + "stderr": cmd_err, + "ret_code": cmd_rc + }) - result["artifacts"].append(artifact_result) - result["msg"] = "OK" + if cmd_rc: + result["state"] = "installation failed" + result["msg"] = cmd_err + result["failed"] = True + ANSIBLE_MODULE.fail_json(**result) + + result["state"] = "installed" if len(artifact_commands) else "downloaded" + + result["msg"] = "Successful" ANSIBLE_MODULE.exit_json(**result) diff --git a/collections/ansible_collections/nullified/infrastructure/plugins/tests/github_artifact.json b/collections/ansible_collections/nullified/infrastructure/plugins/tests/github_artifact.json index dfa02f1..a321be1 100644 --- a/collections/ansible_collections/nullified/infrastructure/plugins/tests/github_artifact.json +++ b/collections/ansible_collections/nullified/infrastructure/plugins/tests/github_artifact.json @@ -1,42 +1,16 @@ { "ANSIBLE_MODULE_ARGS": { "github_token": "", - "artifacts": [ - { - "asset_type": "tag", - "repository": "smxi/inxi", - "version": "3.3.29-1", - "cmds": [ - "echo asset_name: {asset_name}", - "echo asset_dirname: {asset_dirname}", - "echo asset_filename: {asset_filename}", - "echo asset_version: {asset_version}", - "echo system: {system}", - "echo machine: {machine}", - "echo version: {version}" - ] - }, - { - "asset_type": "tag", - "repository": "smxi/inxi", - "cmds": [ - "tar -zxf {asset_dirname}/{asset_filename}", - "install --group=root --mode=755 --owner=root smxi-inxi-*/inxi /usr/bin", - "install --group=root --mode=644 --owner=root smxi-inxi-*/inxi.1 /usr/share/man/man1", - "apt-get install libdata-dump-perl" - ] - }, - { - "asset_name": "dive_{version}_linux_amd64.deb", - "asset_type": "release", - "repository": "wagoodman/dive" - }, - { - "asset_name": "dive_{version}_linux_amd64.deb", - "asset_type": "release", - "repository": "wagoodman/dive", - "version": "v0.10.0" - } - ] + "asset_type": "tag", + "repository": "smxi/inxi", + "version": "3.3.29-1", + "cmds": [ + "echo \"asset_name: {asset_name}\nasset_dirname: {asset_dirname}\"", + "echo \"asset_filename: {asset_filename}\nasset_version: {asset_version}\"", + "echo \"system: {system}\nmachine: {machine}\nversion: {version}\"", + "ls -lahv {asset_dirname}", + "test -f {asset_dirname}/{asset_filename}" + ], + "creates": "/usr/local/bin/inxi2" } } diff --git a/collections/ansible_collections/nullified/infrastructure/roles/common/assets/fonts/JetBrainsMonoNerdFontMono-Bold.ttf b/collections/ansible_collections/nullified/infrastructure/roles/common/assets/fonts/JetBrainsMonoNerdFontMono-Bold.ttf new file mode 100644 index 0000000..d2c2c94 --- /dev/null +++ b/collections/ansible_collections/nullified/infrastructure/roles/common/assets/fonts/JetBrainsMonoNerdFontMono-Bold.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5e22e29d166cc35b449dcb14d6d5cbfbf50636265c86f03b7b94cc07e2dd63d0 +size 2026476 diff --git a/collections/ansible_collections/nullified/infrastructure/roles/common/assets/fonts/JetBrainsMonoNerdFontMono-BoldItalic.ttf b/collections/ansible_collections/nullified/infrastructure/roles/common/assets/fonts/JetBrainsMonoNerdFontMono-BoldItalic.ttf new file mode 100644 index 0000000..78701cb --- /dev/null +++ b/collections/ansible_collections/nullified/infrastructure/roles/common/assets/fonts/JetBrainsMonoNerdFontMono-BoldItalic.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bb2f07a3b66c18426af0f0fa352a4fa6d6a8f5ecc510aa31a3fea2b6f7d7a2b4 +size 2027736 diff --git a/collections/ansible_collections/nullified/infrastructure/roles/common/assets/fonts/JetBrainsMonoNerdFontMono-Italic.ttf b/collections/ansible_collections/nullified/infrastructure/roles/common/assets/fonts/JetBrainsMonoNerdFontMono-Italic.ttf new file mode 100644 index 0000000..5d267ca --- /dev/null +++ b/collections/ansible_collections/nullified/infrastructure/roles/common/assets/fonts/JetBrainsMonoNerdFontMono-Italic.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9cbc6aaba0057ad8ef95b538181f6ffa3e4089ee27d54d4050768680e17985eb +size 2024824 diff --git a/collections/ansible_collections/nullified/infrastructure/roles/common/assets/fonts/JetBrainsMonoNerdFontMono-Regular.ttf b/collections/ansible_collections/nullified/infrastructure/roles/common/assets/fonts/JetBrainsMonoNerdFontMono-Regular.ttf new file mode 100644 index 0000000..97da74c --- /dev/null +++ b/collections/ansible_collections/nullified/infrastructure/roles/common/assets/fonts/JetBrainsMonoNerdFontMono-Regular.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:21c8b666674343930f2f2964f704e6a32b820b7b7ac56bc497930c7b5d0ffa05 +size 2022708 diff --git a/collections/ansible_collections/nullified/infrastructure/roles/common/assets/fonts/Meslo LG S NF Mono Bold Italic.ttf b/collections/ansible_collections/nullified/infrastructure/roles/common/assets/fonts/Meslo LG S NF Mono Bold Italic.ttf new file mode 100644 index 0000000..253a7fd --- /dev/null +++ b/collections/ansible_collections/nullified/infrastructure/roles/common/assets/fonts/Meslo LG S NF Mono Bold Italic.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0e69187b18e337c90782432ae0e3f4316c469dfc43c527940dbde57355609544 +size 2270100 diff --git a/collections/ansible_collections/nullified/infrastructure/roles/common/assets/fonts/Meslo LG S NF Mono Bold.ttf b/collections/ansible_collections/nullified/infrastructure/roles/common/assets/fonts/Meslo LG S NF Mono Bold.ttf new file mode 100644 index 0000000..e1d9354 --- /dev/null +++ b/collections/ansible_collections/nullified/infrastructure/roles/common/assets/fonts/Meslo LG S NF Mono Bold.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5838a33108500f533e487b14b4a16a30ebad9b85945b0c2338e3daa85cea99b5 +size 2311624 diff --git a/collections/ansible_collections/nullified/infrastructure/roles/common/assets/fonts/Meslo LG S NF Mono Italic.ttf b/collections/ansible_collections/nullified/infrastructure/roles/common/assets/fonts/Meslo LG S NF Mono Italic.ttf new file mode 100644 index 0000000..678d3f2 --- /dev/null +++ b/collections/ansible_collections/nullified/infrastructure/roles/common/assets/fonts/Meslo LG S NF Mono Italic.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7f79e8a02962615027ec665722fbbb9c83f29c8e624306f06b454e74e7f5620a +size 2253760 diff --git a/collections/ansible_collections/nullified/infrastructure/roles/common/assets/fonts/Meslo LG S NF Mono Regular.ttf b/collections/ansible_collections/nullified/infrastructure/roles/common/assets/fonts/Meslo LG S NF Mono Regular.ttf new file mode 100644 index 0000000..7e35cce --- /dev/null +++ b/collections/ansible_collections/nullified/infrastructure/roles/common/assets/fonts/Meslo LG S NF Mono Regular.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a5a97069b330aad2f4d214398c133acd37bb90fcdcfb5fc269da83e9743547d7 +size 2294496 diff --git a/collections/ansible_collections/nullified/infrastructure/roles/common/defaults/main.yml b/collections/ansible_collections/nullified/infrastructure/roles/common/defaults/main.yml index c7895dc..f8c3f0f 100644 --- a/collections/ansible_collections/nullified/infrastructure/roles/common/defaults/main.yml +++ b/collections/ansible_collections/nullified/infrastructure/roles/common/defaults/main.yml @@ -1,2 +1,10 @@ --- custom_github_token: "" +common_user_account: "{{ custom_base_user_account | lower }}" +common_gitconfig_enable: false +common_gitconfig_username: "" +common_gitconfig_email: "" +common_gitconfig_force_sign: false +common_gitconfig_signingkey: "" +common_apt_packages: [] +common_install_fonts: false diff --git a/collections/ansible_collections/nullified/infrastructure/roles/common/handlers/main.yml b/collections/ansible_collections/nullified/infrastructure/roles/common/handlers/main.yml index ed97d53..b0f94ce 100644 --- a/collections/ansible_collections/nullified/infrastructure/roles/common/handlers/main.yml +++ b/collections/ansible_collections/nullified/infrastructure/roles/common/handlers/main.yml @@ -1 +1,5 @@ --- +- name: '[system] reload sysctl configuration' + become: true + ansible.builtin.command: + cmd: sysctl --system diff --git a/collections/ansible_collections/nullified/infrastructure/roles/common/tasks/home_setup.yml b/collections/ansible_collections/nullified/infrastructure/roles/common/tasks/home_setup.yml new file mode 100644 index 0000000..314679a --- /dev/null +++ b/collections/ansible_collections/nullified/infrastructure/roles/common/tasks/home_setup.yml @@ -0,0 +1,41 @@ +--- +- name: '[home] get user account information' + ansible.builtin.getent: + database: passwd + key: "{{ common_user_account }}" + split: ":" + changed_when: false + when: getent_passwd is undefined or common_user_account not in getent_passwd + +- name: '[home] create common directories' + become: true + become_user: "{{ common_user_account }}" + ansible.builtin.file: + path: "{{ getent_passwd[common_user_account][4] }}/{{ item }}" + state: directory + mode: '0750' + loop: + - .local/bin + - .local/share/fonts + - .config + - .ssh + +- name: '[home] setup home files' + become: true + become_user: "{{ common_user_account }}" + block: + - name: '[home] git configuration' + ansible.builtin.template: + src: ../templates/home/.gitconfig.j2 + dest: "{{ getent_passwd[common_user_account][4] }}/.gitconfig" + mode: '0640' + when: common_gitconfig_enable | bool + + - name: '[home] basic files' + ansible.builtin.copy: + src: "../templates/home/{{ item.name }}" + dest: "{{ getent_passwd[common_user_account][4] }}/{{ item.name }}" + mode: "{{ item.mode | default('0640') }}" + loop: + - { name: ".lessfilter", mode: '0750' } + - { name: ".pythonrc" } diff --git a/collections/ansible_collections/nullified/infrastructure/roles/common/tasks/main.yml b/collections/ansible_collections/nullified/infrastructure/roles/common/tasks/main.yml index 869c0da..6450a0c 100644 --- a/collections/ansible_collections/nullified/infrastructure/roles/common/tasks/main.yml +++ b/collections/ansible_collections/nullified/infrastructure/roles/common/tasks/main.yml @@ -1,47 +1,68 @@ --- -- name: '[APT] install dependencies and tools' - become: yes +- name: '[apt] install dependencies and tools' + become: true ansible.builtin.apt: - update_cache: yes + update_cache: true force_apt_get: true cache_valid_time: 3600 pkg: + - apt-transport-https - bzip2 + - catimg - cron + - dateutils - emacs-nox + - firmware-misc-nonfree + - firmware-linux-nonfree + - fwupd + - gir1.2-fwupd-2.0 # fwupd - git + - iotop + - ioping - jq - less - libdata-dump-perl # inxi - libxml-dumper-perl # inxi + - lm-sensors - ncdu - - openssh-server + - nvme-cli - procps + - python3-pygments - rsync - - zsh + - smartmontools + - tree + - xz-utils + - yq state: present - name: '[GitHub] install tools' - become: yes - tags: - - molecule-idempotence-notest + become: true nullified.infrastructure.github_artifact: - github_token: '{{ custom_github_token }}' - artifacts: + asset_name: "{{ item.asset_name | default('') }}" + asset_type: "{{ item.asset_type }}" + cmds: "{{ item.cmds | default([]) }}" + creates: "{{ item.creates | default('') }}" + github_token: "{{ custom_github_token }}" + repository: "{{ item.repository }}" + version: "{{ item.version | default('') }}" + loop: - repository: smxi/inxi asset_type: tag cmds: - tar -zxf {asset_dirname}/{asset_filename} - install --group=root --mode=755 --owner=root smxi-inxi-*/inxi /usr/local/bin - install --group=root --mode=644 --owner=root smxi-inxi-*/inxi.1 /usr/share/man/man1 + creates: /usr/local/bin - repository: sharkdp/bat asset_name: bat_{version}_amd64.deb asset_type: release + creates: /usr/bin/bat cmds: - dpkg -i {asset_dirname}/{asset_filename} - repository: aristocratos/btop asset_name: btop-x86_64-linux-musl.tbz asset_type: release + creates: /usr/bin/btop cmds: - tar -xjf {asset_dirname}/{asset_filename} - install --group=root --mode=755 --owner=root btop/bin/btop /usr/bin @@ -50,11 +71,36 @@ - repository: eza-community/eza asset_name: eza_x86_64-unknown-linux-gnu.tar.gz asset_type: release + creates: /usr/bin/eza cmds: - tar -zxf {asset_dirname}/{asset_filename} - install --group=root --mode=755 --owner=root eza /usr/bin - repository: muesli/duf asset_name: duf_{version}_linux_amd64.deb asset_type: release + creates: /usr/bin/duf cmds: - dpkg -i {asset_dirname}/{asset_filename} + +- name: '[system] add sysctl tweaks' + become: true + ansible.builtin.template: + src: ../templates/system/sysctld.local.conf.j2 + dest: /etc/sysctl.d/local.conf + mode: '0644' + when: custom_sysctl is defined + notify: + - 'common : [system] reload sysctl configuration' + +- name: '[apt] install custom packages' + become: true + ansible.builtin.apt: + update_cache: true + force_apt_get: true + cache_valid_time: 3600 + pkg: + "{{ common_apt_packages }}" + +- include_tasks: home_setup.yml + +- include_tasks: shell_customization.yml diff --git a/collections/ansible_collections/nullified/infrastructure/roles/common/tasks/shell_customization.yml b/collections/ansible_collections/nullified/infrastructure/roles/common/tasks/shell_customization.yml new file mode 100644 index 0000000..f5ac5e7 --- /dev/null +++ b/collections/ansible_collections/nullified/infrastructure/roles/common/tasks/shell_customization.yml @@ -0,0 +1,89 @@ +--- +- name: '[home] get user account information' + ansible.builtin.getent: + database: passwd + key: "{{ common_user_account }}" + split: ":" + changed_when: false + when: getent_passwd is undefined or common_user_account not in getent_passwd + +- name: '[shell] install ZSH and dependencies' + become: true + ansible.builtin.apt: + update_cache: true + force_apt_get: true + cache_valid_time: 3600 + pkg: + - git + - zsh + state: present + +- name: '[shell] install custom fonts' + become: true + become_user: "{{ common_user_account }}" + block: + - name: '[fonts] add fonts tooling' + become_user: root + ansible.builtin.apt: + update_cache: true + force_apt_get: true + cache_valid_time: 3600 + pkg: + - fontconfig + + - name: '[fonts] adding fonts' + ansible.builtin.copy: + src: ../assets/fonts/ + dest: "{{ getent_passwd[common_user_account][4] }}/.local/share/fonts" + mode: '0640' + + - name: '[fonts] refresh fonts cache' + ansible.builtin.command: + cmd: fc-cache + changed_when: false + when: common_install_fonts | bool + +- name: '[shell] install Oh-My-ZSH' + become: true + become_user: "{{ common_user_account }}" + block: + - name: '[omz] get install script' + ansible.builtin.get_url: + url: https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh + dest: /tmp/zsh-install.sh + mode: '0750' + + - name: '[omz] install OMZ' + ansible.builtin.command: + cmd: sh /tmp/zsh-install.sh --unattended + creates: "{{ getent_passwd[common_user_account][4] }}/.oh-my-zsh" + +- name: '[shell] install powerlevel10k customization for OMZ' + become: true + become_user: "{{ common_user_account }}" + ansible.builtin.git: + repo: https://github.com/romkatv/powerlevel10k.git + dest: "{{ getent_passwd[common_user_account][4] }}/.oh-my-zsh/custom/themes/powerlevel10k" + depth: 1 + +- name: '[home] copy zsh files' + become: true + become_user: "{{ common_user_account }}" + ansible.builtin.copy: + src: "../templates/home/{{ item }}" + dest: "{{ getent_passwd[common_user_account][4] }}/{{ item }}" + mode: '0640' + loop: + - .p10k.zsh + - .zsh_aliases + - .zsh_completions + - .zsh_exports + - .zsh_functions + - .zshrc + +- name: '[shell] update user shell to ZSH' + become: true + ansible.builtin.user: + name: "{{ common_user_account }}" + shell: "/usr/bin/zsh" + state: present diff --git a/collections/ansible_collections/nullified/infrastructure/roles/common/templates/home/.gitconfig.j2 b/collections/ansible_collections/nullified/infrastructure/roles/common/templates/home/.gitconfig.j2 new file mode 100644 index 0000000..3fa4894 --- /dev/null +++ b/collections/ansible_collections/nullified/infrastructure/roles/common/templates/home/.gitconfig.j2 @@ -0,0 +1,107 @@ +[user] + name = {{ common_gitconfig_username }} + email = {{ common_gitconfig_email }} +{% if common_gitconfig_force_sign and common_gitconfig_signingkey %} + signingkey = {{ common_gitconfig_signingkey }} +{% endif %} +[commit] +{% if common_gitconfig_force_sign %} + gpgsign = true +{% else %} + gpgsign = false +{% endif %} +[tag] +{% if common_gitconfig_force_sign %} + gpgsign = true +{% else %} + gpgsign = false +{% endif -%} +{% raw %} +[alias] + br = "branch" + ci = "commit" + cmp = "!f() { git log --graph --color --boundary --oneline HEAD...origin/$1; }; f" + co = "checkout" + cp = "cherry-pick" + cpo = "cherry-pick --strategy=recursive -Xours --allow-empty" + cpt = "cherry-pick --strategy=recursive -Xtheirs --allow-empty" + dm = "log --graph --color --boundary --oneline HEAD...origin/master" + dup = "!git log --graph --color --boundary --oneline HEAD...origin/$(git rev-parse --abbrev-ref HEAD)" + psuo = "!git push --set-upstream origin $(git rev-parse --abbrev-ref HEAD)" + rf = "!git reflog --date=iso" + ru = "remote update" + rup = "!f() { git remote update && git pull --rebase; }; f" + pr = "pull --rebase" + st = "status" + subup = "!git submodule foreach git remote update" + undo = "!f() { git reset --soft HEAD~${1:-1}; }; f" + + lg = lg1 + lg1 = lg1-specific --all + lg2 = lg2-specific --all + lg3 = lg3-specific --all + lg1-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(auto)%d%C(reset)' + lg2-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(auto)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' + lg3-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset) %C(bold cyan)(committed: %cD)%C(reset) %C(auto)%d%C(reset)%n'' %C(white)%s%C(reset)%n'' %C(dim white)- %an <%ae> %C(reset) %C(dim white)(committer: %cn <%ce>)%C(reset)' +[core] + editor = emacs + autocrlf = input + pager = delta +[color] + status = auto + branch = auto + interactive = auto + diff = auto + ui = true + pager = true +[delta] + navigate = true + line-numbers = true +[push] + default = simple +[merge] + conflictstyle = diff3 +[pull] + rebase = true +[diff] + colorMoved = default +[diff "pdf"] + textconv = pdfinfo +[diff "pdfdiff"] + command = diffpdf +[init] + defaultBranch = main +[interactive] + diffFilter = delta --color-only +[submodule] + recurse = true +[advice] + addEmbeddedRepo = false + addEmptyPathspec = false + addIgnoredFile = false + amWorkDir = false + checkoutAmbiguousRemoteBranchName = false + commitBeforeMerge = false + detachedHead = false + fetchShowForcedUpdates = false + ignoredHook = false + implicitIdentity = false + nestedTag = false + pushAlreadyExists = true + pushFetchFirst = true + pushNeedsForce = true + pushNonFFCurrent = true + pushNonFFMatching = true + pushRefNeedsUpdate = true + pushUnqualifiedRefname = true + pushUpdateRejected = true + resetQuiet = false + resolveConflict = true + rmHints = false + sequencerInUse = false + statusAheadBehind = false + statusHints = false + statusUoption = false + submoduleAlternateErrorStrategyDie = false + waitingForEditor = false +{% endraw %} \ No newline at end of file diff --git a/collections/ansible_collections/nullified/infrastructure/roles/common/templates/home/.lessfilter b/collections/ansible_collections/nullified/infrastructure/roles/common/templates/home/.lessfilter new file mode 100755 index 0000000..d67e492 --- /dev/null +++ b/collections/ansible_collections/nullified/infrastructure/roles/common/templates/home/.lessfilter @@ -0,0 +1,68 @@ +#!/bin/sh +# Best effort auto-pygmentization with transparent decompression +# (c) Reuben Thomas 2012 +# This program is in the public domain. + +# Strategy: first see if pygmentize can find a lexer; if not, ask file; if that finds nothing, fail +# Set the environment variable PYGMENTIZE_OPTS to configure pygments. + +# This program can be used as a .lessfilter for the less pager to auto-color less's output + +if [ `pygmentize -N $1` != "text" ]; then + pygmentize $PYGMENTIZE_OPTS "$1" + exit 0 +fi + +file_common_opts="--brief --dereference --uncompress" + +unset lexer +case `file --mime-type $file_common_opts "$1"` in + application/xml|image/svg+xml) lexer=xml;; + text/html) lexer=html;; + text/troff) lexer=nroff;; + text/x-asm) lexer=nasm;; + text/x-awk) lexer=awk;; + text/x-c) lexer=c;; + text/x-c++) lexer=cpp;; + text/x-diff) lexer=diff;; + text/x-fortran) lexer=fortran;; + text/x-gawk) lexer=gawk;; + text/x-java) lexer=java;; + text/x-lisp) lexer=common-lisp;; + text/x-lua) lexer=lua;; + text/x-makefile) lexer=make;; + text/x-msdos-batch) lexer=bat;; + text/x-nawk) lexer=nawk;; + text/x-pascal) lexer=pascal;; + text/x-perl) lexer=perl;; + text/x-php) lexer=php;; + text/x-po) lexer=po;; + text/x-python) lexer=python;; + text/x-ruby) lexer=ruby;; + text/x-shellscript) lexer=sh;; + text/x-tcl) lexer=tcl;; + text/x-tex|text/x-texinfo) lexer=latex;; # FIXME: texinfo really needs its own lexer + + # Types that file outputs which pygmentize didn't support as of file 5.11, pygments 1.5 + # text/calendar + # text/PGP + # text/rtf + # text/texmacs + # text/x-bcpl + # text/x-info + # text/x-m4 + # text/x-vcard + # text/x-xmcd +esac + +encoding=`file --mime-encoding $file_common_opts "$1"` + +if [ -n "$lexer" ]; then + # FIXME: Specify input encoding rather than output encoding https://bitbucket.org/birkenfeld/pygments-main/issue/800 + # FIXME: Encoding argument ignored on stdin https://bitbucket.org/birkenfeld/pygments-main/issue/799 + #zcat "$1" | pygmentize -O encoding=$encoding,outencoding=UTF-8 $PYGMENTIZE_OPTS -l $lexer + pygmentize -O encoding=$encoding,outencoding=UTF-8 $PYGMENTIZE_OPTS -l $lexer $1 + exit 0 +fi + +exit 1 diff --git a/collections/ansible_collections/nullified/infrastructure/roles/common/templates/home/.p10k.zsh b/collections/ansible_collections/nullified/infrastructure/roles/common/templates/home/.p10k.zsh new file mode 100644 index 0000000..f716b70 --- /dev/null +++ b/collections/ansible_collections/nullified/infrastructure/roles/common/templates/home/.p10k.zsh @@ -0,0 +1,1834 @@ +# Generated by Powerlevel10k configuration wizard on 2023-09-09 at 09:58 CEST. +# Based on romkatv/powerlevel10k/config/p10k-rainbow.zsh, checksum 42599. +# Wizard options: nerdfont-complete + powerline, small icons, rainbow, unicode, +# 24h time, round separators, sharp heads, sharp tails, 2 lines, solid, full frame, +# darkest-ornaments, compact, many icons, concise, transient_prompt, +# instant_prompt=quiet. +# Type `p10k configure` to generate another config. +# +# Config for Powerlevel10k with powerline prompt style with colorful background. +# Type `p10k configure` to generate your own config based on it. +# +# Tip: Looking for a nice color? Here's a one-liner to print colormap. +# +# for i in {0..255}; do print -Pn "%K{$i} %k%F{$i}${(l:3::0:)i}%f " ${${(M)$((i%6)):#3}:+$'\n'}; done + +# Temporarily change options. +'builtin' 'local' '-a' 'p10k_config_opts' +[[ ! -o 'aliases' ]] || p10k_config_opts+=('aliases') +[[ ! -o 'sh_glob' ]] || p10k_config_opts+=('sh_glob') +[[ ! -o 'no_brace_expand' ]] || p10k_config_opts+=('no_brace_expand') +'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand' + +() { + emulate -L zsh -o extended_glob + + # Unset all configuration options. This allows you to apply configuration changes without + # restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`. + unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR' + + # Zsh >= 5.1 is required. + [[ $ZSH_VERSION == (5.<1->*|<6->.*) ]] || return + + # The list of segments shown on the left. Fill it with the most important segments. + typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=( + # =========================[ Line #1 ]========================= + os_icon # os identifier + dir # current directory + vcs # git status + # =========================[ Line #2 ]========================= + newline # \n + # prompt_char # prompt symbol + ) + + # The list of segments shown on the right. Fill it with less important segments. + # Right prompt on the last prompt line (where you are typing your commands) gets + # automatically hidden when the input line reaches it. Right prompt above the + # last prompt line gets hidden if it would overlap with left prompt. + typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=( + # =========================[ Line #1 ]========================= + status # exit code of the last command + command_execution_time # duration of the last command + background_jobs # presence of background jobs + direnv # direnv status (https://direnv.net/) + asdf # asdf version manager (https://github.com/asdf-vm/asdf) + virtualenv # python virtual environment (https://docs.python.org/3/library/venv.html) + anaconda # conda environment (https://conda.io/) + pyenv # python environment (https://github.com/pyenv/pyenv) + goenv # go environment (https://github.com/syndbg/goenv) + nodenv # node.js version from nodenv (https://github.com/nodenv/nodenv) + nvm # node.js version from nvm (https://github.com/nvm-sh/nvm) + nodeenv # node.js environment (https://github.com/ekalinin/nodeenv) + # node_version # node.js version + # go_version # go version (https://golang.org) + rust_version # rustc version (https://www.rust-lang.org) + # dotnet_version # .NET version (https://dotnet.microsoft.com) + php_version # php version (https://www.php.net/) + # laravel_version # laravel php framework version (https://laravel.com/) + # java_version # java version (https://www.java.com/) + # package # name@version from package.json (https://docs.npmjs.com/files/package.json) + #rbenv # ruby version from rbenv (https://github.com/rbenv/rbenv) + #rvm # ruby version from rvm (https://rvm.io) + #fvm # flutter version management (https://github.com/leoafarias/fvm) + luaenv # lua version from luaenv (https://github.com/cehoffman/luaenv) + #jenv # java version from jenv (https://github.com/jenv/jenv) + #plenv # perl version from plenv (https://github.com/tokuhirom/plenv) + #perlbrew # perl version from perlbrew (https://github.com/gugod/App-perlbrew) + phpenv # php version from phpenv (https://github.com/phpenv/phpenv) + #scalaenv # scala version from scalaenv (https://github.com/scalaenv/scalaenv) + #haskell_stack # haskell version from stack (https://haskellstack.org/) + kubecontext # current kubernetes context (https://kubernetes.io/) + terraform # terraform workspace (https://www.terraform.io) + terraform_version # terraform version (https://www.terraform.io) + aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) + aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) + #azure # azure account name (https://docs.microsoft.com/en-us/cli/azure) + #gcloud # google cloud cli account and project (https://cloud.google.com/) + #google_app_cred # google application credentials (https://cloud.google.com/docs/authentication/production) + toolbox # toolbox name (https://github.com/containers/toolbox) + context # user@hostname + #nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) + #ranger # ranger shell (https://github.com/ranger/ranger) + #nnn # nnn shell (https://github.com/jarun/nnn) + #lf # lf shell (https://github.com/gokcehan/lf) + #xplr # xplr shell (https://github.com/sayanarijit/xplr) + #vim_shell # vim shell indicator (:sh) + midnight_commander # midnight commander shell (https://midnight-commander.org/) + nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) + chezmoi_shell # chezmoi shell (https://www.chezmoi.io/) + vi_mode # vi mode (you don't need this if you've enabled prompt_char) + # vpn_ip # virtual private network indicator + # load # CPU load + # disk_usage # disk usage + ram # free RAM + # swap # used swap + todo # todo items (https://github.com/todotxt/todo.txt-cli) + timewarrior # timewarrior tracking status (https://timewarrior.net/) + taskwarrior # taskwarrior task count (https://taskwarrior.org/) + per_directory_history # Oh My Zsh per-directory-history local/global indicator + # cpu_arch # CPU architecture + time # current time + # =========================[ Line #2 ]========================= + newline + # ip # ip address and bandwidth usage for a specified network interface + # public_ip # public IP address + # proxy # system-wide http/https/ftp proxy + # battery # internal battery + # wifi # wifi speed + # example # example user-defined segment (see prompt_example function below) + ) + + # Defines character set used by powerlevel10k. It's best to let `p10k configure` set it for you. + typeset -g POWERLEVEL9K_MODE=nerdfont-complete + # When set to `moderate`, some icons will have an extra space after them. This is meant to avoid + # icon overlap when using non-monospace fonts. When set to `none`, spaces are not added. + typeset -g POWERLEVEL9K_ICON_PADDING=none + + # When set to true, icons appear before content on both sides of the prompt. When set + # to false, icons go after content. If empty or not set, icons go before content in the left + # prompt and after content in the right prompt. + # + # You can also override it for a specific segment: + # + # POWERLEVEL9K_STATUS_ICON_BEFORE_CONTENT=false + # + # Or for a specific segment in specific state: + # + # POWERLEVEL9K_DIR_NOT_WRITABLE_ICON_BEFORE_CONTENT=false + typeset -g POWERLEVEL9K_ICON_BEFORE_CONTENT= + + # Add an empty line before each prompt. + typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=false + + # Connect left prompt lines with these symbols. You'll probably want to use the same color + # as POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND below. + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX='%238F╭─' + typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_PREFIX='%238F├─' + typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX='%238F╰─' + # Connect right prompt lines with these symbols. + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_SUFFIX='%238F─╮' + typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_SUFFIX='%238F─┤' + typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_SUFFIX='%238F─╯' + + # Filler between left and right prompt on the first prompt line. You can set it to ' ', '·' or + # '─'. The last two make it easier to see the alignment between left and right prompt and to + # separate prompt from command output. You might want to set POWERLEVEL9K_PROMPT_ADD_NEWLINE=false + # for more compact prompt if using this option. + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR='─' + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_BACKGROUND= + typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_GAP_BACKGROUND= + if [[ $POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR != ' ' ]]; then + # The color of the filler. You'll probably want to match the color of POWERLEVEL9K_MULTILINE + # ornaments defined above. + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND=238 + # Start filler from the edge of the screen if there are no left segments on the first line. + typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_FIRST_SEGMENT_END_SYMBOL='%{%}' + # End filler on the edge of the screen if there are no right segments on the first line. + typeset -g POWERLEVEL9K_EMPTY_LINE_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='%{%}' + fi + + # Separator between same-color segments on the left. + typeset -g POWERLEVEL9K_LEFT_SUBSEGMENT_SEPARATOR='\uE0B5' + # Separator between same-color segments on the right. + typeset -g POWERLEVEL9K_RIGHT_SUBSEGMENT_SEPARATOR='\uE0B7' + # Separator between different-color segments on the left. + typeset -g POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR='\uE0B4' + # Separator between different-color segments on the right. + typeset -g POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR='\uE0B6' + # To remove a separator between two segments, add "_joined" to the second segment name. + # For example: POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(os_icon context_joined) + + # The right end of left prompt. + typeset -g POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL='\uE0B0' + # The left end of right prompt. + typeset -g POWERLEVEL9K_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='\uE0B2' + # The left end of left prompt. + typeset -g POWERLEVEL9K_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL='\uE0B2' + # The right end of right prompt. + typeset -g POWERLEVEL9K_RIGHT_PROMPT_LAST_SEGMENT_END_SYMBOL='\uE0B0' + # Left prompt terminator for lines without any segments. + typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL= + + #################################[ os_icon: os identifier ]################################## + # OS identifier color. + typeset -g POWERLEVEL9K_OS_ICON_FOREGROUND=232 + typeset -g POWERLEVEL9K_OS_ICON_BACKGROUND=7 + # Custom icon. + # typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='⭐' + + ################################[ prompt_char: prompt symbol ]################################ + # Transparent background. + typeset -g POWERLEVEL9K_PROMPT_CHAR_BACKGROUND= + # Green prompt symbol if the last command succeeded. + typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=76 + # Red prompt symbol if the last command failed. + typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=196 + # Default prompt symbol. + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION='❯' + # Prompt symbol in command vi mode. + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='❮' + # Prompt symbol in visual vi mode. + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='V' + # Prompt symbol in overwrite vi mode. + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIOWR_CONTENT_EXPANSION='▶' + typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=true + # No line terminator if prompt_char is the last segment. + typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL= + # No line introducer if prompt_char is the first segment. + typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL= + # No surrounding whitespace. + typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_{LEFT,RIGHT}_WHITESPACE= + + ##################################[ dir: current directory ]################################## + # Current directory background color. + typeset -g POWERLEVEL9K_DIR_BACKGROUND=4 + # Default current directory foreground color. + typeset -g POWERLEVEL9K_DIR_FOREGROUND=254 + # If directory is too long, shorten some of its segments to the shortest possible unique + # prefix. The shortened directory can be tab-completed to the original. + typeset -g POWERLEVEL9K_SHORTEN_STRATEGY=truncate_to_unique + # Replace removed segment suffixes with this symbol. + typeset -g POWERLEVEL9K_SHORTEN_DELIMITER= + # Color of the shortened directory segments. + typeset -g POWERLEVEL9K_DIR_SHORTENED_FOREGROUND=250 + # Color of the anchor directory segments. Anchor segments are never shortened. The first + # segment is always an anchor. + typeset -g POWERLEVEL9K_DIR_ANCHOR_FOREGROUND=255 + # Display anchor directory segments in bold. + typeset -g POWERLEVEL9K_DIR_ANCHOR_BOLD=true + # Don't shorten directories that contain any of these files. They are anchors. + local anchor_files=( + .bzr + .citc + .git + .hg + .node-version + .python-version + .go-version + .ruby-version + .lua-version + .java-version + .perl-version + .php-version + .tool-versions + .shorten_folder_marker + .svn + .terraform + CVS + Cargo.toml + composer.json + go.mod + package.json + stack.yaml + ) + typeset -g POWERLEVEL9K_SHORTEN_FOLDER_MARKER="(${(j:|:)anchor_files})" + # If set to "first" ("last"), remove everything before the first (last) subdirectory that contains + # files matching $POWERLEVEL9K_SHORTEN_FOLDER_MARKER. For example, when the current directory is + # /foo/bar/git_repo/nested_git_repo/baz, prompt will display git_repo/nested_git_repo/baz (first) + # or nested_git_repo/baz (last). This assumes that git_repo and nested_git_repo contain markers + # and other directories don't. + # + # Optionally, "first" and "last" can be followed by ":" where is an integer. + # This moves the truncation point to the right (positive offset) or to the left (negative offset) + # relative to the marker. Plain "first" and "last" are equivalent to "first:0" and "last:0" + # respectively. + typeset -g POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=false + # Don't shorten this many last directory segments. They are anchors. + typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1 + # Shorten directory if it's longer than this even if there is space for it. The value can + # be either absolute (e.g., '80') or a percentage of terminal width (e.g, '50%'). If empty, + # directory will be shortened only when prompt doesn't fit or when other parameters demand it + # (see POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS and POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT below). + # If set to `0`, directory will always be shortened to its minimum length. + typeset -g POWERLEVEL9K_DIR_MAX_LENGTH=80 + # When `dir` segment is on the last prompt line, try to shorten it enough to leave at least this + # many columns for typing commands. + typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS=40 + # When `dir` segment is on the last prompt line, try to shorten it enough to leave at least + # COLUMNS * POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT * 0.01 columns for typing commands. + typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT=50 + # If set to true, embed a hyperlink into the directory. Useful for quickly + # opening a directory in the file manager simply by clicking the link. + # Can also be handy when the directory is shortened, as it allows you to see + # the full directory that was used in previous commands. + typeset -g POWERLEVEL9K_DIR_HYPERLINK=false + + # Enable special styling for non-writable and non-existent directories. See POWERLEVEL9K_LOCK_ICON + # and POWERLEVEL9K_DIR_CLASSES below. + typeset -g POWERLEVEL9K_DIR_SHOW_WRITABLE=v3 + + # The default icon shown next to non-writable and non-existent directories when + # POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3. + # typeset -g POWERLEVEL9K_LOCK_ICON='⭐' + + # POWERLEVEL9K_DIR_CLASSES allows you to specify custom icons and colors for different + # directories. It must be an array with 3 * N elements. Each triplet consists of: + # + # 1. A pattern against which the current directory ($PWD) is matched. Matching is done with + # extended_glob option enabled. + # 2. Directory class for the purpose of styling. + # 3. An empty string. + # + # Triplets are tried in order. The first triplet whose pattern matches $PWD wins. + # + # If POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3, non-writable and non-existent directories + # acquire class suffix _NOT_WRITABLE and NON_EXISTENT respectively. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_DIR_CLASSES=( + # '~/work(|/*)' WORK '' + # '~(|/*)' HOME '' + # '*' DEFAULT '') + # + # Whenever the current directory is ~/work or a subdirectory of ~/work, it gets styled with one + # of the following classes depending on its writability and existence: WORK, WORK_NOT_WRITABLE or + # WORK_NON_EXISTENT. + # + # Simply assigning classes to directories doesn't have any visible effects. It merely gives you an + # option to define custom colors and icons for different directory classes. + # + # # Styling for WORK. + # typeset -g POWERLEVEL9K_DIR_WORK_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_DIR_WORK_BACKGROUND=4 + # typeset -g POWERLEVEL9K_DIR_WORK_FOREGROUND=254 + # typeset -g POWERLEVEL9K_DIR_WORK_SHORTENED_FOREGROUND=250 + # typeset -g POWERLEVEL9K_DIR_WORK_ANCHOR_FOREGROUND=255 + # + # # Styling for WORK_NOT_WRITABLE. + # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_BACKGROUND=4 + # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND=254 + # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_SHORTENED_FOREGROUND=250 + # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_ANCHOR_FOREGROUND=255 + # + # # Styling for WORK_NON_EXISTENT. + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_BACKGROUND=4 + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_FOREGROUND=254 + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_SHORTENED_FOREGROUND=250 + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_ANCHOR_FOREGROUND=255 + # + # If a styling parameter isn't explicitly defined for some class, it falls back to the classless + # parameter. For example, if POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND is not set, it falls + # back to POWERLEVEL9K_DIR_FOREGROUND. + # + # typeset -g POWERLEVEL9K_DIR_CLASSES=() + + # Custom prefix. + # typeset -g POWERLEVEL9K_DIR_PREFIX='in ' + + #####################################[ vcs: git status ]###################################### + # Version control background colors. + typeset -g POWERLEVEL9K_VCS_CLEAN_BACKGROUND=2 + typeset -g POWERLEVEL9K_VCS_MODIFIED_BACKGROUND=3 + typeset -g POWERLEVEL9K_VCS_UNTRACKED_BACKGROUND=2 + typeset -g POWERLEVEL9K_VCS_CONFLICTED_BACKGROUND=3 + typeset -g POWERLEVEL9K_VCS_LOADING_BACKGROUND=8 + + # Branch icon. Set this parameter to '\UE0A0 ' for the popular Powerline branch icon. + #typeset -g POWERLEVEL9K_VCS_BRANCH_ICON='\uF126 ' + typeset -g POWERLEVEL9K_VCS_BRANCH_ICON='\UE0A0 ' + + # Untracked files icon. It's really a question mark, your font isn't broken. + # Change the value of this parameter to show a different icon. + typeset -g POWERLEVEL9K_VCS_UNTRACKED_ICON='?' + + # Formatter for Git status. + # + # Example output: master wip ⇣42⇡42 *42 merge ~42 +42 !42 ?42. + # + # You can edit the function to customize how Git status looks. + # + # VCS_STATUS_* parameters are set by gitstatus plugin. See reference: + # https://github.com/romkatv/gitstatus/blob/master/gitstatus.plugin.zsh. + function my_git_formatter() { + emulate -L zsh + + if [[ -n $P9K_CONTENT ]]; then + # If P9K_CONTENT is not empty, use it. It's either "loading" or from vcs_info (not from + # gitstatus plugin). VCS_STATUS_* parameters are not available in this case. + typeset -g my_git_format=$P9K_CONTENT + return + fi + + # Styling for different parts of Git status. + local meta='%7F' # white foreground + local clean='%0F' # black foreground + local modified='%0F' # black foreground + local untracked='%0F' # black foreground + local conflicted='%1F' # red foreground + + local res + + if [[ -n $VCS_STATUS_LOCAL_BRANCH ]]; then + local branch=${(V)VCS_STATUS_LOCAL_BRANCH} + # If local branch name is at most 32 characters long, show it in full. + # Otherwise show the first 12 … the last 12. + # Tip: To always show local branch name in full without truncation, delete the next line. + (( $#branch > 32 )) && branch[13,-13]="…" # <-- this line + res+="${clean}${(g::)POWERLEVEL9K_VCS_BRANCH_ICON}${branch//\%/%%}" + fi + + if [[ -n $VCS_STATUS_TAG + # Show tag only if not on a branch. + # Tip: To always show tag, delete the next line. + && -z $VCS_STATUS_LOCAL_BRANCH # <-- this line + ]]; then + local tag=${(V)VCS_STATUS_TAG} + # If tag name is at most 32 characters long, show it in full. + # Otherwise show the first 12 … the last 12. + # Tip: To always show tag name in full without truncation, delete the next line. + (( $#tag > 32 )) && tag[13,-13]="…" # <-- this line + res+="${meta}#${clean}${tag//\%/%%}" + fi + + # Display the current Git commit if there is no branch and no tag. + # Tip: To always display the current Git commit, delete the next line. + [[ -z $VCS_STATUS_LOCAL_BRANCH && -z $VCS_STATUS_TAG ]] && # <-- this line + res+="${meta}@${clean}${VCS_STATUS_COMMIT[1,8]}" + + # Show tracking branch name if it differs from local branch. + if [[ -n ${VCS_STATUS_REMOTE_BRANCH:#$VCS_STATUS_LOCAL_BRANCH} ]]; then + res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}" + fi + + # Display "wip" if the latest commit's summary contains "wip" or "WIP". + if [[ $VCS_STATUS_COMMIT_SUMMARY == (|*[^[:alnum:]])(wip|WIP)(|[^[:alnum:]]*) ]]; then + res+=" ${modified}wip" + fi + + if (( VCS_STATUS_COMMITS_AHEAD || VCS_STATUS_COMMITS_BEHIND )); then + # ⇣42 if behind the remote. + (( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}" + # ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42. + (( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" " + (( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}⇡${VCS_STATUS_COMMITS_AHEAD}" + elif [[ -n $VCS_STATUS_REMOTE_BRANCH ]]; then + # Tip: Uncomment the next line to display '=' if up to date with the remote. + # res+=" ${clean}=" + fi + + # ⇠42 if behind the push remote. + (( VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" ${clean}⇠${VCS_STATUS_PUSH_COMMITS_BEHIND}" + (( VCS_STATUS_PUSH_COMMITS_AHEAD && !VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" " + # ⇢42 if ahead of the push remote; no leading space if also behind: ⇠42⇢42. + (( VCS_STATUS_PUSH_COMMITS_AHEAD )) && res+="${clean}⇢${VCS_STATUS_PUSH_COMMITS_AHEAD}" + # *42 if have stashes. + (( VCS_STATUS_STASHES )) && res+=" ${clean}*${VCS_STATUS_STASHES}" + # 'merge' if the repo is in an unusual state. + [[ -n $VCS_STATUS_ACTION ]] && res+=" ${conflicted}${VCS_STATUS_ACTION}" + # ~42 if have merge conflicts. + (( VCS_STATUS_NUM_CONFLICTED )) && res+=" ${conflicted}~${VCS_STATUS_NUM_CONFLICTED}" + # +42 if have staged changes. + (( VCS_STATUS_NUM_STAGED )) && res+=" ${modified}+${VCS_STATUS_NUM_STAGED}" + # !42 if have unstaged changes. + (( VCS_STATUS_NUM_UNSTAGED )) && res+=" ${modified}!${VCS_STATUS_NUM_UNSTAGED}" + # ?42 if have untracked files. It's really a question mark, your font isn't broken. + # See POWERLEVEL9K_VCS_UNTRACKED_ICON above if you want to use a different icon. + # Remove the next line if you don't want to see untracked files at all. + (( VCS_STATUS_NUM_UNTRACKED )) && res+=" ${untracked}${(g::)POWERLEVEL9K_VCS_UNTRACKED_ICON}${VCS_STATUS_NUM_UNTRACKED}" + # "─" if the number of unstaged files is unknown. This can happen due to + # POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY (see below) being set to a non-negative number lower + # than the number of files in the Git index, or due to bash.showDirtyState being set to false + # in the repository config. The number of staged and untracked files may also be unknown + # in this case. + (( VCS_STATUS_HAS_UNSTAGED == -1 )) && res+=" ${modified}─" + + typeset -g my_git_format=$res + } + functions -M my_git_formatter 2>/dev/null + + # Don't count the number of unstaged, untracked and conflicted files in Git repositories with + # more than this many files in the index. Negative value means infinity. + # + # If you are working in Git repositories with tens of millions of files and seeing performance + # sagging, try setting POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY to a number lower than the output + # of `git ls-files | wc -l`. Alternatively, add `bash.showDirtyState = false` to the repository's + # config: `git config bash.showDirtyState false`. + typeset -g POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY=-1 + + # Don't show Git status in prompt for repositories whose workdir matches this pattern. + # For example, if set to '~', the Git repository at $HOME/.git will be ignored. + # Multiple patterns can be combined with '|': '~(|/foo)|/bar/baz/*'. + typeset -g POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~' + + # Disable the default Git status formatting. + typeset -g POWERLEVEL9K_VCS_DISABLE_GITSTATUS_FORMATTING=true + # Install our own Git status formatter. + typeset -g POWERLEVEL9K_VCS_CONTENT_EXPANSION='${$((my_git_formatter()))+${my_git_format}}' + # Enable counters for staged, unstaged, etc. + typeset -g POWERLEVEL9K_VCS_{STAGED,UNSTAGED,UNTRACKED,CONFLICTED,COMMITS_AHEAD,COMMITS_BEHIND}_MAX_NUM=-1 + + # Custom icon. + # typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Custom prefix. + # typeset -g POWERLEVEL9K_VCS_PREFIX='on ' + + # Show status of repositories of these types. You can add svn and/or hg if you are + # using them. If you do, your prompt may become slow even when your current directory + # isn't in an svn or hg repository. + typeset -g POWERLEVEL9K_VCS_BACKENDS=(git) + + ##########################[ status: exit code of the last command ]########################### + # Enable OK_PIPE, ERROR_PIPE and ERROR_SIGNAL status states to allow us to enable, disable and + # style them independently from the regular OK and ERROR state. + typeset -g POWERLEVEL9K_STATUS_EXTENDED_STATES=true + + # Status on success. No content, just an icon. No need to show it if prompt_char is enabled as + # it will signify success by turning green. + typeset -g POWERLEVEL9K_STATUS_OK=true + typeset -g POWERLEVEL9K_STATUS_OK_VISUAL_IDENTIFIER_EXPANSION='✔' + typeset -g POWERLEVEL9K_STATUS_OK_FOREGROUND=2 + typeset -g POWERLEVEL9K_STATUS_OK_BACKGROUND=0 + + # Status when some part of a pipe command fails but the overall exit status is zero. It may look + # like this: 1|0. + typeset -g POWERLEVEL9K_STATUS_OK_PIPE=true + typeset -g POWERLEVEL9K_STATUS_OK_PIPE_VISUAL_IDENTIFIER_EXPANSION='✔' + typeset -g POWERLEVEL9K_STATUS_OK_PIPE_FOREGROUND=2 + typeset -g POWERLEVEL9K_STATUS_OK_PIPE_BACKGROUND=0 + + # Status when it's just an error code (e.g., '1'). No need to show it if prompt_char is enabled as + # it will signify error by turning red. + typeset -g POWERLEVEL9K_STATUS_ERROR=true + typeset -g POWERLEVEL9K_STATUS_ERROR_VISUAL_IDENTIFIER_EXPANSION='✘' + typeset -g POWERLEVEL9K_STATUS_ERROR_FOREGROUND=3 + typeset -g POWERLEVEL9K_STATUS_ERROR_BACKGROUND=1 + + # Status when the last command was terminated by a signal. + typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL=true + # Use terse signal names: "INT" instead of "SIGINT(2)". + typeset -g POWERLEVEL9K_STATUS_VERBOSE_SIGNAME=false + typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_VISUAL_IDENTIFIER_EXPANSION='✘' + typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_FOREGROUND=3 + typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_BACKGROUND=1 + + # Status when some part of a pipe command fails and the overall exit status is also non-zero. + # It may look like this: 1|0. + typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE=true + typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_VISUAL_IDENTIFIER_EXPANSION='✘' + typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_FOREGROUND=3 + typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_BACKGROUND=1 + + ###################[ command_execution_time: duration of the last command ]################### + # Execution time color. + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=0 + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_BACKGROUND=3 + # Show duration of the last command if takes at least this many seconds. + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3 + # Show this many fractional digits. Zero means round to seconds. + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0 + # Duration format: 1d 2h 3m 4s. + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FORMAT='d h m s' + # Custom icon. + # typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Custom prefix. + # typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PREFIX='took ' + + #######################[ background_jobs: presence of background jobs ]####################### + # Background jobs color. + typeset -g POWERLEVEL9K_BACKGROUND_JOBS_FOREGROUND=6 + typeset -g POWERLEVEL9K_BACKGROUND_JOBS_BACKGROUND=0 + # Don't show the number of background jobs. + typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE=false + # Custom icon. + # typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #######################[ direnv: direnv status (https://direnv.net/) ]######################## + # Direnv color. + typeset -g POWERLEVEL9K_DIRENV_FOREGROUND=3 + typeset -g POWERLEVEL9K_DIRENV_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_DIRENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###############[ asdf: asdf version manager (https://github.com/asdf-vm/asdf) ]############### + # Default asdf color. Only used to display tools for which there is no color override (see below). + # Tip: Override these parameters for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_FOREGROUND and + # POWERLEVEL9K_ASDF_${TOOL}_BACKGROUND. + typeset -g POWERLEVEL9K_ASDF_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_BACKGROUND=7 + + # There are four parameters that can be used to hide asdf tools. Each parameter describes + # conditions under which a tool gets hidden. Parameters can hide tools but not unhide them. If at + # least one parameter decides to hide a tool, that tool gets hidden. If no parameter decides to + # hide a tool, it gets shown. + # + # Special note on the difference between POWERLEVEL9K_ASDF_SOURCES and + # POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW. Consider the effect of the following commands: + # + # asdf local python 3.8.1 + # asdf global python 3.8.1 + # + # After running both commands the current python version is 3.8.1 and its source is "local" as + # it takes precedence over "global". If POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW is set to false, + # it'll hide python version in this case because 3.8.1 is the same as the global version. + # POWERLEVEL9K_ASDF_SOURCES will hide python version only if the value of this parameter doesn't + # contain "local". + + # Hide tool versions that don't come from one of these sources. + # + # Available sources: + # + # - shell `asdf current` says "set by ASDF_${TOOL}_VERSION environment variable" + # - local `asdf current` says "set by /some/not/home/directory/file" + # - global `asdf current` says "set by /home/username/file" + # + # Note: If this parameter is set to (shell local global), it won't hide tools. + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SOURCES. + typeset -g POWERLEVEL9K_ASDF_SOURCES=(shell local global) + + # If set to false, hide tool versions that are the same as global. + # + # Note: The name of this parameter doesn't reflect its meaning at all. + # Note: If this parameter is set to true, it won't hide tools. + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_PROMPT_ALWAYS_SHOW. + typeset -g POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW=false + + # If set to false, hide tool versions that are equal to "system". + # + # Note: If this parameter is set to true, it won't hide tools. + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_SYSTEM. + typeset -g POWERLEVEL9K_ASDF_SHOW_SYSTEM=true + + # If set to non-empty value, hide tools unless there is a file matching the specified file pattern + # in the current directory, or its parent directory, or its grandparent directory, and so on. + # + # Note: If this parameter is set to empty value, it won't hide tools. + # Note: SHOW_ON_UPGLOB isn't specific to asdf. It works with all prompt segments. + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_ON_UPGLOB. + # + # Example: Hide nodejs version when there is no package.json and no *.js files in the current + # directory, in `..`, in `../..` and so on. + # + # typeset -g POWERLEVEL9K_ASDF_NODEJS_SHOW_ON_UPGLOB='*.js|package.json' + typeset -g POWERLEVEL9K_ASDF_SHOW_ON_UPGLOB= + + # Ruby version from asdf. + typeset -g POWERLEVEL9K_ASDF_RUBY_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_RUBY_BACKGROUND=1 + # typeset -g POWERLEVEL9K_ASDF_RUBY_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_RUBY_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Python version from asdf. + typeset -g POWERLEVEL9K_ASDF_PYTHON_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_PYTHON_BACKGROUND=4 + # typeset -g POWERLEVEL9K_ASDF_PYTHON_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_PYTHON_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Go version from asdf. + typeset -g POWERLEVEL9K_ASDF_GOLANG_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_GOLANG_BACKGROUND=4 + # typeset -g POWERLEVEL9K_ASDF_GOLANG_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_GOLANG_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Node.js version from asdf. + typeset -g POWERLEVEL9K_ASDF_NODEJS_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_NODEJS_BACKGROUND=2 + # typeset -g POWERLEVEL9K_ASDF_NODEJS_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_NODEJS_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Rust version from asdf. + typeset -g POWERLEVEL9K_ASDF_RUST_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_RUST_BACKGROUND=208 + # typeset -g POWERLEVEL9K_ASDF_RUST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_RUST_SHOW_ON_UPGLOB='*.foo|*.bar' + + # .NET Core version from asdf. + typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_BACKGROUND=5 + # typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Flutter version from asdf. + typeset -g POWERLEVEL9K_ASDF_FLUTTER_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_FLUTTER_BACKGROUND=4 + # typeset -g POWERLEVEL9K_ASDF_FLUTTER_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_FLUTTER_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Lua version from asdf. + typeset -g POWERLEVEL9K_ASDF_LUA_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_LUA_BACKGROUND=4 + # typeset -g POWERLEVEL9K_ASDF_LUA_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_LUA_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Java version from asdf. + typeset -g POWERLEVEL9K_ASDF_JAVA_FOREGROUND=1 + typeset -g POWERLEVEL9K_ASDF_JAVA_BACKGROUND=7 + # typeset -g POWERLEVEL9K_ASDF_JAVA_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_JAVA_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Perl version from asdf. + typeset -g POWERLEVEL9K_ASDF_PERL_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_PERL_BACKGROUND=4 + # typeset -g POWERLEVEL9K_ASDF_PERL_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_PERL_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Erlang version from asdf. + typeset -g POWERLEVEL9K_ASDF_ERLANG_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_ERLANG_BACKGROUND=1 + # typeset -g POWERLEVEL9K_ASDF_ERLANG_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_ERLANG_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Elixir version from asdf. + typeset -g POWERLEVEL9K_ASDF_ELIXIR_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_ELIXIR_BACKGROUND=5 + # typeset -g POWERLEVEL9K_ASDF_ELIXIR_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_ELIXIR_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Postgres version from asdf. + typeset -g POWERLEVEL9K_ASDF_POSTGRES_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_POSTGRES_BACKGROUND=6 + # typeset -g POWERLEVEL9K_ASDF_POSTGRES_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_POSTGRES_SHOW_ON_UPGLOB='*.foo|*.bar' + + # PHP version from asdf. + typeset -g POWERLEVEL9K_ASDF_PHP_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_PHP_BACKGROUND=5 + # typeset -g POWERLEVEL9K_ASDF_PHP_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_PHP_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Haskell version from asdf. + typeset -g POWERLEVEL9K_ASDF_HASKELL_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_HASKELL_BACKGROUND=3 + # typeset -g POWERLEVEL9K_ASDF_HASKELL_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_HASKELL_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Julia version from asdf. + typeset -g POWERLEVEL9K_ASDF_JULIA_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_JULIA_BACKGROUND=2 + # typeset -g POWERLEVEL9K_ASDF_JULIA_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_JULIA_SHOW_ON_UPGLOB='*.foo|*.bar' + + ##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]########### + # NordVPN connection indicator color. + typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=7 + typeset -g POWERLEVEL9K_NORDVPN_BACKGROUND=4 + # Hide NordVPN connection indicator when not connected. + typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_CONTENT_EXPANSION= + typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_VISUAL_IDENTIFIER_EXPANSION= + # Custom icon. + # typeset -g POWERLEVEL9K_NORDVPN_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #################[ ranger: ranger shell (https://github.com/ranger/ranger) ]################## + # Ranger shell color. + typeset -g POWERLEVEL9K_RANGER_FOREGROUND=3 + typeset -g POWERLEVEL9K_RANGER_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]####################### + # Nnn shell color. + typeset -g POWERLEVEL9K_NNN_FOREGROUND=0 + typeset -g POWERLEVEL9K_NNN_BACKGROUND=6 + # Custom icon. + # typeset -g POWERLEVEL9K_NNN_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ######################[ lf: lf shell (https://github.com/gokcehan/lf) ]####################### + # lf shell color. + typeset -g POWERLEVEL9K_LF_FOREGROUND=0 + typeset -g POWERLEVEL9K_LF_BACKGROUND=6 + # Custom icon. + # typeset -g POWERLEVEL9K_LF_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##################[ xplr: xplr shell (https://github.com/sayanarijit/xplr) ]################## + # xplr shell color. + typeset -g POWERLEVEL9K_XPLR_FOREGROUND=0 + typeset -g POWERLEVEL9K_XPLR_BACKGROUND=6 + # Custom icon. + # typeset -g POWERLEVEL9K_XPLR_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########################[ vim_shell: vim shell indicator (:sh) ]########################### + # Vim shell indicator color. + typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=0 + typeset -g POWERLEVEL9K_VIM_SHELL_BACKGROUND=2 + # Custom icon. + # typeset -g POWERLEVEL9K_VIM_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ######[ midnight_commander: midnight commander shell (https://midnight-commander.org/) ]###### + # Midnight Commander shell color. + typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_FOREGROUND=3 + typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #[ nix_shell: nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) ]## + # Nix shell color. + typeset -g POWERLEVEL9K_NIX_SHELL_FOREGROUND=0 + typeset -g POWERLEVEL9K_NIX_SHELL_BACKGROUND=4 + + # Display the icon of nix_shell if PATH contains a subdirectory of /nix/store. + # typeset -g POWERLEVEL9K_NIX_SHELL_INFER_FROM_PATH=false + + # Tip: If you want to see just the icon without "pure" and "impure", uncomment the next line. + # typeset -g POWERLEVEL9K_NIX_SHELL_CONTENT_EXPANSION= + + # Custom icon. + # typeset -g POWERLEVEL9K_NIX_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##################[ chezmoi_shell: chezmoi shell (https://www.chezmoi.io/) ]################## + # chezmoi shell color. + typeset -g POWERLEVEL9K_CHEZMOI_SHELL_FOREGROUND=0 + typeset -g POWERLEVEL9K_CHEZMOI_SHELL_BACKGROUND=4 + # Custom icon. + # typeset -g POWERLEVEL9K_CHEZMOI_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##################################[ disk_usage: disk usage ]################################## + # Colors for different levels of disk usage. + typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_FOREGROUND=3 + typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_BACKGROUND=0 + typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_FOREGROUND=0 + typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_BACKGROUND=3 + typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_FOREGROUND=7 + typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_BACKGROUND=1 + # Thresholds for different levels of disk usage (percentage points). + typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL=90 + typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_LEVEL=95 + # If set to true, hide disk usage when below $POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL percent. + typeset -g POWERLEVEL9K_DISK_USAGE_ONLY_WARNING=false + # Custom icon. + # typeset -g POWERLEVEL9K_DISK_USAGE_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########[ vi_mode: vi mode (you don't need this if you've enabled prompt_char) ]########### + # Foreground color. + typeset -g POWERLEVEL9K_VI_MODE_FOREGROUND=0 + # Text and color for normal (a.k.a. command) vi mode. + typeset -g POWERLEVEL9K_VI_COMMAND_MODE_STRING=NORMAL + typeset -g POWERLEVEL9K_VI_MODE_NORMAL_BACKGROUND=2 + # Text and color for visual vi mode. + typeset -g POWERLEVEL9K_VI_VISUAL_MODE_STRING=VISUAL + typeset -g POWERLEVEL9K_VI_MODE_VISUAL_BACKGROUND=4 + # Text and color for overtype (a.k.a. overwrite and replace) vi mode. + typeset -g POWERLEVEL9K_VI_OVERWRITE_MODE_STRING=OVERTYPE + typeset -g POWERLEVEL9K_VI_MODE_OVERWRITE_BACKGROUND=3 + # Text and color for insert vi mode. + typeset -g POWERLEVEL9K_VI_INSERT_MODE_STRING= + typeset -g POWERLEVEL9K_VI_MODE_INSERT_FOREGROUND=8 + + ######################################[ ram: free RAM ]####################################### + # RAM color. + typeset -g POWERLEVEL9K_RAM_FOREGROUND=0 + typeset -g POWERLEVEL9K_RAM_BACKGROUND=3 + # Custom icon. + # typeset -g POWERLEVEL9K_RAM_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #####################################[ swap: used swap ]###################################### + # Swap color. + typeset -g POWERLEVEL9K_SWAP_FOREGROUND=0 + typeset -g POWERLEVEL9K_SWAP_BACKGROUND=3 + # Custom icon. + # typeset -g POWERLEVEL9K_SWAP_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ######################################[ load: CPU load ]###################################### + # Show average CPU load over this many last minutes. Valid values are 1, 5 and 15. + typeset -g POWERLEVEL9K_LOAD_WHICH=5 + # Load color when load is under 50%. + typeset -g POWERLEVEL9K_LOAD_NORMAL_FOREGROUND=0 + typeset -g POWERLEVEL9K_LOAD_NORMAL_BACKGROUND=2 + # Load color when load is between 50% and 70%. + typeset -g POWERLEVEL9K_LOAD_WARNING_FOREGROUND=0 + typeset -g POWERLEVEL9K_LOAD_WARNING_BACKGROUND=3 + # Load color when load is over 70%. + typeset -g POWERLEVEL9K_LOAD_CRITICAL_FOREGROUND=0 + typeset -g POWERLEVEL9K_LOAD_CRITICAL_BACKGROUND=1 + # Custom icon. + # typeset -g POWERLEVEL9K_LOAD_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################[ todo: todo items (https://github.com/todotxt/todo.txt-cli) ]################ + # Todo color. + typeset -g POWERLEVEL9K_TODO_FOREGROUND=0 + typeset -g POWERLEVEL9K_TODO_BACKGROUND=8 + # Hide todo when the total number of tasks is zero. + typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_TOTAL=true + # Hide todo when the number of tasks after filtering is zero. + typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_FILTERED=false + + # Todo format. The following parameters are available within the expansion. + # + # - P9K_TODO_TOTAL_TASK_COUNT The total number of tasks. + # - P9K_TODO_FILTERED_TASK_COUNT The number of tasks after filtering. + # + # These variables correspond to the last line of the output of `todo.sh -p ls`: + # + # TODO: 24 of 42 tasks shown + # + # Here 24 is P9K_TODO_FILTERED_TASK_COUNT and 42 is P9K_TODO_TOTAL_TASK_COUNT. + # + # typeset -g POWERLEVEL9K_TODO_CONTENT_EXPANSION='$P9K_TODO_FILTERED_TASK_COUNT' + + # Custom icon. + # typeset -g POWERLEVEL9K_TODO_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########[ timewarrior: timewarrior tracking status (https://timewarrior.net/) ]############ + # Timewarrior color. + typeset -g POWERLEVEL9K_TIMEWARRIOR_FOREGROUND=255 + typeset -g POWERLEVEL9K_TIMEWARRIOR_BACKGROUND=8 + + # If the tracked task is longer than 24 characters, truncate and append "…". + # Tip: To always display tasks without truncation, delete the following parameter. + # Tip: To hide task names and display just the icon when time tracking is enabled, set the + # value of the following parameter to "". + typeset -g POWERLEVEL9K_TIMEWARRIOR_CONTENT_EXPANSION='${P9K_CONTENT:0:24}${${P9K_CONTENT:24}:+…}' + + # Custom icon. + # typeset -g POWERLEVEL9K_TIMEWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##############[ taskwarrior: taskwarrior task count (https://taskwarrior.org/) ]############## + # Taskwarrior color. + typeset -g POWERLEVEL9K_TASKWARRIOR_FOREGROUND=0 + typeset -g POWERLEVEL9K_TASKWARRIOR_BACKGROUND=6 + + # Taskwarrior segment format. The following parameters are available within the expansion. + # + # - P9K_TASKWARRIOR_PENDING_COUNT The number of pending tasks: `task +PENDING count`. + # - P9K_TASKWARRIOR_OVERDUE_COUNT The number of overdue tasks: `task +OVERDUE count`. + # + # Zero values are represented as empty parameters. + # + # The default format: + # + # '${P9K_TASKWARRIOR_OVERDUE_COUNT:+"!$P9K_TASKWARRIOR_OVERDUE_COUNT/"}$P9K_TASKWARRIOR_PENDING_COUNT' + # + # typeset -g POWERLEVEL9K_TASKWARRIOR_CONTENT_EXPANSION='$P9K_TASKWARRIOR_PENDING_COUNT' + + # Custom icon. + # typeset -g POWERLEVEL9K_TASKWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ######[ per_directory_history: Oh My Zsh per-directory-history local/global indicator ]####### + # Color when using local/global history. + typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_FOREGROUND=0 + typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_BACKGROUND=5 + typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_FOREGROUND=0 + typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_BACKGROUND=3 + + # Tip: Uncomment the next two lines to hide "local"/"global" text and leave just the icon. + # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_CONTENT_EXPANSION='' + # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_CONTENT_EXPANSION='' + + # Custom icon. + # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################################[ cpu_arch: CPU architecture ]################################ + # CPU architecture color. + typeset -g POWERLEVEL9K_CPU_ARCH_FOREGROUND=0 + typeset -g POWERLEVEL9K_CPU_ARCH_BACKGROUND=3 + + # Hide the segment when on a specific CPU architecture. + # typeset -g POWERLEVEL9K_CPU_ARCH_X86_64_CONTENT_EXPANSION= + # typeset -g POWERLEVEL9K_CPU_ARCH_X86_64_VISUAL_IDENTIFIER_EXPANSION= + + # Custom icon. + # typeset -g POWERLEVEL9K_CPU_ARCH_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##################################[ context: user@hostname ]################################## + # Context color when running with privileges. + typeset -g POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=1 + typeset -g POWERLEVEL9K_CONTEXT_ROOT_BACKGROUND=0 + # Context color in SSH without privileges. + typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_FOREGROUND=3 + typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_BACKGROUND=0 + # Default context color (no privileges, no SSH). + typeset -g POWERLEVEL9K_CONTEXT_FOREGROUND=3 + typeset -g POWERLEVEL9K_CONTEXT_BACKGROUND=0 + + # Context format when running with privileges: user@hostname. + typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE='%n@%m' + # Context format when in SSH without privileges: user@hostname. + typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_TEMPLATE='%n@%m' + # Default context format (no privileges, no SSH): user@hostname. + typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE='%n@%m' + + # Don't show context unless running with privileges or in SSH. + # Tip: Remove the next line to always show context. + typeset -g POWERLEVEL9K_CONTEXT_{DEFAULT,SUDO}_{CONTENT,VISUAL_IDENTIFIER}_EXPANSION= + + # Custom icon. + # typeset -g POWERLEVEL9K_CONTEXT_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Custom prefix. + # typeset -g POWERLEVEL9K_CONTEXT_PREFIX='with ' + + ###[ virtualenv: python virtual environment (https://docs.python.org/3/library/venv.html) ]### + # Python virtual environment color. + typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_VIRTUALENV_BACKGROUND=4 + # Don't show Python version next to the virtual environment name. + typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false + # If set to "false", won't show virtualenv if pyenv is already shown. + # If set to "if-different", won't show virtualenv if it's the same as pyenv. + typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV=false + # Separate environment name from Python version only with a space. + typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER= + # Custom icon. + # typeset -g POWERLEVEL9K_VIRTUALENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #####################[ anaconda: conda environment (https://conda.io/) ]###################### + # Anaconda environment color. + typeset -g POWERLEVEL9K_ANACONDA_FOREGROUND=0 + typeset -g POWERLEVEL9K_ANACONDA_BACKGROUND=4 + + # Anaconda segment format. The following parameters are available within the expansion. + # + # - CONDA_PREFIX Absolute path to the active Anaconda/Miniconda environment. + # - CONDA_DEFAULT_ENV Name of the active Anaconda/Miniconda environment. + # - CONDA_PROMPT_MODIFIER Configurable prompt modifier (see below). + # - P9K_ANACONDA_PYTHON_VERSION Current python version (python --version). + # + # CONDA_PROMPT_MODIFIER can be configured with the following command: + # + # conda config --set env_prompt '({default_env}) ' + # + # The last argument is a Python format string that can use the following variables: + # + # - prefix The same as CONDA_PREFIX. + # - default_env The same as CONDA_DEFAULT_ENV. + # - name The last segment of CONDA_PREFIX. + # - stacked_env Comma-separated list of names in the environment stack. The first element is + # always the same as default_env. + # + # Note: '({default_env}) ' is the default value of env_prompt. + # + # The default value of POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION expands to $CONDA_PROMPT_MODIFIER + # without the surrounding parentheses, or to the last path component of CONDA_PREFIX if the former + # is empty. + typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${${${CONDA_PROMPT_MODIFIER#\(}% }%\)}:-${CONDA_PREFIX:t}}' + + # Custom icon. + # typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################[ pyenv: python environment (https://github.com/pyenv/pyenv) ]################ + # Pyenv color. + typeset -g POWERLEVEL9K_PYENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_PYENV_BACKGROUND=4 + # Hide python version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_PYENV_SOURCES=(shell local global) + # If set to false, hide python version if it's the same as global: + # $(pyenv version-name) == $(pyenv global). + typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide python version if it's equal to "system". + typeset -g POWERLEVEL9K_PYENV_SHOW_SYSTEM=true + + # Pyenv segment format. The following parameters are available within the expansion. + # + # - P9K_CONTENT Current pyenv environment (pyenv version-name). + # - P9K_PYENV_PYTHON_VERSION Current python version (python --version). + # + # The default format has the following logic: + # + # 1. Display just "$P9K_CONTENT" if it's equal to "$P9K_PYENV_PYTHON_VERSION" or + # starts with "$P9K_PYENV_PYTHON_VERSION/". + # 2. Otherwise display "$P9K_CONTENT $P9K_PYENV_PYTHON_VERSION". + typeset -g POWERLEVEL9K_PYENV_CONTENT_EXPANSION='${P9K_CONTENT}${${P9K_CONTENT:#$P9K_PYENV_PYTHON_VERSION(|/*)}:+ $P9K_PYENV_PYTHON_VERSION}' + + # Custom icon. + # typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################[ goenv: go environment (https://github.com/syndbg/goenv) ]################ + # Goenv color. + typeset -g POWERLEVEL9K_GOENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_GOENV_BACKGROUND=4 + # Hide go version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_GOENV_SOURCES=(shell local global) + # If set to false, hide go version if it's the same as global: + # $(goenv version-name) == $(goenv global). + typeset -g POWERLEVEL9K_GOENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide go version if it's equal to "system". + typeset -g POWERLEVEL9K_GOENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_GOENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ nodenv: node.js version from nodenv (https://github.com/nodenv/nodenv) ]########## + # Nodenv color. + typeset -g POWERLEVEL9K_NODENV_FOREGROUND=2 + typeset -g POWERLEVEL9K_NODENV_BACKGROUND=0 + # Hide node version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_NODENV_SOURCES=(shell local global) + # If set to false, hide node version if it's the same as global: + # $(nodenv version-name) == $(nodenv global). + typeset -g POWERLEVEL9K_NODENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide node version if it's equal to "system". + typeset -g POWERLEVEL9K_NODENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_NODENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]############### + # Nvm color. + typeset -g POWERLEVEL9K_NVM_FOREGROUND=0 + typeset -g POWERLEVEL9K_NVM_BACKGROUND=5 + # If set to false, hide node version if it's the same as default: + # $(nvm version current) == $(nvm version default). + typeset -g POWERLEVEL9K_NVM_PROMPT_ALWAYS_SHOW=false + # If set to false, hide node version if it's equal to "system". + typeset -g POWERLEVEL9K_NVM_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ############[ nodeenv: node.js environment (https://github.com/ekalinin/nodeenv) ]############ + # Nodeenv color. + typeset -g POWERLEVEL9K_NODEENV_FOREGROUND=2 + typeset -g POWERLEVEL9K_NODEENV_BACKGROUND=0 + # Don't show Node version next to the environment name. + typeset -g POWERLEVEL9K_NODEENV_SHOW_NODE_VERSION=false + # Separate environment name from Node version only with a space. + typeset -g POWERLEVEL9K_NODEENV_{LEFT,RIGHT}_DELIMITER= + # Custom icon. + # typeset -g POWERLEVEL9K_NODEENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##############################[ node_version: node.js version ]############################### + # Node version color. + typeset -g POWERLEVEL9K_NODE_VERSION_FOREGROUND=7 + typeset -g POWERLEVEL9K_NODE_VERSION_BACKGROUND=2 + # Show node version only when in a directory tree containing package.json. + typeset -g POWERLEVEL9K_NODE_VERSION_PROJECT_ONLY=true + # Custom icon. + # typeset -g POWERLEVEL9K_NODE_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #######################[ go_version: go version (https://golang.org) ]######################## + # Go version color. + typeset -g POWERLEVEL9K_GO_VERSION_FOREGROUND=255 + typeset -g POWERLEVEL9K_GO_VERSION_BACKGROUND=2 + # Show go version only when in a go project subdirectory. + typeset -g POWERLEVEL9K_GO_VERSION_PROJECT_ONLY=true + # Custom icon. + # typeset -g POWERLEVEL9K_GO_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #################[ rust_version: rustc version (https://www.rust-lang.org) ]################## + # Rust version color. + typeset -g POWERLEVEL9K_RUST_VERSION_FOREGROUND=0 + typeset -g POWERLEVEL9K_RUST_VERSION_BACKGROUND=208 + # Show rust version only when in a rust project subdirectory. + typeset -g POWERLEVEL9K_RUST_VERSION_PROJECT_ONLY=true + # Custom icon. + # typeset -g POWERLEVEL9K_RUST_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###############[ dotnet_version: .NET version (https://dotnet.microsoft.com) ]################ + # .NET version color. + typeset -g POWERLEVEL9K_DOTNET_VERSION_FOREGROUND=7 + typeset -g POWERLEVEL9K_DOTNET_VERSION_BACKGROUND=5 + # Show .NET version only when in a .NET project subdirectory. + typeset -g POWERLEVEL9K_DOTNET_VERSION_PROJECT_ONLY=true + # Custom icon. + # typeset -g POWERLEVEL9K_DOTNET_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #####################[ php_version: php version (https://www.php.net/) ]###################### + # PHP version color. + typeset -g POWERLEVEL9K_PHP_VERSION_FOREGROUND=0 + typeset -g POWERLEVEL9K_PHP_VERSION_BACKGROUND=5 + # Show PHP version only when in a PHP project subdirectory. + typeset -g POWERLEVEL9K_PHP_VERSION_PROJECT_ONLY=true + # Custom icon. + # typeset -g POWERLEVEL9K_PHP_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ laravel_version: laravel php framework version (https://laravel.com/) ]########### + # Laravel version color. + typeset -g POWERLEVEL9K_LARAVEL_VERSION_FOREGROUND=1 + typeset -g POWERLEVEL9K_LARAVEL_VERSION_BACKGROUND=7 + # Custom icon. + # typeset -g POWERLEVEL9K_LARAVEL_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #############[ rbenv: ruby version from rbenv (https://github.com/rbenv/rbenv) ]############## + # Rbenv color. + typeset -g POWERLEVEL9K_RBENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_RBENV_BACKGROUND=1 + # Hide ruby version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_RBENV_SOURCES=(shell local global) + # If set to false, hide ruby version if it's the same as global: + # $(rbenv version-name) == $(rbenv global). + typeset -g POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide ruby version if it's equal to "system". + typeset -g POWERLEVEL9K_RBENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_RBENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ####################[ java_version: java version (https://www.java.com/) ]#################### + # Java version color. + typeset -g POWERLEVEL9K_JAVA_VERSION_FOREGROUND=1 + typeset -g POWERLEVEL9K_JAVA_VERSION_BACKGROUND=7 + # Show java version only when in a java project subdirectory. + typeset -g POWERLEVEL9K_JAVA_VERSION_PROJECT_ONLY=true + # Show brief version. + typeset -g POWERLEVEL9K_JAVA_VERSION_FULL=false + # Custom icon. + # typeset -g POWERLEVEL9K_JAVA_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###[ package: name@version from package.json (https://docs.npmjs.com/files/package.json) ]#### + # Package color. + typeset -g POWERLEVEL9K_PACKAGE_FOREGROUND=0 + typeset -g POWERLEVEL9K_PACKAGE_BACKGROUND=6 + + # Package format. The following parameters are available within the expansion. + # + # - P9K_PACKAGE_NAME The value of `name` field in package.json. + # - P9K_PACKAGE_VERSION The value of `version` field in package.json. + # + # typeset -g POWERLEVEL9K_PACKAGE_CONTENT_EXPANSION='${P9K_PACKAGE_NAME//\%/%%}@${P9K_PACKAGE_VERSION//\%/%%}' + + # Custom icon. + # typeset -g POWERLEVEL9K_PACKAGE_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #######################[ rvm: ruby version from rvm (https://rvm.io) ]######################## + # Rvm color. + typeset -g POWERLEVEL9K_RVM_FOREGROUND=0 + typeset -g POWERLEVEL9K_RVM_BACKGROUND=240 + # Don't show @gemset at the end. + typeset -g POWERLEVEL9K_RVM_SHOW_GEMSET=false + # Don't show ruby- at the front. + typeset -g POWERLEVEL9K_RVM_SHOW_PREFIX=false + # Custom icon. + # typeset -g POWERLEVEL9K_RVM_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########[ fvm: flutter version management (https://github.com/leoafarias/fvm) ]############ + # Fvm color. + typeset -g POWERLEVEL9K_FVM_FOREGROUND=0 + typeset -g POWERLEVEL9K_FVM_BACKGROUND=4 + # Custom icon. + # typeset -g POWERLEVEL9K_FVM_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ luaenv: lua version from luaenv (https://github.com/cehoffman/luaenv) ]########### + # Lua color. + typeset -g POWERLEVEL9K_LUAENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_LUAENV_BACKGROUND=4 + # Hide lua version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_LUAENV_SOURCES=(shell local global) + # If set to false, hide lua version if it's the same as global: + # $(luaenv version-name) == $(luaenv global). + typeset -g POWERLEVEL9K_LUAENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide lua version if it's equal to "system". + typeset -g POWERLEVEL9K_LUAENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_LUAENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###############[ jenv: java version from jenv (https://github.com/jenv/jenv) ]################ + # Java color. + typeset -g POWERLEVEL9K_JENV_FOREGROUND=1 + typeset -g POWERLEVEL9K_JENV_BACKGROUND=7 + # Hide java version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_JENV_SOURCES=(shell local global) + # If set to false, hide java version if it's the same as global: + # $(jenv version-name) == $(jenv global). + typeset -g POWERLEVEL9K_JENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide java version if it's equal to "system". + typeset -g POWERLEVEL9K_JENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_JENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########[ plenv: perl version from plenv (https://github.com/tokuhirom/plenv) ]############ + # Perl color. + typeset -g POWERLEVEL9K_PLENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_PLENV_BACKGROUND=4 + # Hide perl version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_PLENV_SOURCES=(shell local global) + # If set to false, hide perl version if it's the same as global: + # $(plenv version-name) == $(plenv global). + typeset -g POWERLEVEL9K_PLENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide perl version if it's equal to "system". + typeset -g POWERLEVEL9K_PLENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_PLENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########[ perlbrew: perl version from perlbrew (https://github.com/gugod/App-perlbrew) ]############ + # Perlbrew color. + typeset -g POWERLEVEL9K_PERLBREW_FOREGROUND=67 + # Show perlbrew version only when in a perl project subdirectory. + typeset -g POWERLEVEL9K_PERLBREW_PROJECT_ONLY=true + # Don't show "perl-" at the front. + typeset -g POWERLEVEL9K_PERLBREW_SHOW_PREFIX=false + # Custom icon. + # typeset -g POWERLEVEL9K_PERLBREW_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ############[ phpenv: php version from phpenv (https://github.com/phpenv/phpenv) ]############ + # PHP color. + typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_PHPENV_BACKGROUND=5 + # Hide php version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_PHPENV_SOURCES=(shell local global) + # If set to false, hide php version if it's the same as global: + # $(phpenv version-name) == $(phpenv global). + typeset -g POWERLEVEL9K_PHPENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide PHP version if it's equal to "system". + typeset -g POWERLEVEL9K_PHPENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_PHPENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #######[ scalaenv: scala version from scalaenv (https://github.com/scalaenv/scalaenv) ]####### + # Scala color. + typeset -g POWERLEVEL9K_SCALAENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_SCALAENV_BACKGROUND=1 + # Hide scala version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_SCALAENV_SOURCES=(shell local global) + # If set to false, hide scala version if it's the same as global: + # $(scalaenv version-name) == $(scalaenv global). + typeset -g POWERLEVEL9K_SCALAENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide scala version if it's equal to "system". + typeset -g POWERLEVEL9K_SCALAENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_SCALAENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ haskell_stack: haskell version from stack (https://haskellstack.org/) ]########### + # Haskell color. + typeset -g POWERLEVEL9K_HASKELL_STACK_FOREGROUND=0 + typeset -g POWERLEVEL9K_HASKELL_STACK_BACKGROUND=3 + + # Hide haskell version if it doesn't come from one of these sources. + # + # shell: version is set by STACK_YAML + # local: version is set by stack.yaml up the directory tree + # global: version is set by the implicit global project (~/.stack/global-project/stack.yaml) + typeset -g POWERLEVEL9K_HASKELL_STACK_SOURCES=(shell local) + # If set to false, hide haskell version if it's the same as in the implicit global project. + typeset -g POWERLEVEL9K_HASKELL_STACK_ALWAYS_SHOW=true + # Custom icon. + # typeset -g POWERLEVEL9K_HASKELL_STACK_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################[ terraform: terraform workspace (https://www.terraform.io) ]################# + # Don't show terraform workspace if it's literally "default". + typeset -g POWERLEVEL9K_TERRAFORM_SHOW_DEFAULT=false + # POWERLEVEL9K_TERRAFORM_CLASSES is an array with even number of elements. The first element + # in each pair defines a pattern against which the current terraform workspace gets matched. + # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) + # that gets matched. If you unset all POWERLEVEL9K_TERRAFORM_*CONTENT_EXPANSION parameters, + # you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_TERRAFORM_CLASSES defines the workspace class. Patterns are tried in order. The + # first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( + # '*prod*' PROD + # '*test*' TEST + # '*' OTHER) + # + # If your current terraform workspace is "project_test", its class is TEST because "project_test" + # doesn't match the pattern '*prod*' but does match '*test*'. + # + # You can define different colors, icons and content expansions for different classes: + # + # typeset -g POWERLEVEL9K_TERRAFORM_TEST_FOREGROUND=2 + # typeset -g POWERLEVEL9K_TERRAFORM_TEST_BACKGROUND=0 + # typeset -g POWERLEVEL9K_TERRAFORM_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_TERRAFORM_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' + typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( + # '*prod*' PROD # These values are examples that are unlikely + # '*test*' TEST # to match your needs. Customize them as needed. + '*' OTHER) + typeset -g POWERLEVEL9K_TERRAFORM_OTHER_FOREGROUND=4 + typeset -g POWERLEVEL9K_TERRAFORM_OTHER_BACKGROUND=0 + # typeset -g POWERLEVEL9K_TERRAFORM_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #############[ terraform_version: terraform version (https://www.terraform.io) ]############## + # Terraform version color. + typeset -g POWERLEVEL9K_TERRAFORM_VERSION_FOREGROUND=4 + typeset -g POWERLEVEL9K_TERRAFORM_VERSION_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_TERRAFORM_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################[ terraform_version: It shows active terraform version (https://www.terraform.io) ]################# + typeset -g POWERLEVEL9K_TERRAFORM_VERSION_SHOW_ON_COMMAND='terraform|tf' + + #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# + # Show kubecontext only when the command you are typing invokes one of these tools. + # Tip: Remove the next line to always show kubecontext. + typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent|kubecolor|cmctl|sparkctl' + + # Kubernetes context classes for the purpose of using different colors, icons and expansions with + # different contexts. + # + # POWERLEVEL9K_KUBECONTEXT_CLASSES is an array with even number of elements. The first element + # in each pair defines a pattern against which the current kubernetes context gets matched. + # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) + # that gets matched. If you unset all POWERLEVEL9K_KUBECONTEXT_*CONTENT_EXPANSION parameters, + # you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_KUBECONTEXT_CLASSES defines the context class. Patterns are tried in order. The + # first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_KUBECONTEXT_CLASSES=( + # '*prod*' PROD + # '*test*' TEST + # '*' DEFAULT) + # + # If your current kubernetes context is "deathray-testing/default", its class is TEST + # because "deathray-testing/default" doesn't match the pattern '*prod*' but does match '*test*'. + # + # You can define different colors, icons and content expansions for different classes: + # + # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_FOREGROUND=0 + # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_BACKGROUND=2 + # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' + typeset -g POWERLEVEL9K_KUBECONTEXT_CLASSES=( + # '*prod*' PROD # These values are examples that are unlikely + # '*test*' TEST # to match your needs. Customize them as needed. + '*' DEFAULT) + typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_FOREGROUND=7 + typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_BACKGROUND=5 + # typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Use POWERLEVEL9K_KUBECONTEXT_CONTENT_EXPANSION to specify the content displayed by kubecontext + # segment. Parameter expansions are very flexible and fast, too. See reference: + # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion. + # + # Within the expansion the following parameters are always available: + # + # - P9K_CONTENT The content that would've been displayed if there was no content + # expansion defined. + # - P9K_KUBECONTEXT_NAME The current context's name. Corresponds to column NAME in the + # output of `kubectl config get-contexts`. + # - P9K_KUBECONTEXT_CLUSTER The current context's cluster. Corresponds to column CLUSTER in the + # output of `kubectl config get-contexts`. + # - P9K_KUBECONTEXT_NAMESPACE The current context's namespace. Corresponds to column NAMESPACE + # in the output of `kubectl config get-contexts`. If there is no + # namespace, the parameter is set to "default". + # - P9K_KUBECONTEXT_USER The current context's user. Corresponds to column AUTHINFO in the + # output of `kubectl config get-contexts`. + # + # If the context points to Google Kubernetes Engine (GKE) or Elastic Kubernetes Service (EKS), + # the following extra parameters are available: + # + # - P9K_KUBECONTEXT_CLOUD_NAME Either "gke" or "eks". + # - P9K_KUBECONTEXT_CLOUD_ACCOUNT Account/project ID. + # - P9K_KUBECONTEXT_CLOUD_ZONE Availability zone. + # - P9K_KUBECONTEXT_CLOUD_CLUSTER Cluster. + # + # P9K_KUBECONTEXT_CLOUD_* parameters are derived from P9K_KUBECONTEXT_CLUSTER. For example, + # if P9K_KUBECONTEXT_CLUSTER is "gke_my-account_us-east1-a_my-cluster-01": + # + # - P9K_KUBECONTEXT_CLOUD_NAME=gke + # - P9K_KUBECONTEXT_CLOUD_ACCOUNT=my-account + # - P9K_KUBECONTEXT_CLOUD_ZONE=us-east1-a + # - P9K_KUBECONTEXT_CLOUD_CLUSTER=my-cluster-01 + # + # If P9K_KUBECONTEXT_CLUSTER is "arn:aws:eks:us-east-1:123456789012:cluster/my-cluster-01": + # + # - P9K_KUBECONTEXT_CLOUD_NAME=eks + # - P9K_KUBECONTEXT_CLOUD_ACCOUNT=123456789012 + # - P9K_KUBECONTEXT_CLOUD_ZONE=us-east-1 + # - P9K_KUBECONTEXT_CLOUD_CLUSTER=my-cluster-01 + typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION= + # Show P9K_KUBECONTEXT_CLOUD_CLUSTER if it's not empty and fall back to P9K_KUBECONTEXT_NAME. + POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${P9K_KUBECONTEXT_CLOUD_CLUSTER:-${P9K_KUBECONTEXT_NAME}}' + # Append the current context's namespace if it's not "default". + POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${${:-/$P9K_KUBECONTEXT_NAMESPACE}:#/default}' + + # Custom prefix. + # typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='at ' + + #[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]# + # Show aws only when the command you are typing invokes one of these tools. + # Tip: Remove the next line to always show aws. + typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi|terragrunt' + + # POWERLEVEL9K_AWS_CLASSES is an array with even number of elements. The first element + # in each pair defines a pattern against which the current AWS profile gets matched. + # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) + # that gets matched. If you unset all POWERLEVEL9K_AWS_*CONTENT_EXPANSION parameters, + # you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_AWS_CLASSES defines the profile class. Patterns are tried in order. The + # first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_AWS_CLASSES=( + # '*prod*' PROD + # '*test*' TEST + # '*' DEFAULT) + # + # If your current AWS profile is "company_test", its class is TEST + # because "company_test" doesn't match the pattern '*prod*' but does match '*test*'. + # + # You can define different colors, icons and content expansions for different classes: + # + # typeset -g POWERLEVEL9K_AWS_TEST_FOREGROUND=28 + # typeset -g POWERLEVEL9K_AWS_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_AWS_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' + typeset -g POWERLEVEL9K_AWS_CLASSES=( + # '*prod*' PROD # These values are examples that are unlikely + # '*test*' TEST # to match your needs. Customize them as needed. + '*' DEFAULT) + typeset -g POWERLEVEL9K_AWS_DEFAULT_FOREGROUND=7 + typeset -g POWERLEVEL9K_AWS_DEFAULT_BACKGROUND=1 + # typeset -g POWERLEVEL9K_AWS_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # AWS segment format. The following parameters are available within the expansion. + # + # - P9K_AWS_PROFILE The name of the current AWS profile. + # - P9K_AWS_REGION The region associated with the current AWS profile. + typeset -g POWERLEVEL9K_AWS_CONTENT_EXPANSION='${P9K_AWS_PROFILE//\%/%%}${P9K_AWS_REGION:+ ${P9K_AWS_REGION//\%/%%}}' + + #[ aws_eb_env: aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) ]# + # AWS Elastic Beanstalk environment color. + typeset -g POWERLEVEL9K_AWS_EB_ENV_FOREGROUND=2 + typeset -g POWERLEVEL9K_AWS_EB_ENV_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_AWS_EB_ENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ azure: azure account name (https://docs.microsoft.com/en-us/cli/azure) ]########## + # Show azure only when the command you are typing invokes one of these tools. + # Tip: Remove the next line to always show azure. + typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi|terragrunt' + + # POWERLEVEL9K_AZURE_CLASSES is an array with even number of elements. The first element + # in each pair defines a pattern against which the current azure account name gets matched. + # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) + # that gets matched. If you unset all POWERLEVEL9K_AZURE_*CONTENT_EXPANSION parameters, + # you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_AZURE_CLASSES defines the account class. Patterns are tried in order. The + # first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_AZURE_CLASSES=( + # '*prod*' PROD + # '*test*' TEST + # '*' OTHER) + # + # If your current azure account is "company_test", its class is TEST because "company_test" + # doesn't match the pattern '*prod*' but does match '*test*'. + # + # You can define different colors, icons and content expansions for different classes: + # + # typeset -g POWERLEVEL9K_AZURE_TEST_FOREGROUND=2 + # typeset -g POWERLEVEL9K_AZURE_TEST_BACKGROUND=0 + # typeset -g POWERLEVEL9K_AZURE_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_AZURE_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' + typeset -g POWERLEVEL9K_AZURE_CLASSES=( + # '*prod*' PROD # These values are examples that are unlikely + # '*test*' TEST # to match your needs. Customize them as needed. + '*' OTHER) + + # Azure account name color. + typeset -g POWERLEVEL9K_AZURE_OTHER_FOREGROUND=7 + typeset -g POWERLEVEL9K_AZURE_OTHER_BACKGROUND=4 + # Custom icon. + # typeset -g POWERLEVEL9K_AZURE_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]########### + # Show gcloud only when the command you are typing invokes one of these tools. + # Tip: Remove the next line to always show gcloud. + typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs|gsutil' + # Google cloud color. + typeset -g POWERLEVEL9K_GCLOUD_FOREGROUND=7 + typeset -g POWERLEVEL9K_GCLOUD_BACKGROUND=4 + + # Google cloud format. Change the value of POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION and/or + # POWERLEVEL9K_GCLOUD_COMPLETE_CONTENT_EXPANSION if the default is too verbose or not informative + # enough. You can use the following parameters in the expansions. Each of them corresponds to the + # output of `gcloud` tool. + # + # Parameter | Source + # -------------------------|-------------------------------------------------------------------- + # P9K_GCLOUD_CONFIGURATION | gcloud config configurations list --format='value(name)' + # P9K_GCLOUD_ACCOUNT | gcloud config get-value account + # P9K_GCLOUD_PROJECT_ID | gcloud config get-value project + # P9K_GCLOUD_PROJECT_NAME | gcloud projects describe $P9K_GCLOUD_PROJECT_ID --format='value(name)' + # + # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced with '%%'. + # + # Obtaining project name requires sending a request to Google servers. This can take a long time + # and even fail. When project name is unknown, P9K_GCLOUD_PROJECT_NAME is not set and gcloud + # prompt segment is in state PARTIAL. When project name gets known, P9K_GCLOUD_PROJECT_NAME gets + # set and gcloud prompt segment transitions to state COMPLETE. + # + # You can customize the format, icon and colors of gcloud segment separately for states PARTIAL + # and COMPLETE. You can also hide gcloud in state PARTIAL by setting + # POWERLEVEL9K_GCLOUD_PARTIAL_VISUAL_IDENTIFIER_EXPANSION and + # POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION to empty. + typeset -g POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION='${P9K_GCLOUD_PROJECT_ID//\%/%%}' + typeset -g POWERLEVEL9K_GCLOUD_COMPLETE_CONTENT_EXPANSION='${P9K_GCLOUD_PROJECT_NAME//\%/%%}' + + # Send a request to Google (by means of `gcloud projects describe ...`) to obtain project name + # this often. Negative value disables periodic polling. In this mode project name is retrieved + # only when the current configuration, account or project id changes. + typeset -g POWERLEVEL9K_GCLOUD_REFRESH_PROJECT_NAME_SECONDS=60 + + # Custom icon. + # typeset -g POWERLEVEL9K_GCLOUD_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #[ google_app_cred: google application credentials (https://cloud.google.com/docs/authentication/production) ]# + # Show google_app_cred only when the command you are typing invokes one of these tools. + # Tip: Remove the next line to always show google_app_cred. + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|pulumi|terragrunt' + + # Google application credentials classes for the purpose of using different colors, icons and + # expansions with different credentials. + # + # POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES is an array with even number of elements. The first + # element in each pair defines a pattern against which the current kubernetes context gets + # matched. More specifically, it's P9K_CONTENT prior to the application of context expansion + # (see below) that gets matched. If you unset all POWERLEVEL9K_GOOGLE_APP_CRED_*CONTENT_EXPANSION + # parameters, you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES defines the context class. Patterns are tried in order. + # The first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES=( + # '*:*prod*:*' PROD + # '*:*test*:*' TEST + # '*' DEFAULT) + # + # If your current Google application credentials is "service_account deathray-testing x@y.com", + # its class is TEST because it doesn't match the pattern '* *prod* *' but does match '* *test* *'. + # + # You can define different colors, icons and content expansions for different classes: + # + # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_FOREGROUND=28 + # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_CONTENT_EXPANSION='$P9K_GOOGLE_APP_CRED_PROJECT_ID' + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES=( + # '*:*prod*:*' PROD # These values are examples that are unlikely + # '*:*test*:*' TEST # to match your needs. Customize them as needed. + '*' DEFAULT) + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_FOREGROUND=7 + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_BACKGROUND=4 + # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Use POWERLEVEL9K_GOOGLE_APP_CRED_CONTENT_EXPANSION to specify the content displayed by + # google_app_cred segment. Parameter expansions are very flexible and fast, too. See reference: + # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion. + # + # You can use the following parameters in the expansion. Each of them corresponds to one of the + # fields in the JSON file pointed to by GOOGLE_APPLICATION_CREDENTIALS. + # + # Parameter | JSON key file field + # ---------------------------------+--------------- + # P9K_GOOGLE_APP_CRED_TYPE | type + # P9K_GOOGLE_APP_CRED_PROJECT_ID | project_id + # P9K_GOOGLE_APP_CRED_CLIENT_EMAIL | client_email + # + # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced by '%%'. + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_CONTENT_EXPANSION='${P9K_GOOGLE_APP_CRED_PROJECT_ID//\%/%%}' + + ##############[ toolbox: toolbox name (https://github.com/containers/toolbox) ]############### + # Toolbox color. + typeset -g POWERLEVEL9K_TOOLBOX_FOREGROUND=0 + typeset -g POWERLEVEL9K_TOOLBOX_BACKGROUND=3 + # Don't display the name of the toolbox if it matches fedora-toolbox-*. + typeset -g POWERLEVEL9K_TOOLBOX_CONTENT_EXPANSION='${P9K_TOOLBOX_NAME:#fedora-toolbox-*}' + # Custom icon. + # typeset -g POWERLEVEL9K_TOOLBOX_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Custom prefix. + # typeset -g POWERLEVEL9K_TOOLBOX_PREFIX='in ' + + ###############################[ public_ip: public IP address ]############################### + # Public IP color. + typeset -g POWERLEVEL9K_PUBLIC_IP_FOREGROUND=7 + typeset -g POWERLEVEL9K_PUBLIC_IP_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_PUBLIC_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ########################[ vpn_ip: virtual private network indicator ]######################### + # VPN IP color. + typeset -g POWERLEVEL9K_VPN_IP_FOREGROUND=0 + typeset -g POWERLEVEL9K_VPN_IP_BACKGROUND=6 + # When on VPN, show just an icon without the IP address. + # Tip: To display the private IP address when on VPN, remove the next line. + typeset -g POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION= + # Regular expression for the VPN network interface. Run `ifconfig` or `ip -4 a show` while on VPN + # to see the name of the interface. + typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(gpd|wg|(.*tun)|tailscale)[0-9]*|(zt.*)' + # If set to true, show one segment per matching network interface. If set to false, show only + # one segment corresponding to the first matching network interface. + # Tip: If you set it to true, you'll probably want to unset POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION. + typeset -g POWERLEVEL9K_VPN_IP_SHOW_ALL=false + # Custom icon. + # typeset -g POWERLEVEL9K_VPN_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########[ ip: ip address and bandwidth usage for a specified network interface ]########### + # IP color. + typeset -g POWERLEVEL9K_IP_BACKGROUND=4 + typeset -g POWERLEVEL9K_IP_FOREGROUND=0 + # The following parameters are accessible within the expansion: + # + # Parameter | Meaning + # ----------------------+------------------------------------------- + # P9K_IP_IP | IP address + # P9K_IP_INTERFACE | network interface + # P9K_IP_RX_BYTES | total number of bytes received + # P9K_IP_TX_BYTES | total number of bytes sent + # P9K_IP_RX_BYTES_DELTA | number of bytes received since last prompt + # P9K_IP_TX_BYTES_DELTA | number of bytes sent since last prompt + # P9K_IP_RX_RATE | receive rate (since last prompt) + # P9K_IP_TX_RATE | send rate (since last prompt) + typeset -g POWERLEVEL9K_IP_CONTENT_EXPANSION='${P9K_IP_RX_RATE:+⇣$P9K_IP_RX_RATE }${P9K_IP_TX_RATE:+⇡$P9K_IP_TX_RATE }$P9K_IP_IP' + # Show information for the first network interface whose name matches this regular expression. + # Run `ifconfig` or `ip -4 a show` to see the names of all network interfaces. + typeset -g POWERLEVEL9K_IP_INTERFACE='[ew].*' + # Custom icon. + # typeset -g POWERLEVEL9K_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #########################[ proxy: system-wide http/https/ftp proxy ]########################## + # Proxy color. + typeset -g POWERLEVEL9K_PROXY_FOREGROUND=4 + typeset -g POWERLEVEL9K_PROXY_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_PROXY_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################################[ battery: internal battery ]################################# + # Show battery in red when it's below this level and not connected to power supply. + typeset -g POWERLEVEL9K_BATTERY_LOW_THRESHOLD=20 + typeset -g POWERLEVEL9K_BATTERY_LOW_FOREGROUND=1 + # Show battery in green when it's charging or fully charged. + typeset -g POWERLEVEL9K_BATTERY_{CHARGING,CHARGED}_FOREGROUND=2 + # Show battery in yellow when it's discharging. + typeset -g POWERLEVEL9K_BATTERY_DISCONNECTED_FOREGROUND=3 + # Battery pictograms going from low to high level of charge. + typeset -g POWERLEVEL9K_BATTERY_STAGES='\uf58d\uf579\uf57a\uf57b\uf57c\uf57d\uf57e\uf57f\uf580\uf581\uf578' + # Don't show the remaining time to charge/discharge. + typeset -g POWERLEVEL9K_BATTERY_VERBOSE=false + typeset -g POWERLEVEL9K_BATTERY_BACKGROUND=0 + + #####################################[ wifi: wifi speed ]##################################### + # WiFi color. + typeset -g POWERLEVEL9K_WIFI_FOREGROUND=0 + typeset -g POWERLEVEL9K_WIFI_BACKGROUND=4 + # Custom icon. + # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Use different colors and icons depending on signal strength ($P9K_WIFI_BARS). + # + # # Wifi colors and icons for different signal strength levels (low to high). + # typeset -g my_wifi_fg=(0 0 0 0 0) # <-- change these values + # typeset -g my_wifi_icon=('WiFi' 'WiFi' 'WiFi' 'WiFi' 'WiFi') # <-- change these values + # + # typeset -g POWERLEVEL9K_WIFI_CONTENT_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}$P9K_WIFI_LAST_TX_RATE Mbps' + # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}${my_wifi_icon[P9K_WIFI_BARS+1]}' + # + # The following parameters are accessible within the expansions: + # + # Parameter | Meaning + # ----------------------+--------------- + # P9K_WIFI_SSID | service set identifier, a.k.a. network name + # P9K_WIFI_LINK_AUTH | authentication protocol such as "wpa2-psk" or "none"; empty if unknown + # P9K_WIFI_LAST_TX_RATE | wireless transmit rate in megabits per second + # P9K_WIFI_RSSI | signal strength in dBm, from -120 to 0 + # P9K_WIFI_NOISE | noise in dBm, from -120 to 0 + # P9K_WIFI_BARS | signal strength in bars, from 0 to 4 (derived from P9K_WIFI_RSSI and P9K_WIFI_NOISE) + + ####################################[ time: current time ]#################################### + # Current time color. + typeset -g POWERLEVEL9K_TIME_FOREGROUND=0 + typeset -g POWERLEVEL9K_TIME_BACKGROUND=7 + # Format for the current time: 09:51:02. See `man 3 strftime`. + typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%H:%M:%S}' + # If set to true, time will update when you hit enter. This way prompts for the past + # commands will contain the start times of their commands as opposed to the default + # behavior where they contain the end times of their preceding commands. + typeset -g POWERLEVEL9K_TIME_UPDATE_ON_COMMAND=false + # Custom icon. + # typeset -g POWERLEVEL9K_TIME_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Custom prefix. + # typeset -g POWERLEVEL9K_TIME_PREFIX='at ' + + # Example of a user-defined prompt segment. Function prompt_example will be called on every + # prompt if `example` prompt segment is added to POWERLEVEL9K_LEFT_PROMPT_ELEMENTS or + # POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS. It displays an icon and yellow text on red background + # greeting the user. + # + # Type `p10k help segment` for documentation and a more sophisticated example. + function prompt_example() { + p10k segment -b 1 -f 3 -i '⭐' -t 'hello, %n' + } + + # User-defined prompt segments may optionally provide an instant_prompt_* function. Its job + # is to generate the prompt segment for display in instant prompt. See + # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt. + # + # Powerlevel10k will call instant_prompt_* at the same time as the regular prompt_* function + # and will record all `p10k segment` calls it makes. When displaying instant prompt, Powerlevel10k + # will replay these calls without actually calling instant_prompt_*. It is imperative that + # instant_prompt_* always makes the same `p10k segment` calls regardless of environment. If this + # rule is not observed, the content of instant prompt will be incorrect. + # + # Usually, you should either not define instant_prompt_* or simply call prompt_* from it. If + # instant_prompt_* is not defined for a segment, the segment won't be shown in instant prompt. + function instant_prompt_example() { + # Since prompt_example always makes the same `p10k segment` calls, we can call it from + # instant_prompt_example. This will give us the same `example` prompt segment in the instant + # and regular prompts. + prompt_example + } + + # User-defined prompt segments can be customized the same way as built-in segments. + typeset -g POWERLEVEL9K_EXAMPLE_FOREGROUND=3 + typeset -g POWERLEVEL9K_EXAMPLE_BACKGROUND=1 + # typeset -g POWERLEVEL9K_EXAMPLE_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Transient prompt works similarly to the builtin transient_rprompt option. It trims down prompt + # when accepting a command line. Supported values: + # + # - off: Don't change prompt when accepting a command line. + # - always: Trim down prompt when accepting a command line. + # - same-dir: Trim down prompt when accepting a command line unless this is the first command + # typed after changing current working directory. + typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=always + + # Instant prompt mode. + # + # - off: Disable instant prompt. Choose this if you've tried instant prompt and found + # it incompatible with your zsh configuration files. + # - quiet: Enable instant prompt and don't print warnings when detecting console output + # during zsh initialization. Choose this if you've read and understood + # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt. + # - verbose: Enable instant prompt and print a warning when detecting console output during + # zsh initialization. Choose this if you've never tried instant prompt, haven't + # seen the warning, or if you are unsure what this all means. + typeset -g POWERLEVEL9K_INSTANT_PROMPT=quiet + + # Hot reload allows you to change POWERLEVEL9K options after Powerlevel10k has been initialized. + # For example, you can type POWERLEVEL9K_BACKGROUND=red and see your prompt turn red. Hot reload + # can slow down prompt by 1-2 milliseconds, so it's better to keep it turned off unless you + # really need it. + typeset -g POWERLEVEL9K_DISABLE_HOT_RELOAD=true + + # If p10k is already loaded, reload configuration. + # This works even with POWERLEVEL9K_DISABLE_HOT_RELOAD=true. + (( ! $+functions[p10k] )) || p10k reload +} + +# Tell `p10k configure` which file it should overwrite. +typeset -g POWERLEVEL9K_CONFIG_FILE=${${(%):-%x}:a} + +(( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]} +'builtin' 'unset' 'p10k_config_opts' diff --git a/collections/ansible_collections/nullified/infrastructure/roles/common/templates/home/.pythonrc b/collections/ansible_collections/nullified/infrastructure/roles/common/templates/home/.pythonrc new file mode 100644 index 0000000..18703dc --- /dev/null +++ b/collections/ansible_collections/nullified/infrastructure/roles/common/templates/home/.pythonrc @@ -0,0 +1,7 @@ +try: + import readline +except ImportError: + print("Module readline not available.") +else: + import rlcompleter + readline.parse_and_bind("tab: complete") diff --git a/collections/ansible_collections/nullified/infrastructure/roles/common/templates/home/.zsh_aliases b/collections/ansible_collections/nullified/infrastructure/roles/common/templates/home/.zsh_aliases new file mode 100644 index 0000000..2cf61c8 --- /dev/null +++ b/collections/ansible_collections/nullified/infrastructure/roles/common/templates/home/.zsh_aliases @@ -0,0 +1,34 @@ +# Utilities +alias dig=ydig +alias e="emacs" +alias grep="egrep --color" +alias cpr="rsync -rlptgoDAXhP --info=all0,progress2" +alias rcp="cpr" +alias ll="eza -lahv --color" +alias l="eza -l -g --icons --all --all" +alias ls="eza" +alias xclip="xclip -sel clipboard" +alias git='GIT_COMMITTER_DATE="$(date +%Y-%m-%d) 00:00:00+0000" GIT_AUTHOR_DATE="$(date +%Y-%m-%d) 00:00:00+0000" git' +alias cat=bat +alias less=bat + +# Dev +alias dcl="docker container ls -a --format='{{ .ID }}\t{{ .Names }}\t{{ index (split .Status \" \") 0 }}' | sort -k3r -k2 | column -t -N ID,Name,State" +alias composer80="composerX 8.0" +alias composer81="composerX 8.1" +alias composer82="composerX 8.2" +alias phpqa="phpqa82" +alias phpqa81='docker run --init -it --rm -v "$(pwd):/project" -v "$(pwd)/tmp-phpqa:/tmp" -w /project jakzal/phpqa:php8.1-alpine' +alias phpqa82='docker run --init -it --rm -v "$(pwd):/project" -v "$(pwd)/tmp-phpqa:/tmp" -w /project jakzal/phpqa:php8.2-alpine' + +# DevOps / Admin +alias ssl_scan="docker run -ti --rm drwetter/testssl.sh" +alias tf="tofu" +alias terraform="tofu" +alias ks="kubeshell" + +# Personal +alias awesome_test="Xephyr -screen 1440x1080 :5 & sleep 1 ; DISPLAY=:5 awesome" +alias clean_pa='pkill -U ${USER} pulseaudio; systemctl --user stop pulseaudio.socket && systemctl --user start pulseaudio.socket' +alias ssh_jump="ssh -qTNn" +alias x11_paste='sleep 2; xdotool type "$(xclip -o -selection clipboard)"' diff --git a/collections/ansible_collections/nullified/infrastructure/roles/common/templates/home/.zsh_completions b/collections/ansible_collections/nullified/infrastructure/roles/common/templates/home/.zsh_completions new file mode 100644 index 0000000..ab123b0 --- /dev/null +++ b/collections/ansible_collections/nullified/infrastructure/roles/common/templates/home/.zsh_completions @@ -0,0 +1,21 @@ +# https://github.com/zsh-users/zsh-completions +fpath+=${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions/src + +# shellcheck disable=SC1090 +if command -v ansible &> /dev/null; then + source <(register-python-argcomplete ansible) + source <(register-python-argcomplete ansible-config) + source <(register-python-argcomplete ansible-console) + source <(register-python-argcomplete ansible-doc) + source <(register-python-argcomplete ansible-galaxy) + source <(register-python-argcomplete ansible-inventory) + source <(register-python-argcomplete ansible-playbook) + source <(register-python-argcomplete ansible-pull) + source <(register-python-argcomplete ansible-vault) +fi + +autoload -U compinit && compinit + +command -v boundary &> /dev/null && complete -o nospace -C /usr/bin/boundary boundary || true +command -v molecule &> /dev/null && source <(_MOLECULE_COMPLETE=zsh_source molecule) || true +command -v helm &> /dev/null && source <(helm completion zsh) || true diff --git a/collections/ansible_collections/nullified/infrastructure/roles/common/templates/home/.zsh_exports b/collections/ansible_collections/nullified/infrastructure/roles/common/templates/home/.zsh_exports new file mode 100644 index 0000000..b90f2c1 --- /dev/null +++ b/collections/ansible_collections/nullified/infrastructure/roles/common/templates/home/.zsh_exports @@ -0,0 +1,29 @@ +# Versions +export RUBY_VERSION="3.1" + +# Settings +export DEFAULT_USER=$(id -un) +export EDITOR=emacs +export TERM=xterm-256color +export LESS='-R' +export LESSOPEN='|~/.lessfilter %s' +export DOTNET_CLI_TELEMETRY_OPTOUT=1 +export SSH_KEY_PATH="${HOME}/.ssh/id_ed25519" +export PAGER=less +export GPG_TTY="${TTY}" + +# Dev +[ -d "$HOME/.nvm" ] && export NVM_DIR="$HOME/.nvm" +[ -d "$HOME/.nvm" ] && export NVM_SYMLINK_CURRENT=true +# shellcheck disable=SC1090 +[ -s "$NVM_DIR/nvm.sh" ] && source "$NVM_DIR/nvm.sh" # This loads nvm +[ -d "${HOME}/.local/share/gems/ruby/${RUBY_VERSION}" ] && export GEM_DIR="${HOME}/.local/share/gems/ruby/${RUBY_VERSION}" +[ -d "${HOME}/.cargo/env" ] && source "${HOME}/.cargo/env" + +# Path +export PATH="${PATH}:${HOME}/.local/bin" +[ -d "${HOME}/.nvm/current/bin" ] && export PATH="${PATH}:${HOME}/.nvm/current/bin" +[ -d "${GEM_DIR}/bin" ] && export PATH="${PATH}:${GEM_DIR}/bin" +[ -d "/usr/local/go/bin" ] && export PATH="${PATH}:/usr/local/go/bin" +[ -d "$HOME/.cargo/bin" ] && export PATH="${PATH}:$HOME/.cargo/bin" +[ -d "$HOME/.local/share/JetBrains/Toolbox/scripts" ] && export PATH="${PATH}:$HOME/.local/share/JetBrains/Toolbox/scripts" diff --git a/collections/ansible_collections/nullified/infrastructure/roles/common/templates/home/.zsh_functions b/collections/ansible_collections/nullified/infrastructure/roles/common/templates/home/.zsh_functions new file mode 100644 index 0000000..ea15772 --- /dev/null +++ b/collections/ansible_collections/nullified/infrastructure/roles/common/templates/home/.zsh_functions @@ -0,0 +1,21 @@ +function ydig() { + dig +yaml "${@}" | yq '.[].message.response_message_data|{"answer": .ANSWER_SECTION, status}' +} + +function kubeshell() { + if [ $# -lt 3 ]; then + print "Invalid parameters: kubeshell NAMESPACE CONTAINER POD " + return 1 + fi + + local kubeBinary + local namespace="${1}" + shift + local container="${1}" + shift + local pod="${1}" + shift + + kubeBinary=$(command -v kubectl) + "${kubeBinary}" exec -i -t -n "${namespace}" "${pod}" -c "${container}" "${@}" -- sh -c "clear; (zsh || bash || ash || sh)" +} diff --git a/collections/ansible_collections/nullified/infrastructure/roles/common/templates/home/.zshrc b/collections/ansible_collections/nullified/infrastructure/roles/common/templates/home/.zshrc new file mode 100644 index 0000000..ea8747d --- /dev/null +++ b/collections/ansible_collections/nullified/infrastructure/roles/common/templates/home/.zshrc @@ -0,0 +1,54 @@ +# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. +# Initialization code that may require console input (password prompts, [y/n] +# confirmations, etc.) must go above this block; everything else may go below. +if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then + source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" +fi + +# Path to your oh-my-zsh installation. +export ZSH="${HOME}/.oh-my-zsh" +export TERM="xterm-256color" + +ZSH_THEME="powerlevel10k/powerlevel10k" +CASE_SENSITIVE="true" + +# Uncomment the following line to use hyphen-insensitive completion. +# Case-sensitive completion must be off. _ and - will be interchangeable. +# HYPHEN_INSENSITIVE="true" + +# Uncomment the following line to disable bi-weekly auto-update checks. +# DISABLE_AUTO_UPDATE="true" + +# Uncomment the following line to automatically update without prompting. +# DISABLE_UPDATE_PROMPT="true" + +# Uncomment the following line to change how often to auto-update (in days). +# export UPDATE_ZSH_DAYS=13 + +# Uncomment the following line if pasting URLs and other text is messed up. +# DISABLE_MAGIC_FUNCTIONS=true + +# Uncomment the following line to disable colors in ls. +# DISABLE_LS_COLORS="true" + +# Uncomment the following line to disable auto-setting terminal title. +# DISABLE_AUTO_TITLE="true" + +# Uncomment the following line to enable command auto-correction. +# ENABLE_CORRECTION="true" + +# Uncomment the following line to display red dots whilst waiting for completion. +# COMPLETION_WAITING_DOTS="true" + +HIST_STAMPS="yyyy.mm.dd" + +plugins=(autopep8 aws branch colored-man-pages colorize composer docker docker-compose git kubectl kube-ps1 npm nvm pass pep8 pip redis-cli rsync rust terraform) + +source $ZSH/oh-my-zsh.sh + +[ -f ~/.zsh_exports ] && source ~/.zsh_exports +[ -f ~/.p10k.zsh ] && source ~/.p10k.zsh +[ -f ~/.zsh_functions ] && source ~/.zsh_functions +[ -f ~/.zsh_aliases ] && source ~/.zsh_aliases +[ -f ~/.env ] && source ~/.env +[ -f ~/.zsh_completions ] && source ~/.zsh_completions diff --git a/collections/ansible_collections/nullified/infrastructure/roles/common/templates/system/sysctld.local.conf.j2 b/collections/ansible_collections/nullified/infrastructure/roles/common/templates/system/sysctld.local.conf.j2 new file mode 100644 index 0000000..ef604d9 --- /dev/null +++ b/collections/ansible_collections/nullified/infrastructure/roles/common/templates/system/sysctld.local.conf.j2 @@ -0,0 +1,3 @@ +{% for item in custom_sysctl.keys() -%} + {{ item }} = {{ custom_sysctl[item] }} +{% endfor %} diff --git a/collections/ansible_collections/nullified/infrastructure/roles/development/defaults/main.yml b/collections/ansible_collections/nullified/infrastructure/roles/development/defaults/main.yml index c7895dc..7fac3ca 100644 --- a/collections/ansible_collections/nullified/infrastructure/roles/development/defaults/main.yml +++ b/collections/ansible_collections/nullified/infrastructure/roles/development/defaults/main.yml @@ -1,2 +1,4 @@ --- custom_github_token: "" +development_docker_remap_user: "{{ custom_base_user_account }}" +development_docker_remap_group: "{{ custom_base_user_account }}" \ No newline at end of file diff --git a/collections/ansible_collections/nullified/infrastructure/roles/development/handlers/main.yml b/collections/ansible_collections/nullified/infrastructure/roles/development/handlers/main.yml index 109321f..5da424f 100644 --- a/collections/ansible_collections/nullified/infrastructure/roles/development/handlers/main.yml +++ b/collections/ansible_collections/nullified/infrastructure/roles/development/handlers/main.yml @@ -1,2 +1,7 @@ --- -# handlers file for development +- name: '[docker] restart service' + become: true + ansible.builtin.systemd_service: + name: docker + enabled: true + state: restarted diff --git a/collections/ansible_collections/nullified/infrastructure/roles/development/tasks/main.yml b/collections/ansible_collections/nullified/infrastructure/roles/development/tasks/main.yml index 0c626dc..0c45f5c 100644 --- a/collections/ansible_collections/nullified/infrastructure/roles/development/tasks/main.yml +++ b/collections/ansible_collections/nullified/infrastructure/roles/development/tasks/main.yml @@ -1,140 +1,230 @@ --- -- name: '[APT] install dependencies and tools' +- name: '[setup] gather facts if not already done' + setup: + gather_subset: + - distribution + - distribution_release + +- name: '[home] get user account information' + ansible.builtin.getent: + database: passwd + key: "{{ custom_base_user_account }}" + split: ":" + changed_when: false + when: getent_passwd is undefined or custom_base_user_account not in getent_passwd + +- name: '[apt] install dependencies and tools' become: true ansible.builtin.apt: update_cache: true force_apt_get: true cache_valid_time: 3600 pkg: + - apt-transport-https # docker-ce - autoconf + - automake - bc + - build-essential - ca-certificates # docker-ce - curl - g++ - gcc - git - - gnupg # docker-ce + - git-lfs + - gnupg2 # docker-ce - jq - libasound2 # draw.io - libatspi2.0-0 # draw.io + - libcairo2 + - libcairo2-dev + - libcurl4-openssl-dev + - libffi-dev - libgtk-3-0 # draw.io - libnotify4 # draw.io - libnss3 # draw.io - libsecret-1-0 # draw.io + - libssl-dev + - libtool - libxss1 # draw.io - libxtst6 # draw.io - make + - mariadb-client + - pipx + - postgresql-client + - python3-dev + - python3-pip + - python3-virtualenv - shellcheck + - sqlite3 - valgrind - xdg-utils # draw.io state: present -- name: '[GitHub] install tools' +- name: '[github] install tools' become: true - tags: - - molecule-idempotence-notest nullified.infrastructure.github_artifact: github_token: '{{ custom_github_token }}' - artifacts: - - asset_name: dive_{version}_linux_amd64.deb - asset_type: release - repository: wagoodman/dive - cmds: - - dpkg -i {asset_dirname}/{asset_filename} - - asset_name: kubeconform-linux-amd64.tar.gz - asset_type: release - repository: yannh/kubeconform - cmds: - - tar -zxf {asset_dirname}/{asset_filename} - - install --group=root --mode=755 --owner=root kubeconform /usr/local/bin - - asset_name: git-delta_{version}_amd64.deb - asset_type: release - repository: dandavison/delta - cmds: - - dpkg -i {asset_dirname}/{asset_filename} - - asset_name: docker-compose-linux-x86_64 - asset_type: release - repository: docker/compose - cmds: - - install --group=root --mode=755 --owner=root {asset_dirname}/{asset_filename} /usr/local/bin/docker-compose - - test -d /usr/local/lib/docker/cli-plugins && (rm /usr/local/lib/docker/cli-plugins/docker-compose; ln -s /usr/local/bin/docker-compose /usr/local/lib/docker/cli-plugins) || true - - test -d /usr/local/libexec/docker/cli-plugins && (rm /usr/local/libexec/docker/cli-plugins/docker-compose; ln -s /usr/local/bin/docker-compose /usr/local/libexec/docker/cli-plugins) || true - - test -d /usr/lib/docker/cli-plugins && (rm /usr/lib/docker/cli-plugins/docker-compose; ln -s /usr/local/bin/docker-compose /usr/lib/docker/cli-plugins) || true - - test -d /usr/libexec/docker/cli-plugins && (rm /usr/libexec/docker/cli-plugins/docker-compose; ln -s /usr/local/bin/docker-compose /usr/libexec/docker/cli-plugins) || true - - asset_name: buildx-{version}.linux-amd64 - asset_type: release - repository: docker/buildx - cmds: - - install --group=root --mode=755 --owner=root {asset_dirname}/{asset_filename} /usr/local/bin/docker-buildx - - test -d /usr/local/lib/docker/cli-plugins && (rm /usr/local/lib/docker/cli-plugins/docker-compose; ln -s /usr/local/bin/docker-compose /usr/local/lib/docker/cli-plugins) || true - - test -d /usr/local/libexec/docker/cli-plugins && (rm /usr/local/libexec/docker/cli-plugins/docker-compose; ln -s /usr/local/bin/docker-compose /usr/local/libexec/docker/cli-plugins) || true - - test -d /usr/lib/docker/cli-plugins && (rm /usr/lib/docker/cli-plugins/docker-compose; ln -s /usr/local/bin/docker-compose /usr/lib/docker/cli-plugins) || true - - test -d /usr/libexec/docker/cli-plugins && (rm /usr/libexec/docker/cli-plugins/docker-compose; ln -s /usr/local/bin/docker-compose /usr/libexec/docker/cli-plugins) || true - - asset_name: drawio-amd64-{version}.deb - asset_type: release - repository: jgraph/drawio-desktop - cmds: - - dpkg -i {asset_dirname}/{asset_filename} - - asset_name: OpenLens-{version}.amd64.deb - asset_type: release - repository: MuhammedKalkan/OpenLens - cmds: - - dpkg -i {asset_dirname}/{asset_filename} - - asset_name: stern_{version}_linux_amd64.tar.gz - asset_type: release - repository: stern/stern - cmds: - - tar -zxf {asset_dirname}/{asset_filename} - - install --group=root --mode=755 --owner=root stern /usr/local/bin - - asset_name: tofu_{version}_amd64.deb - asset_type: release - repository: opentofu/opentofu - cmds: - - dpkg -i {asset_dirname}/{asset_filename} + asset_name: "{{ item.asset_name | default('') }}" + asset_type: "{{ item.asset_type }}" + cmds: "{{ item.cmds | default([]) }}" + creates: "{{ item.creates | default('') }}" + repository: "{{ item.repository }}" + version: "{{ item.version | default('') }}" + loop: + - asset_name: kind-linux-amd64 + asset_type: release + repository: kubernetes-sigs/kind + creates: /usr/local/bin/kind + cmds: + - install --group=root --owner=root --mode=755 {asset_dirname}/{asset_filename} /usr/local/bin/kind + - rm {asset_dirname}/{asset_filename} + - asset_name: dive_{version}_linux_amd64.deb + asset_type: release + repository: wagoodman/dive + creates: /usr/bin/dive + cmds: + - dpkg -i {asset_dirname}/{asset_filename} + - asset_name: kubeconform-linux-amd64.tar.gz + asset_type: release + repository: yannh/kubeconform + creates: /usr/local/bin/kubeconform + cmds: + - tar -zxf {asset_dirname}/{asset_filename} + - install --group=root --mode=755 --owner=root kubeconform /usr/local/bin + - asset_name: git-delta_{version}_amd64.deb + asset_type: release + repository: dandavison/delta + creates: /usr/bin/delta + cmds: + - dpkg -i {asset_dirname}/{asset_filename} + - asset_name: docker-compose-linux-x86_64 + asset_type: release + repository: docker/compose + creates: /usr/local/bin/docker-compose + cmds: + - install --group=root --mode=755 --owner=root {asset_dirname}/{asset_filename} /usr/local/bin/docker-compose + - test -d /usr/local/lib/docker/cli-plugins && (rm /usr/local/lib/docker/cli-plugins/docker-compose; ln -s /usr/local/bin/docker-compose /usr/local/lib/docker/cli-plugins) || true + - test -d /usr/local/libexec/docker/cli-plugins && (rm /usr/local/libexec/docker/cli-plugins/docker-compose; ln -s /usr/local/bin/docker-compose /usr/local/libexec/docker/cli-plugins) || true + - test -d /usr/lib/docker/cli-plugins && (rm /usr/lib/docker/cli-plugins/docker-compose; ln -s /usr/local/bin/docker-compose /usr/lib/docker/cli-plugins) || true + - test -d /usr/libexec/docker/cli-plugins && (rm /usr/libexec/docker/cli-plugins/docker-compose; ln -s /usr/local/bin/docker-compose /usr/libexec/docker/cli-plugins) || true + - asset_name: buildx-{version}.linux-amd64 + asset_type: release + repository: docker/buildx + creates: /usr/local/bin/docker-buildx + cmds: + - install --group=root --mode=755 --owner=root {asset_dirname}/{asset_filename} /usr/local/bin/docker-buildx + - test -d /usr/local/lib/docker/cli-plugins && (rm /usr/local/lib/docker/cli-plugins/docker-compose; ln -s /usr/local/bin/docker-compose /usr/local/lib/docker/cli-plugins) || true + - test -d /usr/local/libexec/docker/cli-plugins && (rm /usr/local/libexec/docker/cli-plugins/docker-compose; ln -s /usr/local/bin/docker-compose /usr/local/libexec/docker/cli-plugins) || true + - test -d /usr/lib/docker/cli-plugins && (rm /usr/lib/docker/cli-plugins/docker-compose; ln -s /usr/local/bin/docker-compose /usr/lib/docker/cli-plugins) || true + - test -d /usr/libexec/docker/cli-plugins && (rm /usr/libexec/docker/cli-plugins/docker-compose; ln -s /usr/local/bin/docker-compose /usr/libexec/docker/cli-plugins) || true + - asset_name: drawio-amd64-{version}.deb + asset_type: release + repository: jgraph/drawio-desktop + creates: /usr/bin/drawio + cmds: + - dpkg -i {asset_dirname}/{asset_filename} + - asset_name: OpenLens-{version}.amd64.deb + asset_type: release + repository: MuhammedKalkan/OpenLens + creates: /usr/bin/open-lens + cmds: + - dpkg -i {asset_dirname}/{asset_filename} + - asset_name: stern_{version}_linux_amd64.tar.gz + asset_type: release + repository: stern/stern + creates: /usr/local/bin/stern + cmds: + - tar -zxf {asset_dirname}/{asset_filename} + - install --group=root --mode=755 --owner=root stern /usr/local/bin + - asset_name: tofu_{version}_amd64.deb + asset_type: release + repository: opentofu/opentofu + creates: /usr/bin/tofu + cmds: + - dpkg -i {asset_dirname}/{asset_filename} -- name: '[Custom] install latest kubectl' - become: yes - tags: - - molecule-idempotence-notest - ansible.builtin.shell: | - kubeVersion=$(curl -sSL -f https://storage.googleapis.com/kubernetes-release/release/stable.txt 2> /dev/null) - kubeVersion=${kubeVersion:-v1.28.2} - curl --silent --compressed -L -XGET https://storage.googleapis.com/kubernetes-release/release/${kubeVersion}/bin/linux/amd64/kubectl -o kubectl - install --group=root --mode=755 --owner=root kubectl /usr/local/bin && rm kubectl +- name: '[custom] install latest kubectl' + become: true + block: + - name: '[kubectl] find latest version available' + ansible.builtin.command: + cmd: curl -L -s https://dl.k8s.io/release/stable.txt + register: latest_kube_version + changed_when: false -- name: '[Custom] install latest Helm' - become: yes - tags: - - molecule-idempotence-notest - ansible.builtin.shell: | - helmVersion=$(curl -sSL https://api.github.com/repos/helm/helm/releases/latest | jq -r '.tag_name') - helmVersion=${helmVersion:-v3.13.0} - curl --silent --compressed -L -XGET https://get.helm.sh/helm-${helmVersion}-linux-amd64.tar.gz -o helm.tar.gz - tar -zxf helm.tar.gz - install --group=root --mode=755 --owner=root linux-amd64/helm /usr/local/bin && rm -rf linux-amd64 helm.tar.gz + - name: '[kubectl] fetch binary' + ansible.builtin.get_url: + url: "https://dl.k8s.io/release/{{ latest_kube_version.stdout }}/bin/linux/amd64/kubectl" + dest: /usr/local/bin/kubectl + owner: root + group: root + mode: '0755' + +- name: '[custom] install latest Helm' + become: true + block: + - name: '[helm] find latest version available' + ansible.builtin.shell: |- + curl -sSL https://api.github.com/repos/helm/helm/releases/latest | jq -r '.tag_name' + register: latest_helm_version + changed_when: false + + - name: '[helm] find if binary is already installed' + ansible.builtin.file: + path: /usr/local/bin/helm + register: helm_stat + changed_when: false + failed_when: false + + - name: '[helm] setup temp directory' + ansible.builtin.file: + path: /tmp/helm-unarchive + state: directory + owner: root + group: root + mode: '0700' + when: helm_stat.state is match("absent") + + - name: '[helm] fetch archive' + ansible.builtin.unarchive: + remote_src: true + src: "https://get.helm.sh/helm-{{ latest_helm_version.stdout }}-linux-amd64.tar.gz" + dest: /tmp/helm-unarchive + when: helm_stat.state is match("absent") + + - name: '[helm] install binary' + ansible.builtin.copy: + remote_src: true + src: /tmp/helm-unarchive/linux-amd64/helm + dest: /usr/local/bin/helm + owner: root + group: root + mode: '0755' + when: helm_stat.state is match("absent") + + - name: '[helm] cleanup' + ansible.builtin.file: + path: /tmp/helm-unarchive + state: absent + when: helm_stat.state is match("absent") - name: '[custom] install Docker CE repository' + become: true block: - - name: '[apt key] retrieve GPG key' - tags: - - molecule-idempotence-notest - ansible.builtin.shell: |- - curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg - chmod a+r /etc/apt/keyrings/docker.gpg + - name: '[apt key] add docker key' + ansible.builtin.get_url: + url: "https://download.docker.com/linux/{{ ansible_distribution | lower }}/gpg" + dest: /etc/apt/trusted.gpg.d/docker.asc + mode: '0644' - name: '[apt key] add source' ansible.builtin.apt_repository: - repo: "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian {{ ansible_distribution_release }} stable" + repo: "deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/docker.asc] https://download.docker.com/linux/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} stable" state: present - - - name: '[Apt Key] refresh repository' - ansible.builtin.apt: + filename: docker update_cache: true - force_apt_get: true - cache_valid_time: 0 - - name: '[Apt] install Docker CE' - become: yes + - name: '[apt] install Docker CE' ansible.builtin.apt: update_cache: true force_apt_get: true @@ -143,4 +233,97 @@ - docker-ce - docker-ce-cli - containerd.io - state: present \ No newline at end of file + state: present + + - name: '[docker] update daemon configuration' + ansible.builtin.template: + src: ../templates/docker-ce/daemon.json.j2 + dest: /etc/docker/daemon.json + mode: '0644' + notify: + - 'development : [docker] restart service' + + - name: '[docker] add default user to docker group' + ansible.builtin.user: + name: "{{ development_docker_remap_user }}" + append: true + groups: docker + state: present + notify: + - 'development : [docker] restart service' + +- name: '[python] install tools' + become: true + become_user: "{{ custom_base_user_account }}" + ansible.builtin.command: + cmd: "pipx install {{ item.cmd }}" + creates: "{{ getent_passwd[custom_base_user_account][4] }}/.local/bin/{{ item.creates }}" + loop: + - { "cmd": "black", "creates": "black" } + - { "cmd": "flake8", "creates": "flake8" } + +- name: '[python] install pipx packages dependencies' + become: true + become_user: "{{ custom_base_user_account }}" + ansible.builtin.command: + cmd: "pipx inject {{ item.venv }} {{ item.extension }}" + creates: + "{{ getent_passwd[custom_base_user_account][4] }}/.local/pipx/venvs/{{ item.venv }}/lib/python3.11/site-packages/{{ item.creates }}" + loop: + - venv: "flake8" + extension: "flake8-annotations-complexity" + creates: "flake8_annotations_complexity" + - venv: "flake8" + extension: "flake8-bandit" + creates: "flake8_bandit.py" + - venv: "flake8" + extension: "flake8-breakpoint" + creates: "flake8_breakpoint" + - venv: "flake8" + extension: "flake8-bugbear" + creates: "bugbear.py" + - venv: "flake8" + extension: "flake8-builtins" + creates: "flake8_builtins.py" + - venv: "flake8" + extension: "flake8-comprehensions" + creates: "flake8_comprehensions" + - venv: "flake8" + extension: "flake8-docstrings" + creates: "flake8_docstrings.py" + - venv: "flake8" + extension: "flake8-eradicate" + creates: "flake8_eradicate.py" + - venv: "flake8" + extension: "flake8-expression-complexity" + creates: "flake8_expression_complexity" + - venv: "flake8" + extension: "flake8-if-expr" + creates: "flake8_if_expr" + - venv: "flake8" + extension: "flake8-isort" + creates: "flake8_isort.py" + - venv: "flake8" + extension: "flake8-logging-format" + creates: "logging_format" + - venv: "flake8" + extension: "flake8-print" + creates: "flake8_print.py" + - venv: "flake8" + extension: "flake8-pytest" + creates: "flake8_pytest.py" + - venv: "flake8" + extension: "flake8-pytest-style" + creates: "flake8_pytest_style" + - venv: "flake8" + extension: "flake8-requirements" + creates: "flake8_requirements" + - venv: "flake8" + extension: "flake8-return" + creates: "flake8_return" + - venv: "flake8" + extension: "flake8-rst-docstrings" + creates: "flake8_rst_docstrings.py" + - venv: "flake8" + extension: "pep8-naming" + creates: "pep8ext_naming.py" diff --git a/collections/ansible_collections/nullified/infrastructure/roles/development/templates/docker-ce/daemon.json.j2 b/collections/ansible_collections/nullified/infrastructure/roles/development/templates/docker-ce/daemon.json.j2 new file mode 100644 index 0000000..760d97b --- /dev/null +++ b/collections/ansible_collections/nullified/infrastructure/roles/development/templates/docker-ce/daemon.json.j2 @@ -0,0 +1,4 @@ +{ + "userns-remap": "{{ development_docker_remap_user }}:{{ development_docker_remap_group }}", + "cgroup-parent": "{{ development_docker_systemd_slice }}" +} diff --git a/collections/ansible_collections/nullified/infrastructure/roles/development/vars/main.yml b/collections/ansible_collections/nullified/infrastructure/roles/development/vars/main.yml index 4e56a97..2fe0594 100644 --- a/collections/ansible_collections/nullified/infrastructure/roles/development/vars/main.yml +++ b/collections/ansible_collections/nullified/infrastructure/roles/development/vars/main.yml @@ -1,2 +1,2 @@ --- -# vars file for development +development_docker_systemd_slice: docker.slice diff --git a/collections/ansible_collections/nullified/infrastructure/roles/gaming/defaults/main.yml b/collections/ansible_collections/nullified/infrastructure/roles/gaming/defaults/main.yml new file mode 100644 index 0000000..c7895dc --- /dev/null +++ b/collections/ansible_collections/nullified/infrastructure/roles/gaming/defaults/main.yml @@ -0,0 +1,2 @@ +--- +custom_github_token: "" diff --git a/collections/ansible_collections/nullified/infrastructure/roles/gaming/handlers/main.yml b/collections/ansible_collections/nullified/infrastructure/roles/gaming/handlers/main.yml new file mode 100644 index 0000000..ed97d53 --- /dev/null +++ b/collections/ansible_collections/nullified/infrastructure/roles/gaming/handlers/main.yml @@ -0,0 +1 @@ +--- diff --git a/collections/ansible_collections/nullified/infrastructure/roles/gaming/meta/main.yml b/collections/ansible_collections/nullified/infrastructure/roles/gaming/meta/main.yml new file mode 100644 index 0000000..7e2c5ad --- /dev/null +++ b/collections/ansible_collections/nullified/infrastructure/roles/gaming/meta/main.yml @@ -0,0 +1,21 @@ +--- +galaxy_info: + author: Florian L. + namespace: nullified + description: Install games and gaming related software + # issue_tracker_url: http://example.com/issue/tracker + license: MIT + min_ansible_version: 2.15 + + # https://galaxy.ansible.com/api/v1/platforms/ + platforms: + - name: Debian + versions: + - bookworm + + galaxy_tags: + - github + - steam + - games + +dependencies: [] diff --git a/collections/ansible_collections/nullified/infrastructure/roles/gaming/tasks/main.yml b/collections/ansible_collections/nullified/infrastructure/roles/gaming/tasks/main.yml new file mode 100644 index 0000000..b4a9559 --- /dev/null +++ b/collections/ansible_collections/nullified/infrastructure/roles/gaming/tasks/main.yml @@ -0,0 +1,56 @@ +--- +- name: '[games] install Steam' + become: true + block: + - name: '[system] get existing architectures' + ansible.builtin.command: + cmd: dpkg --print-foreign-architectures + register: dpkg_archs + changed_when: false + when: dpkg_archs is not defined + + - name: '[steam] enable i386 architecture' + command: + cmd: dpkg --add-architecture i386 + when: dpkg_archs.stdout is not regex("(^|\b)i386($|\b)", multiline = true) + + - name: '[apt key] add Steam GPG key' + ansible.builtin.get_url: + url: "https://repo.steampowered.com/steam/archive/stable/steam.gpg" + dest: /usr/share/keyrings/steam.gpg + mode: '0644' + + - name: '[apt key] add source' + apt_repository: + repo: "{{ item }} [arch=amd64,i386 signed-by=/usr/share/keyrings/steam.gpg] https://repo.steampowered.com/steam/ stable steam" + state: present + filename: steam + update_cache: true + loop: + - deb + - deb-src + + - name: '[steam] install dependencies' + ansible.builtin.apt: + update_cache: true + force_apt_get: true + cache_valid_time: 3600 + pkg: + - libgl1-mesa-dri:amd64 + - libgl1-mesa-dri:i386 + - libgl1-mesa-glx:amd64 + - libgl1-mesa-glx:i386 + - steam-launcher + +- name: '[games] install Heroic Games Launcher' + become: true + block: + - name: '[hgl] fetch assets from github' + nullified.infrastructure.github_artifact: + github_token: '{{ custom_github_token }}' + asset_name: heroic_{version}_amd64.deb + asset_type: release + repository: Heroic-Games-Launcher/HeroicGamesLauncher + creates: /usr/bin/heroic + cmds: + - dpkg -i {asset_dirname}/{asset_filename} diff --git a/collections/ansible_collections/nullified/infrastructure/roles/gaming/tests/inventory b/collections/ansible_collections/nullified/infrastructure/roles/gaming/tests/inventory new file mode 100644 index 0000000..878877b --- /dev/null +++ b/collections/ansible_collections/nullified/infrastructure/roles/gaming/tests/inventory @@ -0,0 +1,2 @@ +localhost + diff --git a/collections/ansible_collections/nullified/infrastructure/roles/gaming/vars/main.yml b/collections/ansible_collections/nullified/infrastructure/roles/gaming/vars/main.yml new file mode 100644 index 0000000..ed97d53 --- /dev/null +++ b/collections/ansible_collections/nullified/infrastructure/roles/gaming/vars/main.yml @@ -0,0 +1 @@ +--- diff --git a/collections/ansible_collections/nullified/infrastructure/roles/security/handlers/main.yml b/collections/ansible_collections/nullified/infrastructure/roles/security/handlers/main.yml index bd46bcf..31efc18 100644 --- a/collections/ansible_collections/nullified/infrastructure/roles/security/handlers/main.yml +++ b/collections/ansible_collections/nullified/infrastructure/roles/security/handlers/main.yml @@ -1,27 +1,32 @@ --- - name: '[ssh] restart service' + become: true ansible.builtin.systemd_service: name: sshd.service enabled: true state: restarted - name: '[clamav] daemon reload' + become: true ansible.builtin.systemd_service: daemon_reload: true - name: '[freshclam] restart service' + become: true ansible.builtin.systemd_service: name: sshd.service enabled: true state: restarted - name: '[clamd] wait for signatures' + become: true ansible.builtin.wait_for: path: /var/lib/clamav/bytecode.cvd timeout: 600 state: present - name: '[clamd] restart service' + become: true ansible.builtin.systemd_service: name: sshd.service enabled: true diff --git a/collections/ansible_collections/nullified/infrastructure/roles/security/tasks/main.yml b/collections/ansible_collections/nullified/infrastructure/roles/security/tasks/main.yml index 6c329c1..f5f672b 100644 --- a/collections/ansible_collections/nullified/infrastructure/roles/security/tasks/main.yml +++ b/collections/ansible_collections/nullified/infrastructure/roles/security/tasks/main.yml @@ -1,29 +1,36 @@ --- -- name: '[setup] gather facts is not already done' +- name: '[setup] gather facts if not already done' setup: gather_subset: - distribution - name: '[ssh] hardening sshd' - become: yes + become: true block: - name: '[ssh] setup sshd_config' ansible.builtin.template: src: ../templates/openssh-server/sshd_config.j2 dest: /etc/ssh/sshd_config - mode: 644 - notify: - - '[ssh] restart service' + mode: '0644' - name: '[ssh] setup sshd_config.d' ansible.builtin.template: src: ../templates/openssh-server/sshd_config.d/encryption.conf.j2 dest: /etc/ssh/sshd_config.d/encryption.conf - mode: 644 - notify: - - 'security : [ssh] restart service' + mode: '0644' + - name: '[ssh] remove low security keys' + ansible.builtin.file: + path: "/etc/ssh/{{ item }}" + state: absent + loop: + - ssh_host_ecdsa_key + - ssh_host_ecdsa_key.pub + - ssh_host_rsa_key + - ssh_host_rsa_key.pub + notify: + - 'security : [ssh] restart service' - name: '[utils] install security and audit tools' - become: yes + become: true ansible.builtin.apt: update_cache: true force_apt_get: true @@ -35,7 +42,7 @@ state: present - name: '[system] configure rkhunter' - become: yes + become: true block: - name: '[rkhunter] create include dir' ansible.builtin.file: @@ -57,7 +64,7 @@ state: present - name: '[system] clamav' - become: yes + become: true block: - name: '[clamav] retrieve and install clamav package' ansible.builtin.apt: @@ -80,35 +87,16 @@ system: true state: present - name: '[clamav] setup directories' - block: - - name: '[clamav] ensure /etc/clamav dir exists' - ansible.builtin.file: - path: /etc/clamav - state: directory - owner: clamav - group: clamav - mode: '0750' - - name: '[clamav] ensure /var/lib/clamav dir exists' - ansible.builtin.file: - path: /var/lib/clamav - state: directory - owner: clamav - group: clamav - mode: '0750' - - name: '[clamav] ensure /var/lib/clamav/quarantine dir exists' - ansible.builtin.file: - path: /var/lib/clamav/quarantine - state: directory - owner: clamav - group: clamav - mode: '0750' - - name: '[clamav] ensure /var/log/clamav dir exists' - ansible.builtin.file: - path: /var/log/clamav - state: directory - owner: clamav - group: clamav - mode: '0750' + ansible.builtin.file: + path: "{{ item }}" + state: directory + owner: clamav + group: clamav + mode: '0750' + loop: + - /etc/clamav + - /var/lib/clamav/quarantine + - /var/log/clamav - name: '[clamav] copy clamd.conf' ansible.builtin.template: src: '../templates/clamav/clamd.conf.j2' @@ -123,20 +111,16 @@ owner: clamav group: clamav mode: '0640' - - name: '[clamav] setup freshclam service' - block: - - name: '[clamav] copy freshclam service file' - ansible.builtin.template: - src: '../templates/clamav/clamav-freshclam.service.j2' - dest: /usr/lib/systemd/system/clamav-freshclam.service - mode: '0644' - - name: '[clamav] setup clamd service' - block: - - name: '[clamav] copy clamd service file' - ansible.builtin.template: - src: '../templates/clamav/clamav-clamd.service.j2' - dest: /usr/lib/systemd/system/clamav-clamd.service - mode: '0644' + - name: '[clamav] copy freshclam service file' + ansible.builtin.template: + src: '../templates/clamav/clamav-freshclam.service.j2' + dest: /usr/lib/systemd/system/clamav-freshclam.service + mode: '0644' + - name: '[clamav] copy clamd service file' + ansible.builtin.template: + src: '../templates/clamav/clamav-clamd.service.j2' + dest: /usr/lib/systemd/system/clamav-clamd.service + mode: '0644' - name: '[clamav] setup cron job' ansible.builtin.cron: name: clamav full system scan @@ -152,7 +136,7 @@ - 'security : [clamd] restart service' - name: '[system] hardening system' - become: yes + become: true block: - name: '[system] login.defs' ansible.builtin.template: diff --git a/collections/ansible_collections/nullified/infrastructure/roles/workstation/defaults/main.yml b/collections/ansible_collections/nullified/infrastructure/roles/workstation/defaults/main.yml index ec52023..8a65997 100644 --- a/collections/ansible_collections/nullified/infrastructure/roles/workstation/defaults/main.yml +++ b/collections/ansible_collections/nullified/infrastructure/roles/workstation/defaults/main.yml @@ -1,2 +1,4 @@ --- -custom_base_user_account: "root" +workstation_user_account: "{{ custom_base_user_account }}" +custom_github_token: "" +custom_sysctl: {} diff --git a/collections/ansible_collections/nullified/infrastructure/roles/workstation/handlers/main.yml b/collections/ansible_collections/nullified/infrastructure/roles/workstation/handlers/main.yml index 109321f..ed97d53 100644 --- a/collections/ansible_collections/nullified/infrastructure/roles/workstation/handlers/main.yml +++ b/collections/ansible_collections/nullified/infrastructure/roles/workstation/handlers/main.yml @@ -1,2 +1 @@ --- -# handlers file for development diff --git a/collections/ansible_collections/nullified/infrastructure/roles/workstation/tasks/main.yml b/collections/ansible_collections/nullified/infrastructure/roles/workstation/tasks/main.yml index 6f3ed96..448c0ea 100644 --- a/collections/ansible_collections/nullified/infrastructure/roles/workstation/tasks/main.yml +++ b/collections/ansible_collections/nullified/infrastructure/roles/workstation/tasks/main.yml @@ -1,25 +1,181 @@ --- -- name: '[APT] install dependencies and tools' - become: yes +- name: '[home] get user account information' + ansible.builtin.getent: + database: passwd + key: "{{ workstation_user_account }}" + split: ":" + changed_when: false + when: getent_passwd is undefined or workstation_user_account not in getent_passwd + +- name: '[apt] install dependencies and tools' + become: true ansible.builtin.apt: update_cache: true force_apt_get: true cache_valid_time: 3600 pkg: - curl + - dbus-x11 # terminator + - diffpdf + - feh + - ffmpeg - flatpak - - gnupg + - gettext # terminator + - gir1.2-keybinder-3.0 # terminator + - gir1.2-vte-2.91 # terminator + - gnupg2 + - gvfs-backends + - intltool # terminator + - mpc + - mpd + - ncmpcpp + - numlockx + - openssh-server + - pass + - poppler-utils - pwgen + - python3-configobj # terminator + - python3-gi # terminator + - python3-gi-cairo # terminator + - python3-pip + - python3-psutil # terminator + - ruby + - scrot + - smbclient + - socat + - sshfs + - suckless-tools - sudo + - unclutter-xfixes + - vlc + - wireshark + - xdotool + - xsel + - xserver-xephyr state: present -- name: '[Setup] setup Flatpak' - become: yes - become_user: "{{ custom_base_user_account }}" - become_method: su - tags: - - molecule-idempotence-notest - ansible.builtin.shell: | - flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo - flatpak install --noninteractive flathub com.discordapp.Discord - flatpak install --noninteractive flathub md.obsidian.Obsidian +- name: '[setup] add user to sudo group' + become: true + ansible.builtin.user: + name: "{{ workstation_user_account }}" + groups: + - sudo + append: true + +- name: '[setup] setup Flatpak' + become: true + become_user: "{{ workstation_user_account }}" + block: + - name: '[flatpak] add flatpak repos' + command: + cmd: flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo + changed_when: false + - name: '[flatpak] install flatpak apps' + command: + cmd: "flatpak install --noninteractive {{ item.repo }} {{ item.app }}" + creates: "{{ getent_passwd[workstation_user_account][4] }}/.var/app/{{ item.app }}" + loop: + - repo: flathub + app: com.discordapp.Discord + - repo: flathub + app: md.obsidian.Obsidian + +- name: '[github] install tools' + become: true + nullified.infrastructure.github_artifact: + github_token: '{{ custom_github_token }}' + asset_name: "{{ item.asset_name | default('') }}" + asset_type: "{{ item.asset_type }}" + cmds: "{{ item.cmds | default([]) }}" + creates: "{{ item.creates | default('') }}" + repository: "{{ item.repository }}" + version: "{{ item.version | default('') }}" + loop: + - asset_name: terminator-{version}.tar.gz + asset_type: release + repository: gnome-terminator/terminator + creates: /usr/local/bin/terminator + cmds: + - tar -zxf {asset_dirname}/{asset_filename} + - cd $(find . -maxdepth 1 -name terminator\* -type d); python3 setup.py build; python3 setup.py install --single-version-externally-managed --record=install-files.txt + - rm -rf {asset_dirname}/{asset_filename} + +- name: '[ruby] install tools' + become: true + ansible.builtin.command: + cmd: "gem install {{ item.app }}" + creates: "{{ item.creates }}" + loop: + - app: mdless + creates: /usr/local/bin/mdless + +- name: '[system] setup various directories' + become: true + ansible.builtin.file: + path: "{{ item.path }}" + mode: "{{ item.mode | default('0750') }}" + owner: "{{ item.owner | default(workstation_user_account) }}" + group: "{{ item.group | default(workstation_user_account) }}" + state: directory + loop: + - { path: '/opt/git/foss' } + - { path: '/opt/git/perso' } + - { path: '/opt/git/work' } + - { path: '/srv/storage' } + +- name: '[emacs] fetch emacs configuration files' + become: true + become_user: "{{ workstation_user_account }}" + ansible.builtin.git: + repo: "ssh://git@gitlab.0x2a.ninja:4222/naeikindus/emacsd.git" + dest: "{{ getent_passwd[workstation_user_account][4] }}/.emacs.d" + force: false + +- name: '[config] set tools configuration' + become: true + become_user: "{{ workstation_user_account }}" + ansible.builtin.copy: + src: "{{ item.src }}" + dest: "{{ item.dest }}" + mode: "{{ item.mode | default('0640') }}" + loop: + - { src: "../templates/.config/terminator", dest: "{{ getent_passwd[workstation_user_account][4] }}/.config" } + - { src: "../templates/.config/vlc", dest: "{{ getent_passwd[workstation_user_account][4] }}/.config" } + +- name: '[yubico] install authenticator' + become: true + block: + - name: '[yubico] fetch latest authenticator source' + ansible.builtin.get_url: + url: https://developers.yubico.com/yubioath-flutter/Releases/yubico-authenticator-latest-linux.tar.gz + dest: /tmp/yubico-authenticator-latest-linux.tar.gz + mode: '0640' + + - name: '[yubico] prepare target directory' + file: + path: /opt/yubico-authenticator + owner: "{{ workstation_user_account }}" + group: "{{ workstation_user_account }}" + mode: '0750' + state: directory + + - name: '[yubico] extract data' + ansible.builtin.unarchive: + src: /tmp/yubico-authenticator-latest-linux.tar.gz + remote_src: true + dest: /opt/yubico-authenticator + owner: "{{ workstation_user_account }}" + group: "{{ workstation_user_account }}" + creates: /opt/yubico-authenticator/authenticator + + - name: '[yubico] create shell wrapper' + ansible.builtin.template: + src: ../templates/bin_wrapper.sh.j2 + dest: "{{ getent_passwd[workstation_user_account][4] }}/.local/bin/authenticator" + mode: '0750' + owner: "{{ workstation_user_account }}" + group: "{{ workstation_user_account }}" + vars: + application: "/opt/yubico-authenticator/authenticator" + +- include_tasks: window_manager.yml diff --git a/collections/ansible_collections/nullified/infrastructure/roles/workstation/tasks/window_manager.yml b/collections/ansible_collections/nullified/infrastructure/roles/workstation/tasks/window_manager.yml new file mode 100644 index 0000000..b9cdc26 --- /dev/null +++ b/collections/ansible_collections/nullified/infrastructure/roles/workstation/tasks/window_manager.yml @@ -0,0 +1,150 @@ +--- +- name: '[home] get user account information' + ansible.builtin.getent: + database: passwd + key: "{{ workstation_user_account }}" + split: ":" + changed_when: false + when: getent_passwd is undefined or workstation_user_account not in getent_passwd + +- name: '[awesomewm] install dependencies' + become: true + ansible.builtin.apt: + update_cache: true + force_apt_get: true + cache_valid_time: 3600 + pkg: + - asciidoctor + - build-essential + - cmake + - gir1.2-freedesktop + - gir1.2-gdkpixbuf-2.0 + - gir1.2-glib-2.0 + - gir1.2-gtk-3.0 + - gir1.2-pango-1.0 + - imagemagick + - libcairo-gobject2 + - libcairo2-dev + - libdbus-1-dev + - libgdk-pixbuf-2.0-dev + - libgirepository1.0-dev + - libglib2.0-dev + - liblua5.4-dev + - liblua5.4-dev + - librsvg2-dev + - libstartup-notification0-dev + - libx11-dev + - libx11-xcb-dev + - libxcb-cursor-dev + - libxcb-icccm4-dev + - libxcb-keysyms1-dev + - libxcb-randr0-dev + - libxcb-shape0-dev + - libxcb-util0-dev + - libxcb-xfixes0-dev + - libxcb-xinerama0-dev + - libxcb-xkb-dev + - libxcb-xrm-dev + - libxcb-xtest0-dev + - libxcb1-dev + - libxdg-basedir-dev + - libxkbcommon-x11-dev + - libxkbcommon-dev + - lua5.4 + - luajit2 + - menu + - picom + - x11-xserver-utils + - xutils-dev + +- name: '[lua-lgi] install lua-lgi' + block: + - name: '[lua-lgi] fetch source' + become: true + become_user: "{{ workstation_user_account }}" + ansible.builtin.git: + repo: https://github.com/lgi-devs/lgi.git + dest: /opt/git/foss/lua-lgi + force: false + register: repo_clone + failed_when: + - repo_clone.failed + - not 'Local modifications exist in the destination' in repo_clone.msg + + - name: '[lua-lgi] switch from LUA 5.1 to LUA 5.4' + ansible.builtin.replace: + path: /opt/git/foss/lua-lgi/lgi/Makefile + regexp: '5\.1' + replace: '5.4' + + - name: '[lua-lgi] building project' + ansible.builtin.command: + chdir: /opt/git/foss/lua-lgi + cmd: LUA_CFLAGS="-I/usr/include/lua5.4" make all + creates: /opt/git/foss/lua-lgi/lgi/corelgilua51.so + + - name: '[lua-lgi] compile and install' + become: true + ansible.builtin.command: + chdir: /opt/git/foss/lua-lgi + cmd: make install + creates: /usr/local/lib/lua/5.4/lgi/corelgilua51.so + +- name: '[awesomewm] install window manager' + block: + - name: '[awesomewm] fetch source' + become: true + become_user: "{{ workstation_user_account }}" + ansible.builtin.git: + repo: https://github.com/awesomeWM/awesome.git + dest: /opt/git/foss/awesomeWM + force: false + register: repo_clone + failed_when: + - repo_clone.failed + - not 'Local modifications exist in the destination' in repo_clone.msg + + - name: '[awesomewm] building project' + become: true + become_user: "{{ workstation_user_account }}" + ansible.builtin.command: + chdir: /opt/git/foss/awesomeWM + cmd: 'CMAKE_ARGS="-DWITH_DBUS=ON -DLUA_LIBRARY=/usr/lib/x86_64-linux-gnu/liblua5.4.so.0 -DLUA_INCLUDE_DIR=/usr/include/lua5.4" make' + creates: /opt/git/foss/awesomeWM/build + + - name: '[awesomewm] building project' + become: true + ansible.builtin.command: + chdir: /opt/git/foss/awesomeWM + cmd: make install + creates: /usr/local/bin/awesome + +- name: '[awesomewm] setup configuration' + become: true + become_user: "{{ workstation_user_account }}" + block: + - name: '[awesomewm] fetch copycats base' + ansible.builtin.git: + repo: https://github.com/lcpz/awesome-copycats.git + dest: "{{ getent_passwd[workstation_user_account][4] }}/.config/awesome" + depth: 1 + recursive: true + force: false + - name: '[awesomewm] copy customization' + ansible.builtin.copy: + src: ../templates/.config/awesome/ + dest: "{{ getent_passwd[workstation_user_account][4] }}/.config/awesome" + mode: '0640' + +- name: '[home] copy X related configuration' + become: true + block: + - name: '[x11] xorg.conf' + ansible.builtin.copy: + src: ../templates/system/xorg.conf + dest: /etc/X11/xorg.conf + mode: '0640' + - name: '[x11] user .xsession' + ansible.builtin.copy: + src: ../templates/.xsession + dest: "{{ getent_passwd[workstation_user_account][4] }}/.xsession" diff --git a/collections/ansible_collections/nullified/infrastructure/roles/workstation/templates/.config/awesome/background.png b/collections/ansible_collections/nullified/infrastructure/roles/workstation/templates/.config/awesome/background.png new file mode 100644 index 0000000..4ee1a4e --- /dev/null +++ b/collections/ansible_collections/nullified/infrastructure/roles/workstation/templates/.config/awesome/background.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:943a995eaf53db79e74646538229ea458281236cdd9822352415d2d65b81a6da +size 7066800 diff --git a/collections/ansible_collections/nullified/infrastructure/roles/workstation/templates/.config/awesome/battery.lua b/collections/ansible_collections/nullified/infrastructure/roles/workstation/templates/.config/awesome/battery.lua new file mode 100644 index 0000000..2d45e17 --- /dev/null +++ b/collections/ansible_collections/nullified/infrastructure/roles/workstation/templates/.config/awesome/battery.lua @@ -0,0 +1,138 @@ +------------------------------------------------- +-- Battery Widget for Awesome Window Manager +-- Shows the battery status using the ACPI tool +-- More details could be found here: +-- https://github.com/streetturtle/awesome-wm-widgets/tree/master/battery-widget + +-- @author Pavel Makhov +-- @copyright 2017 Pavel Makhov +------------------------------------------------- + +local awful = require("awful") +local naughty = require("naughty") +local watch = require("awful.widget.watch") +local wibox = require("wibox") + +-- acpi sample outputs +-- Battery 0: Discharging, 75%, 01:51:38 remaining +-- Battery 0: Charging, 53%, 00:57:43 until charged + +local PATH_TO_ICONS = "/usr/share/icons/Arc/status/symbolic/" +local HOME = os.getenv("HOME") + +local battery_widget = wibox.widget { + { + id = "icon", + widget = wibox.widget.imagebox, + resize = true + }, + layout = wibox.container.margin(_, 0, 0, 3) +} + +-- Popup with battery info +-- One way of creating a pop-up notification - naughty.notify +local notification +local function show_battery_status() + awful.spawn.easy_async([[bash -c 'acpi']], + function(stdout, _, _, _) + naughty.destroy(notification) + notification = naughty.notify{ + text = stdout, + title = "Battery status", + timeout = 5, hover_timeout = 0.5, + width = 200, + } + end + ) +end + +-- Alternative to naughty.notify - tooltip. You can compare both and choose the preferred one +--battery_popup = awful.tooltip({objects = {battery_widget}}) + +-- To use colors from beautiful theme put +-- following lines in rc.lua before require("battery"): +-- beautiful.tooltip_fg = beautiful.fg_normal +-- beautiful.tooltip_bg = beautiful.bg_normal + +local function show_battery_warning() + naughty.notify{ +-- icon = HOME .. "/.config/awesome/nichosi.png", +-- icon_size=100, + text = "Huston, we have a problem", + title = "Battery is dying", + timeout = 5, hover_timeout = 0.5, + position = "bottom_right", + bg = "#F06060", + fg = "#EEE9EF", + width = 300, + } +end + +local last_battery_check = os.time() + +watch("acpi -i", 10, + function(widget, stdout, stderr, exitreason, exitcode) + local batteryType + + local battery_info = {} + local capacities = {} + for s in stdout:gmatch("[^\r\n]+") do + local status, charge_str, time = string.match(s, '.+: (%a+), (%d?%d?%d)%%,?.*') + if string.match(s, 'rate information') then + -- ignore such line + elseif status ~= nil then + table.insert(battery_info, {status = status, charge = tonumber(charge_str)}) + else + local cap_str = string.match(s, '.+:.+last full capacity (%d+)') + table.insert(capacities, tonumber(cap_str)) + end + end + + local capacity = 0 + for i, cap in ipairs(capacities) do + capacity = capacity + cap + end + + local charge = 0 + local status + for i, batt in ipairs(battery_info) do + if batt.charge >= charge then + status = batt.status -- use most charged battery status + -- this is arbitrary, and maybe another metric should be used + end + + charge = charge + batt.charge * capacities[i] + end + charge = charge / capacity + + if (charge >= 0 and charge < 15) then + batteryType = "battery-empty%s-symbolic" + if status ~= 'Charging' and os.difftime(os.time(), last_battery_check) > 300 then + -- if 5 minutes have elapsed since the last warning + last_battery_check = time() + + show_battery_warning() + end + elseif (charge >= 15 and charge < 40) then batteryType = "battery-caution%s-symbolic" + elseif (charge >= 40 and charge < 60) then batteryType = "battery-low%s-symbolic" + elseif (charge >= 60 and charge < 80) then batteryType = "battery-good%s-symbolic" + elseif (charge >= 80 and charge <= 100) then batteryType = "battery-full%s-symbolic" + end + + if status == 'Charging' then + batteryType = string.format(batteryType, '-charging') + else + batteryType = string.format(batteryType, '') + end + + widget.icon:set_image(PATH_TO_ICONS .. batteryType .. ".svg") + + -- Update popup text + -- battery_popup.text = string.gsub(stdout, "\n$", "") + end, + battery_widget) + +battery_widget:connect_signal("mouse::enter", function() show_battery_status() end) +battery_widget:connect_signal("mouse::leave", function() naughty.destroy(notification) end) + +return battery_widget diff --git a/collections/ansible_collections/nullified/infrastructure/roles/workstation/templates/.config/awesome/rc.lua b/collections/ansible_collections/nullified/infrastructure/roles/workstation/templates/.config/awesome/rc.lua new file mode 100644 index 0000000..2069568 --- /dev/null +++ b/collections/ansible_collections/nullified/infrastructure/roles/workstation/templates/.config/awesome/rc.lua @@ -0,0 +1,759 @@ +--[[ + + Awesome WM configuration template + github.com/lcpz + +--]] + +-- {{{ Required libraries +local awesome, client, mouse, screen, tag = awesome, client, mouse, screen, tag +local ipairs, string, os, table, tostring, tonumber, type = ipairs, string, os, table, tostring, tonumber, type + +local gears = require("gears") +local awful = require("awful") + require("awful.autofocus") +local wibox = require("wibox") +local beautiful = require("beautiful") +local naughty = require("naughty") +local lain = require("lain") +local menubar = require("menubar") +local freedesktop = require("freedesktop") +local hotkeys_popup = require("awful.hotkeys_popup").widget + require("awful.hotkeys_popup.keys") +local my_table = awful.util.table or gears.table -- 4.{0,1} compatibility +local dpi = require("beautiful.xresources").apply_dpi +-- }}} + +-- {{{ Error handling +-- Check if awesome encountered an error during startup and fell back to +-- another config (This code will only ever execute for the fallback config) +if awesome.startup_errors then + naughty.notify({ preset = naughty.config.presets.critical, + title = "Oops, there were errors during startup!", + text = awesome.startup_errors }) +end + +-- Handle runtime errors after startup +do + local in_error = false + awesome.connect_signal("debug::error", function (err) + if in_error then return end + in_error = true + + naughty.notify({ preset = naughty.config.presets.critical, + title = "Oops, an error happened!", + text = tostring(err) }) + in_error = false + end) +end +-- }}} + +-- {{{ Autostart windowless processes + +-- This function will run once every time Awesome is started +local function run_once(cmd_arr) + for _, cmd in ipairs(cmd_arr) do + awful.spawn.with_shell(string.format("pgrep -u $USER -fx '%s' > /dev/null || (%s)", cmd, cmd)) + end +end + +run_once({ "unclutter -root", os.getenv("HOME") .. "/bin/autorun.sh" }) -- entries must be separated by commas + +-- }}} + +-- {{{ Variable definitions + +local themes = { + "blackburn", -- 1 + "copland", -- 2 + "dremora", -- 3 + "holo", -- 4 + "multicolor", -- 5 + "powerarrow", -- 6 + "powerarrow-dark", -- 7 + "rainbow", -- 8 + "steamburn", -- 9 + "vertex", -- 10 +} + +local chosen_theme = themes[6] +local modkey = "Mod4" +local altkey = "Mod1" +local terminal = "terminator" +local vi_focus = false -- vi-like client focus - https://github.com/lcpz/awesome-copycats/issues/275 +local cycle_prev = true -- cycle trough all previous client or just the first -- https://github.com/lcpz/awesome-copycats/issues/274 +local editor = os.getenv("EDITOR") or "emacs" +local gui_editor = os.getenv("GUI_EDITOR") or "gvim" +local browser = os.getenv("BROWSER") or "firefox" +local scrshooter = os.getenv("SCREENSHOOTER") or "xfce4-screenshooter" +local scrlocker = "slock" + +awful.util.terminal = terminal +awful.util.tagnames = { "Web", "Dev", "Admin", "Media" } +awful.layout.layouts = { + awful.layout.suit.tile, + awful.layout.suit.fair, + lain.layout.centerwork + --awful.layout.suit.floating, + --awful.layout.suit.tile.left, + --awful.layout.suit.tile.bottom, + --awful.layout.suit.tile.top, + --awful.layout.suit.fair, + --awful.layout.suit.fair.horizontal, + --awful.layout.suit.spiral, + --awful.layout.suit.spiral.dwindle, + --awful.layout.suit.max, + --awful.layout.suit.max.fullscreen, + --awful.layout.suit.magnifier, + --awful.layout.suit.corner.nw, + --awful.layout.suit.corner.ne, + --awful.layout.suit.corner.sw, + --awful.layout.suit.corner.se, + --lain.layout.cascade, + --lain.layout.cascade.tile, + --lain.layout.centerwork, + --lain.layout.centerwork.horizontal, + --lain.layout.termfair, + --lain.layout.termfair.center, +} + +awful.util.taglist_buttons = my_table.join( + awful.button({ }, 1, function(t) t:view_only() end), + awful.button({ modkey }, 1, function(t) + if client.focus then + client.focus:move_to_tag(t) + end + end), + awful.button({ }, 3, awful.tag.viewtoggle), + awful.button({ modkey }, 3, function(t) + if client.focus then + client.focus:toggle_tag(t) + end + end), + awful.button({ }, 4, function(t) awful.tag.viewnext(t.screen) end), + awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end) +) + +awful.util.tasklist_buttons = my_table.join( + awful.button({ }, 1, function (c) + if c == client.focus then + c.minimized = true + else + --c:emit_signal("request::activate", "tasklist", {raise = true}) + + -- Without this, the following + -- :isvisible() makes no sense + c.minimized = false + if not c:isvisible() and c.first_tag then + c.first_tag:view_only() + end + -- This will also un-minimize + -- the client, if needed + client.focus = c + c:raise() + end + end), + awful.button({ }, 2, function (c) c:kill() end), + awful.button({ }, 3, function () + local instance = nil + + return function () + if instance and instance.wibox.visible then + instance:hide() + instance = nil + else + instance = awful.menu.clients({theme = {width = dpi(250)}}) + end + end + end), + awful.button({ }, 4, function () awful.client.focus.byidx(1) end), + awful.button({ }, 5, function () awful.client.focus.byidx(-1) end) +) + +lain.layout.termfair.nmaster = 3 +lain.layout.termfair.ncol = 1 +lain.layout.termfair.center.nmaster = 3 +lain.layout.termfair.center.ncol = 1 +lain.layout.cascade.tile.offset_x = dpi(2) +lain.layout.cascade.tile.offset_y = dpi(32) +lain.layout.cascade.tile.extra_padding = dpi(5) +lain.layout.cascade.tile.nmaster = 5 +lain.layout.cascade.tile.ncol = 2 + +beautiful.init(string.format("%s/.config/awesome/themes/%s/theme-personal.lua", os.getenv("HOME"), chosen_theme)) +-- }}} + +-- {{{ Menu +local myawesomemenu = { + { "hotkeys", function() return false, hotkeys_popup.show_help end }, + { "manual", terminal .. " -e man awesome" }, + { "edit config", string.format("%s -e %s %s", terminal, editor, awesome.conffile) }, + { "restart", awesome.restart }, + { "quit", function() awesome.quit() end } +} +awful.util.mymainmenu = freedesktop.menu.build({ + icon_size = beautiful.menu_height or dpi(16), + before = { + { "Awesome", myawesomemenu, beautiful.awesome_icon }, + -- other triads can be put here + }, + after = { + { "Open terminal", terminal }, + -- other triads can be put here + } +}) +-- hide menu when mouse leaves it +--awful.util.mymainmenu.wibox:connect_signal("mouse::leave", function() awful.util.mymainmenu:hide() end) + +menubar.utils.terminal = terminal -- Set the Menubar terminal for applications that require it +-- }}} + +-- {{{ Screen +-- Re-set wallpaper when a screen's geometry changes (e.g. different resolution) +screen.connect_signal("property::geometry", function(s) + -- Wallpaper + if beautiful.wallpaper then + local wallpaper = beautiful.wallpaper + -- If wallpaper is a function, call it with the screen + if type(wallpaper) == "function" then + wallpaper = wallpaper(s) + end + gears.wallpaper.maximized(wallpaper, s, true) + end +end) + +-- No borders when rearranging only 1 non-floating or maximized client +screen.connect_signal("arrange", function (s) + local only_one = #s.tiled_clients == 1 + for _, c in pairs(s.clients) do + if only_one and not c.floating or c.maximized then + c.border_width = 0 + else + c.border_width = beautiful.border_width + end + end +end) +-- Create a wibox for each screen and add it +awful.screen.connect_for_each_screen(function(s) beautiful.at_screen_connect(s) end) +-- }}} + +-- {{{ Mouse bindings +root.buttons(my_table.join( + awful.button({ }, 3, function () awful.util.mymainmenu:toggle() end), + awful.button({ }, 4, awful.tag.viewnext), + awful.button({ }, 5, awful.tag.viewprev) +)) +-- }}} + +-- {{{ Key bindings +globalkeys = my_table.join( + -- X screen locker + awful.key({ altkey, "Control" }, "l", function () awful.spawn(scrlocker) end, + {description = "lock screen", group = "hotkeys"}), + + -- Hotkeys + awful.key({ modkey, }, "s", hotkeys_popup.show_help, + {description = "show help", group="awesome"}), + -- Tag browsing + awful.key({ modkey, }, "Left", awful.tag.viewprev, + {description = "view previous", group = "tag"}), + awful.key({ modkey, }, "Right", awful.tag.viewnext, + {description = "view next", group = "tag"}), + awful.key({ modkey, }, "Escape", awful.tag.history.restore, + {description = "go back", group = "tag"}), + + -- Non-empty tag browsing + awful.key({ altkey }, "Left", function () lain.util.tag_view_nonempty(-1) end, + {description = "view previous nonempty", group = "tag"}), + awful.key({ altkey }, "Right", function () lain.util.tag_view_nonempty(1) end, + {description = "view previous nonempty", group = "tag"}), + + -- Default client focus + awful.key({ altkey, }, "j", + function () + awful.client.focus.byidx( 1) + end, + {description = "focus next by index", group = "client"} + ), + awful.key({ altkey, }, "k", + function () + awful.client.focus.byidx(-1) + end, + {description = "focus previous by index", group = "client"} + ), + + -- By direction client focus + awful.key({ modkey }, "j", + function() + awful.client.focus.global_bydirection("down") + if client.focus then client.focus:raise() end + end, + {description = "focus down", group = "client"}), + awful.key({ modkey }, "k", + function() + awful.client.focus.global_bydirection("up") + if client.focus then client.focus:raise() end + end, + {description = "focus up", group = "client"}), + awful.key({ modkey }, "h", + function() + awful.client.focus.global_bydirection("left") + if client.focus then client.focus:raise() end + end, + {description = "focus left", group = "client"}), + awful.key({ modkey }, "l", + function() + awful.client.focus.global_bydirection("right") + if client.focus then client.focus:raise() end + end, + {description = "focus right", group = "client"}), + awful.key({ modkey, }, "w", function () awful.util.mymainmenu:show() end, + {description = "show main menu", group = "awesome"}), + + -- Layout manipulation + awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end, + {description = "swap with next client by index", group = "client"}), + awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end, + {description = "swap with previous client by index", group = "client"}), + awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end, + {description = "focus the next screen", group = "screen"}), + awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end, + {description = "focus the previous screen", group = "screen"}), + awful.key({ modkey, }, "u", awful.client.urgent.jumpto, + {description = "jump to urgent client", group = "client"}), + awful.key({ modkey, }, "Tab", + function () + if cycle_prev then + awful.client.focus.history.previous() + else + awful.client.focus.byidx(-1) + end + if client.focus then + client.focus:raise() + end + end, + {description = "cycle with previous/go back", group = "client"}), + awful.key({ modkey, "Shift" }, "Tab", + function () + if cycle_prev then + awful.client.focus.byidx(1) + if client.focus then + client.focus:raise() + end + end + end, + {description = "go forth", group = "client"}), + + -- Show/Hide Wibox + awful.key({ modkey }, "b", function () + for s in screen do + s.mywibox.visible = not s.mywibox.visible + if s.mybottomwibox then + s.mybottomwibox.visible = not s.mybottomwibox.visible + end + end + end, + {description = "toggle wibox", group = "awesome"}), + + -- On the fly useless gaps change + awful.key({ altkey, "Control" }, "+", function () lain.util.useless_gaps_resize(1) end, + {description = "increment useless gaps", group = "tag"}), + awful.key({ altkey, "Control" }, "-", function () lain.util.useless_gaps_resize(-1) end, + {description = "decrement useless gaps", group = "tag"}), + + -- Dynamic tagging + awful.key({ modkey, "Shift" }, "n", function () lain.util.add_tag() end, + {description = "add new tag", group = "tag"}), + awful.key({ modkey, "Shift" }, "r", function () lain.util.rename_tag() end, + {description = "rename tag", group = "tag"}), + awful.key({ modkey, "Shift" }, "Left", function () lain.util.move_tag(-1) end, + {description = "move tag to the left", group = "tag"}), + awful.key({ modkey, "Shift" }, "Right", function () lain.util.move_tag(1) end, + {description = "move tag to the right", group = "tag"}), + awful.key({ modkey, "Shift" }, "d", function () lain.util.delete_tag() end, + {description = "delete tag", group = "tag"}), + + -- Standard program + awful.key({ modkey, }, "Return", function () awful.spawn(terminal) end, + {description = "open a terminal", group = "launcher"}), + awful.key({ modkey, "Control" }, "r", awesome.restart, + {description = "reload awesome", group = "awesome"}), + awful.key({ modkey, "Shift" }, "q", awesome.quit, + {description = "quit awesome", group = "awesome"}), + + awful.key({ altkey, "Shift" }, "l", function () awful.tag.incmwfact( 0.05) end, + {description = "increase master width factor", group = "layout"}), + awful.key({ altkey, "Shift" }, "h", function () awful.tag.incmwfact(-0.05) end, + {description = "decrease master width factor", group = "layout"}), + awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1, nil, true) end, + {description = "increase the number of master clients", group = "layout"}), + awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1, nil, true) end, + {description = "decrease the number of master clients", group = "layout"}), + awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1, nil, true) end, + {description = "increase the number of columns", group = "layout"}), + awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1, nil, true) end, + {description = "decrease the number of columns", group = "layout"}), + awful.key({ modkey, }, "space", function () awful.layout.inc( 1) end, + {description = "select next", group = "layout"}), + awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(-1) end, + {description = "select previous", group = "layout"}), + + awful.key({ modkey, "Control" }, "n", + function () + local c = awful.client.restore() + -- Focus restored client + if c then + client.focus = c + c:raise() + end + end, + {description = "restore minimized", group = "client"}), + + -- Dropdown application + awful.key({ modkey, }, "z", function () awful.screen.focused().quake:toggle() end, + {description = "dropdown application", group = "launcher"}), + + -- Widgets popups + awful.key({ altkey, }, "c", function () if beautiful.cal then beautiful.cal.show(7) end end, + {description = "show calendar", group = "widgets"}), + awful.key({ altkey, }, "h", function () if beautiful.fs then beautiful.fs.show(7) end end, + {description = "show filesystem", group = "widgets"}), + awful.key({ altkey, }, "w", function () if beautiful.weather then beautiful.weather.show(7) end end, + {description = "show weather", group = "widgets"}), + + -- Brightness + awful.key({ }, "XF86MonBrightnessUp", function () awful.spawn("xbacklight -inc 10") end, + {description = "+10%", group = "hotkeys"}), + awful.key({ }, "XF86MonBrightnessDown", function () awful.spawn("xbacklight -dec 10") end, + {description = "-10%", group = "hotkeys"}), + + -- ALSA volume control + awful.key({ altkey }, "Up", + function () + awful.spawn(string.format("amixer -q set %s 1%%+", beautiful.volume.channel)) + beautiful.volume.update() + end, + {description = "volume up", group = "hotkeys"}), + awful.key({ altkey }, "Down", + function () + awful.spawn(string.format("amixer -q set %s 1%%-", beautiful.volume.channel)) + beautiful.volume.update() + end, + {description = "volume down", group = "hotkeys"}), + awful.key({ altkey }, "m", + function () + awful.spawn(string.format("amixer -q set %s toggle", beautiful.volume.togglechannel or beautiful.volume.channel)) + beautiful.volume.update() + end, + {description = "toggle mute", group = "hotkeys"}), + awful.key({ altkey, "Control" }, "m", + function () + awful.spawn(string.format("amixer -q set %s 100%%", beautiful.volume.channel)) + beautiful.volume.update() + end, + {description = "volume 100%", group = "hotkeys"}), + awful.key({ altkey, "Control" }, "0", + function () + awful.spawn(string.format("amixer -q set %s 0%%", beautiful.volume.channel)) + beautiful.volume.update() + end, + {description = "volume 0%", group = "hotkeys"}), + + -- MPD control + awful.key({ altkey, "Control" }, "Up", + function () + awful.spawn("mpc toggle") + beautiful.mpd.update() + end, + {description = "mpc toggle", group = "widgets"}), + awful.key({ altkey, "Control" }, "Down", + function () + awful.spawn("mpc stop") + beautiful.mpd.update() + end, + {description = "mpc stop", group = "widgets"}), + awful.key({ altkey, "Control" }, "Left", + function () + awful.spawn("mpc prev") + beautiful.mpd.update() + end, + {description = "mpc prev", group = "widgets"}), + awful.key({ altkey, "Control" }, "Right", + function () + awful.spawn("mpc next") + beautiful.mpd.update() + end, + {description = "mpc next", group = "widgets"}), + awful.key({ altkey }, "0", + function () + local common = { text = "MPD widget ", position = "top_middle", timeout = 2 } + if beautiful.mpd.timer.started then + beautiful.mpd.timer:stop() + common.text = common.text .. lain.util.markup.bold("OFF") + else + beautiful.mpd.timer:start() + common.text = common.text .. lain.util.markup.bold("ON") + end + naughty.notify(common) + end, + {description = "mpc on/off", group = "widgets"}), + + -- Copy primary to clipboard (terminals to gtk) + awful.key({ modkey }, "c", function () awful.spawn.with_shell("xsel | xsel -i -b") end, + {description = "copy terminal to gtk", group = "hotkeys"}), + -- Copy clipboard to primary (gtk to terminals) + awful.key({ modkey }, "v", function () awful.spawn.with_shell("xsel -b | xsel") end, + {description = "copy gtk to terminal", group = "hotkeys"}), + + -- User programs + awful.key({ modkey }, "q", function () awful.spawn(browser) end, + {description = "run browser", group = "launcher"}), + awful.key({ modkey }, "a", function () awful.spawn(gui_editor) end, + {description = "run gui editor", group = "launcher"}), + awful.key({ }, "Print", function () awful.spawn(scrshooter) end, + {description = "run screenshot program", group = "hotkeys"}), + -- Menubar + awful.key({ modkey }, "p", function() menubar.show() end, + {description = "show the menubar", group = "launcher"}), + -- Prompt + awful.key({ modkey }, "r", function () awful.screen.focused().mypromptbox:run() end, + {description = "run prompt", group = "launcher"}), + + awful.key({ modkey }, "x", + function () + awful.prompt.run { + prompt = "Run Lua code: ", + textbox = awful.screen.focused().mypromptbox.widget, + exe_callback = awful.util.eval, + history_path = awful.util.get_cache_dir() .. "/history_eval" + } + end, + {description = "lua execute prompt", group = "awesome"}) + -- +) + +clientkeys = my_table.join( + awful.key({ altkey, "Shift" }, "m", lain.util.magnify_client, + {description = "magnify client", group = "client"}), + awful.key({ modkey, }, "f", + function (c) + c.fullscreen = not c.fullscreen + c:raise() + end, + {description = "toggle fullscreen", group = "client"}), + awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end, + {description = "close", group = "client"}), + awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle , + {description = "toggle floating", group = "client"}), + awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end, + {description = "move to master", group = "client"}), + awful.key({ modkey, }, "o", function (c) c:move_to_screen() end, + {description = "move to screen", group = "client"}), + awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end, + {description = "toggle keep on top", group = "client"}), + awful.key({ modkey, }, "n", + function (c) + -- The client currently has the input focus, so it cannot be + -- minimized, since minimized clients can't have the focus. + c.minimized = true + end , + {description = "minimize", group = "client"}), + awful.key({ modkey, }, "m", + function (c) + c.maximized = not c.maximized + c:raise() + end , + {description = "maximize", group = "client"}) +) + +-- Bind all key numbers to tags. +-- Be careful: we use keycodes to make it works on any keyboard layout. +-- This should map on the top row of your keyboard, usually 1 to 9. +for i = 1, 9 do + -- Hack to only show tags 1 and 9 in the shortcut window (mod+s) + local descr_view, descr_toggle, descr_move, descr_toggle_focus + if i == 1 or i == 9 then + descr_view = {description = "view tag #", group = "tag"} + descr_toggle = {description = "toggle tag #", group = "tag"} + descr_move = {description = "move focused client to tag #", group = "tag"} + descr_toggle_focus = {description = "toggle focused client on tag #", group = "tag"} + end + globalkeys = my_table.join(globalkeys, + -- View tag only. + awful.key({ modkey }, "#" .. i + 9, + function () + local screen = awful.screen.focused() + local tag = screen.tags[i] + if tag then + tag:view_only() + end + end, + descr_view), + -- Toggle tag display. + awful.key({ modkey, "Control" }, "#" .. i + 9, + function () + local screen = awful.screen.focused() + local tag = screen.tags[i] + if tag then + awful.tag.viewtoggle(tag) + end + end, + descr_toggle), + -- Move client to tag. + awful.key({ modkey, "Shift" }, "#" .. i + 9, + function () + if client.focus then + local tag = client.focus.screen.tags[i] + if tag then + client.focus:move_to_tag(tag) + end + end + end, + descr_move), + -- Toggle tag on focused client. + awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, + function () + if client.focus then + local tag = client.focus.screen.tags[i] + if tag then + client.focus:toggle_tag(tag) + end + end + end, + descr_toggle_focus) + ) +end + +clientbuttons = gears.table.join( + awful.button({ }, 1, function (c) + c:emit_signal("request::activate", "mouse_click", {raise = true}) + end), + awful.button({ modkey }, 1, function (c) + c:emit_signal("request::activate", "mouse_click", {raise = true}) + awful.mouse.client.move(c) + end), + awful.button({ modkey }, 3, function (c) + c:emit_signal("request::activate", "mouse_click", {raise = true}) + awful.mouse.client.resize(c) + end) +) + +-- Set keys +root.keys(globalkeys) +-- }}} + +-- {{{ Rules +-- Rules to apply to new clients (through the "manage" signal). +awful.rules.rules = { + -- All clients will match this rule. + { rule = { }, + properties = { border_width = beautiful.border_width, + border_color = beautiful.border_normal, + focus = awful.client.focus.filter, + raise = true, + keys = clientkeys, + buttons = clientbuttons, + screen = awful.screen.preferred, + placement = awful.placement.no_overlap+awful.placement.no_offscreen, + size_hints_honor = false + } + }, + + -- Titlebars + { rule_any = { type = { "dialog", "normal" } }, + properties = { titlebars_enabled = true } }, + + -- Set Firefox to always map on the first tag on screen 1. + { rule = { class = "Firefox" }, + properties = { screen = 1, tag = awful.util.tagnames[1] } }, + + { rule = { class = "Gimp", role = "gimp-image-window" }, + properties = { maximized = true } }, +} +-- }}} + +-- {{{ Signals +-- Signal function to execute when a new client appears. +client.connect_signal("manage", function (c) + -- Set the windows at the slave, + -- i.e. put it at the end of others instead of setting it master. + -- if not awesome.startup then awful.client.setslave(c) end + + if awesome.startup and + not c.size_hints.user_position + and not c.size_hints.program_position then + -- Prevent clients from being unreachable after screen count changes. + awful.placement.no_offscreen(c) + end +end) + +-- Add a titlebar if titlebars_enabled is set to true in the rules. +client.connect_signal("request::titlebars", function(c) + -- Custom + if beautiful.titlebar_fun then + beautiful.titlebar_fun(c) + return + end + + -- Default + -- buttons for the titlebar + local buttons = my_table.join( + awful.button({ }, 1, function() + c:emit_signal("request::activate", "titlebar", {raise = true}) + awful.mouse.client.move(c) + end), + awful.button({ }, 2, function() c:kill() end), + awful.button({ }, 3, function() + c:emit_signal("request::activate", "titlebar", {raise = true}) + awful.mouse.client.resize(c) + end) + ) + + awful.titlebar(c, {size = dpi(16)}) : setup { + { -- Left + awful.titlebar.widget.iconwidget(c), + buttons = buttons, + layout = wibox.layout.fixed.horizontal + }, + { -- Middle + { -- Title + align = "center", + widget = awful.titlebar.widget.titlewidget(c) + }, + buttons = buttons, + layout = wibox.layout.flex.horizontal + }, + { -- Right + awful.titlebar.widget.floatingbutton (c), + awful.titlebar.widget.maximizedbutton(c), + awful.titlebar.widget.stickybutton (c), + awful.titlebar.widget.ontopbutton (c), + awful.titlebar.widget.closebutton (c), + layout = wibox.layout.fixed.horizontal() + }, + layout = wibox.layout.align.horizontal + } +end) + +-- Enable sloppy focus, so that focus follows mouse. +client.connect_signal("mouse::enter", function(c) + c:emit_signal("request::activate", "mouse_enter", {raise = vi_focus}) +end) + +client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end) +client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end) + +-- possible workaround for tag preservation when switching back to default screen: +-- https://github.com/lcpz/awesome-copycats/issues/251 +-- }}} + +-- Test to work around fullscreen game issues +client.connect_signal("property::fullscreen", function(c) + if c.fullscreen then + gears.timer.delayed_call(function() + if c.valid then + c:geometry(c.screen.geometry) + end + end) + end +end) diff --git a/collections/ansible_collections/nullified/infrastructure/roles/workstation/templates/.config/awesome/themes/powerarrow/theme-personal.lua b/collections/ansible_collections/nullified/infrastructure/roles/workstation/templates/.config/awesome/themes/powerarrow/theme-personal.lua new file mode 100644 index 0000000..e976631 --- /dev/null +++ b/collections/ansible_collections/nullified/infrastructure/roles/workstation/templates/.config/awesome/themes/powerarrow/theme-personal.lua @@ -0,0 +1,386 @@ +--[[ + + Powerarrow Awesome WM theme + github.com/lcpz + +--]] + +local gears = require("gears") +local lain = require("lain") +local awful = require("awful") +local wibox = require("wibox") +local dpi = require("beautiful.xresources").apply_dpi + +local math, string, os = math, string, os +local my_table = awful.util.table or gears.table -- 4.{0,1} compatibility + +local output_sink_index = 1 + +local theme = {} +theme.dir = os.getenv("HOME") .. "/.config/awesome/themes/powerarrow" +theme.wallpaper = os.getenv("HOME") .. "/.config/awesome/background.png" +theme.font = "Roboto Slab 9" +theme.fg_normal = "#FEFEFE" +theme.fg_focus = "#32D6FF" +theme.fg_urgent = "#C83F11" +theme.bg_normal = "#222222" +theme.bg_focus = "#1E2320" +theme.bg_urgent = "#3F3F3F" +theme.taglist_fg_focus = "#00CCFF" +theme.tasklist_bg_focus = "#222222" +theme.tasklist_fg_focus = "#00CCFF" +theme.border_width = dpi(2) +theme.border_normal = "#3F3F3F" +theme.border_focus = "#6F6F6F" +theme.border_marked = "#CC9393" +theme.titlebar_bg_focus = "#3F3F3F" +theme.titlebar_bg_normal = "#3F3F3F" +theme.titlebar_bg_focus = theme.bg_focus +theme.titlebar_bg_normal = theme.bg_normal +theme.titlebar_fg_focus = theme.fg_focus +theme.menu_height = dpi(16) +theme.menu_width = dpi(140) +theme.menu_submenu_icon = theme.dir .. "/icons/submenu.png" +theme.awesome_icon = theme.dir .. "/icons/awesome.png" +theme.taglist_squares_sel = theme.dir .. "/icons/square_sel.png" +theme.taglist_squares_unsel = theme.dir .. "/icons/square_unsel.png" +theme.layout_tile = theme.dir .. "/icons/tile.png" +theme.layout_tileleft = theme.dir .. "/icons/tileleft.png" +theme.layout_tilebottom = theme.dir .. "/icons/tilebottom.png" +theme.layout_tiletop = theme.dir .. "/icons/tiletop.png" +theme.layout_fairv = theme.dir .. "/icons/fairv.png" +theme.layout_fairh = theme.dir .. "/icons/fairh.png" +theme.layout_spiral = theme.dir .. "/icons/spiral.png" +theme.layout_dwindle = theme.dir .. "/icons/dwindle.png" +theme.layout_max = theme.dir .. "/icons/max.png" +theme.layout_fullscreen = theme.dir .. "/icons/fullscreen.png" +theme.layout_magnifier = theme.dir .. "/icons/magnifier.png" +theme.layout_floating = theme.dir .. "/icons/floating.png" +theme.widget_ac = theme.dir .. "/icons/ac.png" +theme.widget_battery = theme.dir .. "/icons/battery.png" +theme.widget_battery_low = theme.dir .. "/icons/battery_low.png" +theme.widget_battery_empty = theme.dir .. "/icons/battery_empty.png" +theme.widget_brightness = theme.dir .. "/icons/brightness.png" +theme.widget_mem = theme.dir .. "/icons/mem.png" +theme.widget_cpu = theme.dir .. "/icons/cpu.png" +theme.widget_temp = theme.dir .. "/icons/temp.png" +theme.widget_net = theme.dir .. "/icons/net.png" +theme.widget_hdd = theme.dir .. "/icons/hdd.png" +theme.widget_music = theme.dir .. "/icons/note.png" +theme.widget_music_on = theme.dir .. "/icons/note_on.png" +theme.widget_music_pause = theme.dir .. "/icons/pause.png" +theme.widget_music_stop = theme.dir .. "/icons/stop.png" +-- Borrow volume icons from powerarrow-dark +theme.widget_vol = theme.dir .. "/../powerarrow-dark/icons/vol.png" +theme.widget_vol_low = theme.dir .. "/../powerarrow-dark/icons/vol_low.png" +theme.widget_vol_no = theme.dir .. "/../powerarrow-dark/icons/vol_no.png" +theme.widget_vol_mute = theme.dir .. "/../powerarrow-dark/icons/vol_mute.png" +-- +theme.widget_mail = theme.dir .. "/icons/mail.png" +theme.widget_mail_on = theme.dir .. "/icons/mail_on.png" +theme.widget_task = theme.dir .. "/icons/task.png" +theme.widget_scissors = theme.dir .. "/icons/scissors.png" +theme.tasklist_plain_task_name = true +theme.tasklist_disable_icon = true +theme.useless_gap = 0 +theme.titlebar_close_button_focus = theme.dir .. "/icons/titlebar/close_focus.png" +theme.titlebar_close_button_normal = theme.dir .. "/icons/titlebar/close_normal.png" +theme.titlebar_ontop_button_focus_active = theme.dir .. "/icons/titlebar/ontop_focus_active.png" +theme.titlebar_ontop_button_normal_active = theme.dir .. "/icons/titlebar/ontop_normal_active.png" +theme.titlebar_ontop_button_focus_inactive = theme.dir .. "/icons/titlebar/ontop_focus_inactive.png" +theme.titlebar_ontop_button_normal_inactive = theme.dir .. "/icons/titlebar/ontop_normal_inactive.png" +theme.titlebar_sticky_button_focus_active = theme.dir .. "/icons/titlebar/sticky_focus_active.png" +theme.titlebar_sticky_button_normal_active = theme.dir .. "/icons/titlebar/sticky_normal_active.png" +theme.titlebar_sticky_button_focus_inactive = theme.dir .. "/icons/titlebar/sticky_focus_inactive.png" +theme.titlebar_sticky_button_normal_inactive = theme.dir .. "/icons/titlebar/sticky_normal_inactive.png" +theme.titlebar_floating_button_focus_active = theme.dir .. "/icons/titlebar/floating_focus_active.png" +theme.titlebar_floating_button_normal_active = theme.dir .. "/icons/titlebar/floating_normal_active.png" +theme.titlebar_floating_button_focus_inactive = theme.dir .. "/icons/titlebar/floating_focus_inactive.png" +theme.titlebar_floating_button_normal_inactive = theme.dir .. "/icons/titlebar/floating_normal_inactive.png" +theme.titlebar_maximized_button_focus_active = theme.dir .. "/icons/titlebar/maximized_focus_active.png" +theme.titlebar_maximized_button_normal_active = theme.dir .. "/icons/titlebar/maximized_normal_active.png" +theme.titlebar_maximized_button_focus_inactive = theme.dir .. "/icons/titlebar/maximized_focus_inactive.png" +theme.titlebar_maximized_button_normal_inactive = theme.dir .. "/icons/titlebar/maximized_normal_inactive.png" + +local markup = lain.util.markup +local separators = lain.util.separators + +-- Conventional clock +local convclock = wibox.widget.textclock() + +-- Calendar +theme.cal = lain.widget.cal({ + --cal = "cal --color=always", + --attach_to = { binclock.widget }, + attach_to = { convclock }, + notification_preset = { +-- font = "Terminus 10", + font = "Roboto Slab 10", + fg = theme.fg_normal, + bg = theme.bg_normal + } +}) + +-- Taskwarrior +local task = wibox.widget.imagebox(theme.widget_task) +lain.widget.contrib.task.attach(task, { + -- do not colorize output + show_cmd = "task | sed -r 's/\\x1B\\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g'" +}) +task:buttons(my_table.join(awful.button({}, 1, lain.widget.contrib.task.prompt))) + +-- Scissors (xsel copy and paste) +local scissors = wibox.widget.imagebox(theme.widget_scissors) +scissors:buttons(my_table.join(awful.button({}, 1, function() awful.spawn.with_shell("xsel | xsel -i -b") end))) + +-- PulseAudio volume +local volicon = wibox.widget.imagebox(theme.widget_vol) +theme.volume = lain.widget.pulse({ + settings = function() + if volume_now == nil or volume_now.muted == "yes" then + volicon:set_image(theme.widget_vol_mute) + elseif volume_now.left == "N/A" then + volicon:set_image(theme.widget_vol_no) + elseif tonumber(volume_now.left) == 0 then + volicon:set_image(theme.widget_vol_no) + elseif tonumber(volume_now.left) <= 50 then + volicon:set_image(theme.widget_vol_low) + else + volicon:set_image(theme.widget_vol) + end + + widget:set_markup(markup.font(theme.font, " " .. volume_now.left .. "% ")) + end +}) +theme.volume.widget:buttons(awful.util.table.join( + awful.button({}, 4, function () + awful.spawn("pactl set-sink-volume " .. output_sink_index .. " +3%") + theme.volume.update() + end), + awful.button({}, 5, function () + awful.spawn("pactl set-sink-volume " .. output_sink_index .. " -3%") + theme.volume.update() + end) +)) + + +-- MPD +local musicplr = awful.util.terminal .. " --title Music -g 130x34-320+16 -e ncmpcpp" +local mpdicon = wibox.widget.imagebox(theme.widget_music) +mpdicon:buttons(my_table.join( + awful.button({ modkey }, 1, function () awful.spawn.with_shell(musicplr) end), + awful.button({ }, 1, function () + os.execute("mpc prev") + theme.mpd.update() + end), + awful.button({ }, 2, function () + os.execute("mpc toggle") + theme.mpd.update() + end), + awful.button({ }, 3, function () + os.execute("mpc next") + theme.mpd.update() + end))) +theme.mpd = lain.widget.mpd({ + settings = function() + if mpd_now.state == "play" then + artist = " " .. mpd_now.artist .. " " + title = mpd_now.title .. " " + mpdicon:set_image(theme.widget_music_on) + widget:set_markup(markup.font(theme.font, markup("#FF8466", artist) .. " " .. title)) + elseif mpd_now.state == "pause" then + widget:set_markup(markup.font(theme.font, " mpd paused ")) + mpdicon:set_image(theme.widget_music_pause) + else + widget:set_text("") + mpdicon:set_image(theme.widget_music) + end + end +}) + +-- MEM +local memicon = wibox.widget.imagebox(theme.widget_mem) +local mem = lain.widget.mem({ + settings = function() + widget:set_markup(markup.font(theme.font, " " .. mem_now.used .. "MB ")) + end +}) + +-- CPU +local cpuicon = wibox.widget.imagebox(theme.widget_cpu) +local cpu = lain.widget.cpu({ + settings = function() + widget:set_markup(markup.font(theme.font, " " .. cpu_now.usage .. "% ")) + end +}) + +-- Coretemp (lain, average) +local temp = lain.widget.temp({ + settings = function() + widget:set_markup(markup.font(theme.font, " " .. coretemp_now .. "°C ")) + end +}) +-- +local tempicon = wibox.widget.imagebox(theme.widget_temp) + +-- / fs +local fsicon = wibox.widget.imagebox(theme.widget_hdd) +-- commented because it needs Gio/Glib >= 2.54 +theme.fs = lain.widget.fs({ +-- notification_preset = { fg = theme.fg_normal, bg = theme.bg_normal, font = "Terminus 10" }, + notification_preset = { fg = theme.fg_normal, bg = theme.bg_normal, font = "Roboto Slab 10" }, + settings = function() + local fsp = string.format(" %3.2f %s ", fs_now["/"].free, fs_now["/"].units) + widget:set_markup(markup.font(theme.font, fsp)) + end +}) +-- + +-- Battery +local baticon = wibox.widget.imagebox(theme.widget_battery) +local bat = lain.widget.bat({ + settings = function() + if bat_now.status and bat_now.status ~= "N/A" then + if bat_now.ac_status == 1 then + widget:set_markup(markup.font(theme.font, " AC ")) + baticon:set_image(theme.widget_ac) + return + elseif not bat_now.perc and tonumber(bat_now.perc) <= 5 then + baticon:set_image(theme.widget_battery_empty) + elseif not bat_now.perc and tonumber(bat_now.perc) <= 15 then + baticon:set_image(theme.widget_battery_low) + else + baticon:set_image(theme.widget_battery) + end + widget:set_markup(markup.font(theme.font, " " .. bat_now.perc .. "% ")) + else + widget:set_markup() + baticon:set_image(theme.widget_ac) + end + end +}) + +-- Net +local neticon = wibox.widget.imagebox(theme.widget_net) +local net = lain.widget.net({ + settings = function() + widget:set_markup(markup.fontfg(theme.font, "#FEFEFE", " " .. net_now.received .. " ↓↑ " .. net_now.sent .. " ")) + end +}) + +-- Brigtness +local brighticon = wibox.widget.imagebox(theme.widget_brightness) +-- If you use xbacklight, comment the line with "light -G" and uncomment the line bellow +-- local brightwidget = awful.widget.watch('xbacklight -get', 0.1, +local brightwidget = awful.widget.watch('light -G', 0.1, + function(widget, stdout, stderr, exitreason, exitcode) + local brightness_level = tonumber(string.format("%.0f", stdout)) + widget:set_markup(markup.font(theme.font, " " .. brightness_level .. "%")) +end) + +-- Separators +local arrow = separators.arrow_left + +function theme.powerline_rl(cr, width, height) + local arrow_depth, offset = height/2, 0 + + -- Avoid going out of the (potential) clip area + if arrow_depth < 0 then + width = width + 2*arrow_depth + offset = -arrow_depth + end + + cr:move_to(offset + arrow_depth , 0 ) + cr:line_to(offset + width , 0 ) + cr:line_to(offset + width - arrow_depth , height/2 ) + cr:line_to(offset + width , height ) + cr:line_to(offset + arrow_depth , height ) + cr:line_to(offset , height/2 ) + + cr:close_path() +end + +local function pl(widget, bgcolor, padding) + return wibox.container.background(wibox.container.margin(widget, dpi(16), dpi(16)), bgcolor, theme.powerline_rl) +end + +function theme.at_screen_connect(s) + -- Quake application + s.quake = lain.util.quake({ app = awful.util.terminal }) + + -- If wallpaper is a function, call it with the screen + local wallpaper = theme.wallpaper + if type(wallpaper) == "function" then + wallpaper = wallpaper(s) + end + gears.wallpaper.maximized(wallpaper, s, true) + + -- Tags + awful.tag(awful.util.tagnames, s, awful.layout.layouts) + + -- Create a promptbox for each screen + s.mypromptbox = awful.widget.prompt() + -- Create an imagebox widget which will contains an icon indicating which layout we're using. + -- We need one layoutbox per screen. + s.mylayoutbox = awful.widget.layoutbox(s) + s.mylayoutbox:buttons(my_table.join( + awful.button({}, 1, function () awful.layout.inc( 1) end), + awful.button({}, 2, function () awful.layout.set( awful.layout.layouts[1] ) end), + awful.button({}, 3, function () awful.layout.inc(-1) end), + awful.button({}, 4, function () awful.layout.inc( 1) end), + awful.button({}, 5, function () awful.layout.inc(-1) end))) + -- Create a taglist widget + s.mytaglist = awful.widget.taglist(s, awful.widget.taglist.filter.all, awful.util.taglist_buttons) + + -- Create a tasklist widget + s.mytasklist = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, awful.util.tasklist_buttons) + + -- Create the wibox + s.mywibox = awful.wibar({ position = "top", screen = s, height = dpi(16), bg = theme.bg_normal, fg = theme.fg_normal }) + + -- Add widgets to the wibox + s.mywibox:setup { + layout = wibox.layout.align.horizontal, + { -- Left widgets + layout = wibox.layout.fixed.horizontal, + --spr, + s.mytaglist, + s.mypromptbox, + spr, + }, + s.mytasklist, -- Middle widget + { -- Right widgets + layout = wibox.layout.fixed.horizontal, + wibox.widget.systray(), + wibox.container.margin(scissors, dpi(4), dpi(8)), + arrow(theme.bg_normal, theme.bg_normal), + wibox.container.background(wibox.container.margin(wibox.widget { volicon, theme.volume.widget, layout = wibox.layout.align.horizontal }, dpi(4), dpi(7)), theme.bg_focus), + arrow(theme.bg_normal, "#343434"), + wibox.container.background(wibox.container.margin(wibox.widget { mailicon, theme.mail and theme.mail.widget, layout = wibox.layout.align.horizontal }, dpi(4), dpi(7)), "#343434"), + arrow("#343434", theme.bg_normal), + wibox.container.background(wibox.container.margin(wibox.widget { mpdicon, theme.mpd.widget, layout = wibox.layout.align.horizontal }, dpi(3), dpi(6)), theme.bg_focus), + arrow(theme.bg_normal, "#343434"), + wibox.container.background(wibox.container.margin(task, dpi(3), dpi(7)), "#343434"), + arrow("#343434", "#777E76"), + wibox.container.background(wibox.container.margin(wibox.widget { memicon, mem.widget, layout = wibox.layout.align.horizontal }, dpi(2), dpi(3)), "#777E76"), + arrow("#777E76", "#4B696D"), + wibox.container.background(wibox.container.margin(wibox.widget { cpuicon, cpu.widget, layout = wibox.layout.align.horizontal }, dpi(3), dpi(4)), "#4B696D"), + arrow("#4B696D", "#4B3B51"), + wibox.container.background(wibox.container.margin(wibox.widget { tempicon, temp.widget, layout = wibox.layout.align.horizontal }, dpi(4), dpi(4)), "#4B3B51"), + arrow("#4B3B51", "#CB755B"), + wibox.container.background(wibox.container.margin(wibox.widget { fsicon, theme.fs and theme.fs.widget, layout = wibox.layout.align.horizontal }, dpi(3), dpi(3)), "#CB755B"), + arrow("#CB755B", "#8DAA9A"), + wibox.container.background(wibox.container.margin(wibox.widget { baticon, bat.widget, layout = wibox.layout.align.horizontal }, dpi(3), dpi(3)), "#8DAA9A"), + arrow("#8DAA9A", "#C0C0A2"), + wibox.container.background(wibox.container.margin(wibox.widget { nil, neticon, net.widget, layout = wibox.layout.align.horizontal }, dpi(3), dpi(3)), "#C0C0A2"), + arrow("#C0C0A2", "#777E76"), + --wibox.container.background(wibox.container.margin(binclock.widget, dpi(4), dpi(8)), "#777E76"), + wibox.container.background(wibox.container.margin(convclock, dpi(4), dpi(8)), "#777E76"), + arrow("#777E76", "alpha"), + -- + s.mylayoutbox, + }, + } +end + +return theme diff --git a/collections/ansible_collections/nullified/infrastructure/roles/workstation/templates/.config/terminator/config b/collections/ansible_collections/nullified/infrastructure/roles/workstation/templates/.config/terminator/config new file mode 100644 index 0000000..1577c8c --- /dev/null +++ b/collections/ansible_collections/nullified/infrastructure/roles/workstation/templates/.config/terminator/config @@ -0,0 +1,21 @@ +[global_config] + enabled_plugins = SaveLastSessionLayout, LaunchpadBugURLHandler, LaunchpadCodeURLHandler, APTURLHandler +[keybindings] +[profiles] + [[default]] + background_darkness = 0.8 + background_type = transparent + font = JetBrainsMono Nerd Font Mono 10 + scrollback_lines = 15000 + palette = "#282828:#cc241d:#98971a:#d79921:#458588:#b16286:#689d6a:#a89984:#928374:#fb4934:#b8bb26:#fabd2f:#83a598:#d3869b:#8ec07c:#ebdbb2" + use_system_font = False + copy_on_selection = True +[layouts] + [[default]] + [[[window0]]] + type = Window + parent = "" + [[[child1]]] + type = Terminal + parent = window0 +[plugins] diff --git a/collections/ansible_collections/nullified/infrastructure/roles/workstation/templates/.config/vlc/vlcrc b/collections/ansible_collections/nullified/infrastructure/roles/workstation/templates/.config/vlc/vlcrc new file mode 100644 index 0000000..4fd26ea --- /dev/null +++ b/collections/ansible_collections/nullified/infrastructure/roles/workstation/templates/.config/vlc/vlcrc @@ -0,0 +1,5160 @@ +### +### vlc 3.0.20 +### + +### +### lines beginning with a '#' character are comments +### + +[access_output_rist] # RIST stream output + +# RIST target packet size (bytes) (integer) +#sout-rist-packet-size=1328 + +# RIST data output caching size (ms) (integer) +#sout-rist-caching=50 + +# RIST retry-buffer queue size (ms) (integer) +#sout-rist-buffer-size=0 + +# SSRC used in RTP output (default is random, i.e. 0) (integer) +#sout-rist-ssrc=0 + +# Stream name (string) +#sout-rist-stream-name= + +[access_output_shout] # IceCAST output + +# Stream name (string) +#sout-shout-name=VLC media player - Live stream + +# Stream description (string) +#sout-shout-description=Live stream from VLC media player + +# Stream MP3 (boolean) +#sout-shout-mp3=0 + +# Genre description (string) +#sout-shout-genre=Alternative + +# URL description (string) +#sout-shout-url=http://www.videolan.org/vlc + +# Bitrate (string) +#sout-shout-bitrate= + +# Samplerate (string) +#sout-shout-samplerate= + +# Number of channels (string) +#sout-shout-channels= + +# Ogg Vorbis Quality (string) +#sout-shout-quality= + +# Stream public (boolean) +#sout-shout-public=0 + +[http] # HTTP stream output + +# Username (string) +#sout-http-user= + +# Password (string) +#sout-http-pwd= + +# Mime (string) +#sout-http-mime= + +# Metacube (boolean) +#sout-http-metacube=0 + +[udp] # UDP stream output + +# Caching value (ms) (integer) +#sout-udp-caching=300 + +# Group packets (integer) +#sout-udp-group=1 + +[file] # File stream output + +# Overwrite existing file (boolean) +#sout-file-overwrite=1 + +# Append to file (boolean) +#sout-file-append=0 + +# Format time and date (boolean) +#sout-file-format=0 + +# Synchronous writing (boolean) +#sout-file-sync=0 + +[access_output_srt] # SRT stream output + +# Return poll wait after timeout milliseconds (-1 = infinite) (integer) +#poll-timeout=-1 + +# SRT latency (ms) (integer) +#latency=120 + +# Password for stream encryption (string) +#passphrase= + +# SRT maximum payload size (bytes) (integer) +#payload-size=1316 + +# SRT maximum bandwidth ceiling (bytes) (integer) +#bandwidth-overhead-limit=25 + +# Crypto key length in bytes (integer) +#key-length=16 + +# SRT Stream ID (string) +#streamid= + +[access_output_livehttp] # HTTP Live streaming output + +# Segment length (integer) +#sout-livehttp-seglen=10 + +# Number of segments (integer) +#sout-livehttp-numsegs=0 + +# Number of first segment (integer) +#sout-livehttp-initial-segment-number=1 + +# Split segments anywhere (boolean) +#sout-livehttp-splitanywhere=0 + +# Delete segments (boolean) +#sout-livehttp-delsegs=1 + +# Use muxers rate control mechanism (boolean) +#sout-livehttp-ratecontrol=0 + +# Allow cache (boolean) +#sout-livehttp-caching=0 + +# Use randomized IV for encryption (boolean) +#sout-livehttp-generate-iv=0 + +# Index file (string) +#sout-livehttp-index= + +# Full URL to put in index file (string) +#sout-livehttp-index-url= + +# AES key URI to place in playlist (string) +#sout-livehttp-key-uri= + +# AES key file (string) +#sout-livehttp-key-file= + +# File where vlc reads key-uri and keyfile-location (string) +#sout-livehttp-key-loadfile= + +[mpegvideo] # MPEG-I/II video packetizer + +# Sync on Intra Frame (boolean) +#packetizer-mpegvideo-sync-iframe=0 + +[erase] # Erase video filter + +# Image mask (string) +#erase-mask= + +# X coordinate (integer) +#erase-x=0 + +# Y coordinate (integer) +#erase-y=0 + +[deinterlace] # Deinterlacing video filter + +# Streaming deinterlace mode (string) +#sout-deinterlace-mode=blend + +# Phosphor chroma mode for 4:2:0 input (integer) +#sout-deinterlace-phosphor-chroma=2 + +# Phosphor old field dimmer strength (integer) +#sout-deinterlace-phosphor-dimmer=2 + +[extract] # Extract RGB component video filter + +# RGB component to extract (integer) +#extract-component=16711680 + +[postproc] # Video post processing filter + +# Post processing quality (integer) +#postproc-q=6 + +# FFmpeg post processing filter chains (string) +#postproc-name=default + +[sepia] # Sepia video filter + +# Sepia intensity (integer) +#sepia-intensity=120 + +[posterize] # Posterize video filter + +# Posterize level (integer) +#posterize-level=6 + +[transform] # Video transformation filter + +# Transform type (string) +#transform-type=90 + +[gradient] # Gradient video filter + +# Distort mode (string) +#gradient-mode=gradient + +# Gradient image type (integer) +#gradient-type=0 + +# Apply cartoon effect (boolean) +#gradient-cartoon=1 + +[gaussianblur] # Gaussian blur video filter + +# Gaussian's std deviation (float) +#gaussianblur-sigma=2.000000 + +[bluescreen] # Bluescreen video filter + +# Bluescreen U value (integer) +#bluescreen-u=120 + +# Bluescreen V value (integer) +#bluescreen-v=90 + +# Bluescreen U tolerance (integer) +#bluescreen-ut=17 + +# Bluescreen V tolerance (integer) +#bluescreen-vt=17 + +[mirror] # Mirror video filter + +# Mirror orientation (integer) +#mirror-split=0 + +# Direction (integer) +#mirror-direction=0 + +[hqdn3d] # High Quality 3D Denoiser filter + +# Spatial luma strength (0-254) (float) +#hqdn3d-luma-spat=4.000000 + +# Spatial chroma strength (0-254) (float) +#hqdn3d-chroma-spat=3.000000 + +# Temporal luma strength (0-254) (float) +#hqdn3d-luma-temp=6.000000 + +# Temporal chroma strength (0-254) (float) +#hqdn3d-chroma-temp=4.500000 + +[adjust] # Image properties filter + +# Image contrast (0-2) (float) +#contrast=1.000000 + +# Image brightness (0-2) (float) +#brightness=1.000000 + +# Image hue (-180..180) (float) +#hue=0.000000 + +# Image saturation (0-3) (float) +#saturation=1.000000 + +# Image gamma (0-10) (float) +#gamma=1.000000 + +# Brightness threshold (boolean) +#brightness-threshold=0 + +[colorthres] # Color threshold filter + +# Color (integer) +#colorthres-color=16711680 + +# Saturation threshold (integer) +#colorthres-saturationthres=20 + +# Similarity threshold (integer) +#colorthres-similaritythres=15 + +[canvas] # Canvas video filter + +# Output width (integer) +#canvas-width=0 + +# Output height (integer) +#canvas-height=0 + +# Output picture aspect ratio (string) +#canvas-aspect= + +# Pad video (boolean) +#canvas-padd=1 + +[anaglyph] # Convert 3D picture to anaglyph image video filter + +# Color scheme (string) +#anaglyph-scheme=red-cyan + +[gradfun] # Gradfun video filter + +# Radius (integer) +#gradfun-radius=16 + +# Strength (float) +#gradfun-strength=1.200000 + +[alphamask] # Alpha mask video filter + +# Transparency mask (string) +#alphamask-mask= + +[grain] # Grain video filter + +# Variance (float) +#grain-variance=2.000000 + +# Minimal period (integer) +#grain-period-min=1 + +# Maximal period (integer) +#grain-period-max=48 + +[sharpen] # Sharpen video filter + +# Sharpen strength (0-2) (float) +#sharpen-sigma=0.050000 + +[puzzle] # Puzzle interactive game video filter + +# Number of puzzle rows (integer) +#puzzle-rows=4 + +# Number of puzzle columns (integer) +#puzzle-cols=4 + +# Border (integer) +#puzzle-border=3 + +# Small preview (boolean) +#puzzle-preview=0 + +# Small preview size (integer) +#puzzle-preview-size=15 + +# Piece edge shape size (integer) +#puzzle-shape-size=90 + +# Auto shuffle (integer) +#puzzle-auto-shuffle=0 + +# Auto solve (integer) +#puzzle-auto-solve=0 + +# Rotation (integer) +#puzzle-rotation=0 + +# Game mode (integer) +#puzzle-mode=0 + +[ball] # Ball video filter + +# Ball color (string) +#ball-color=red + +# Ball speed (integer) +#ball-speed=4 + +# Ball size (integer) +#ball-size=10 + +# Gradient threshold (integer) +#ball-gradient-threshold=40 + +# Edge visible (boolean) +#ball-edge-visible=1 + +[croppadd] # Video cropping filter + +# Pixels to crop from top (integer) +#croppadd-croptop=0 + +# Pixels to crop from bottom (integer) +#croppadd-cropbottom=0 + +# Pixels to crop from left (integer) +#croppadd-cropleft=0 + +# Pixels to crop from right (integer) +#croppadd-cropright=0 + +# Pixels to padd to top (integer) +#croppadd-paddtop=0 + +# Pixels to padd to bottom (integer) +#croppadd-paddbottom=0 + +# Pixels to padd to left (integer) +#croppadd-paddleft=0 + +# Pixels to padd to right (integer) +#croppadd-paddright=0 + +[motionblur] # Motion blur filter + +# Blur factor (1-127) (integer) +#blur-factor=80 + +[rotate] # Rotate video filter + +# Angle in degrees (float) +#rotate-angle=30.000000 + +# Use motion sensors (boolean) +#rotate-use-motion=0 + +[scene] # Scene video filter + +# Image format (string) +#scene-format=png + +# Image width (integer) +#scene-width=-1 + +# Image height (integer) +#scene-height=-1 + +# Filename prefix (string) +#scene-prefix=scene + +# Directory path prefix (string) +#scene-path= + +# Always write to the same file (boolean) +#scene-replace=0 + +# Recording ratio (integer) +#scene-ratio=50 + +[antiflicker] # antiflicker video filter + +# Window size (integer) +#antiflicker-window-size=10 + +# Softening value (integer) +#antiflicker-softening-size=10 + +[fps] # FPS conversion video filter + +# Frame rate (string) +#fps-fps= + +[blendbench] # Blending benchmark filter + +# Number of time to blend (integer) +#blendbench-loops=1000 + +# Alpha of the blended image (integer) +#blendbench-alpha=128 + +# Image to be blended onto (string) +#blendbench-base-image= + +# Chroma for the base image (string) +#blendbench-base-chroma=I420 + +# Image which will be blended (string) +#blendbench-blend-image= + +# Chroma for the blend image (string) +#blendbench-blend-chroma=YUVA + +[sap] # Network streams (SAP) + +# SAP multicast address (string) +#sap-addr= + +# SAP timeout (seconds) (integer) +#sap-timeout=1800 + +# Try to parse the announce (boolean) +#sap-parse=1 + +# SAP Strict mode (boolean) +#sap-strict=0 + +[podcast] # Podcasts + +# Podcast URLs list (string) +#podcast-urls= + +[upnp] # Universal Plug'n'Play + +# SAT>IP channel list (string) +#satip-channelist=auto + +# Custom SAT>IP channel list URL (string) +#satip-channellist-url= + +[notify] # LibNotify Notification Plugin + +# Timeout (ms) (integer) +#notify-timeout=4000 + +[lua] # Lua interpreter + +# Lua interface (string) +#lua-intf=dummy + +# Lua interface configuration (string) +#lua-config= + +# Password (string) +#http-password= + +# Source directory (string) +#http-src= + +# Directory index (boolean) +#http-index=0 + +# TCP command input (string) +#rc-host= + +# CLI input (string) +#cli-host= + +# Host (string) +#telnet-host=localhost + +# Port (integer) +#telnet-port=4212 + +# Password (string) +#telnet-password= + +[gain] # Gain control filter + +# Gain multiplier (float) +#gain-value=1.000000 + +[equalizer] # Equalizer with 10 bands + +# Equalizer preset (string) +#equalizer-preset=flat + +# Bands gain (string) +#equalizer-bands= + +# Two pass (boolean) +#equalizer-2pass=0 + +# Use VLC frequency bands (boolean) +#equalizer-vlcfreqs=1 + +# Global gain (float) +#equalizer-preamp=12.000000 + +[compressor] # Dynamic range compressor + +# RMS/peak (float) +compressor-rms-peak=0.000000 + +# Attack time (float) +compressor-attack=10.000000 + +# Release time (float) +compressor-release=300.100006 + +# Threshold level (float) +compressor-threshold=-24.049999 + +# Ratio (float) +compressor-ratio=20.000000 + +# Knee radius (float) +compressor-knee=1.530000 + +# Makeup gain (float) +compressor-makeup-gain=10.010000 + +[speex_resampler] # Speex resampler + +# Resampling quality (integer) +#speex-resampler-quality=4 + +[remap] # Audio channel remapper + +# Left (integer) +#aout-remap-channel-left=0 + +# Center (integer) +#aout-remap-channel-center=1 + +# Right (integer) +#aout-remap-channel-right=2 + +# Rear left (integer) +#aout-remap-channel-rearleft=3 + +# Rear center (integer) +#aout-remap-channel-rearcenter=4 + +# Rear right (integer) +#aout-remap-channel-rearright=5 + +# Side left (integer) +#aout-remap-channel-middleleft=6 + +# Side right (integer) +#aout-remap-channel-middleright=7 + +# Low-frequency effects (integer) +#aout-remap-channel-lfe=8 + +# Normalize channels (boolean) +#aout-remap-normalize=1 + +[soxr] # soxr + +# Resampling quality (integer) +#soxr-resampler-quality=2 + +[spatialaudio] # Ambisonics renderer and binauralizer + +# Headphones mode (binaural) (boolean) +#spatialaudio-headphones=0 + +# HRTF file for the binauralization (string) +#hrtf-file= + +[normvol] # Volume normalizer + +# Number of audio buffers (integer) +#norm-buff-size=20 + +# Maximal volume level (float) +#norm-max-level=2.000000 + +[samplerate] # Secret Rabbit Code (libsamplerate) resampler + +# Sample rate converter type (integer) +#src-converter-type=2 + +[spatializer] # Audio Spatializer + +# Room size (float) +#spatializer-roomsize=0.850000 + +# Room width (float) +#spatializer-width=1.000000 + +# Wet (float) +#spatializer-wet=0.400000 + +# Dry (float) +#spatializer-dry=0.500000 + +# Damp (float) +#spatializer-damp=0.500000 + +[chorus_flanger] # Sound Delay + +# Delay time (float) +#delay-time=20.000000 + +# Sweep Depth (float) +#sweep-depth=6.000000 + +# Sweep Rate (float) +#sweep-rate=6.000000 + +# Feedback gain (float) +#feedback-gain=0.500000 + +# Wet mix (float) +#wet-mix=0.400000 + +# Dry Mix (float) +#dry-mix=0.400000 + +[param_eq] # Parametric Equalizer + +# Low freq (Hz) (float) +#param-eq-lowf=100.000000 + +# Low freq gain (dB) (float) +#param-eq-lowgain=0.000000 + +# High freq (Hz) (float) +#param-eq-highf=10000.000000 + +# High freq gain (dB) (float) +#param-eq-highgain=0.000000 + +# Freq 1 (Hz) (float) +#param-eq-f1=300.000000 + +# Freq 1 gain (dB) (float) +#param-eq-gain1=0.000000 + +# Freq 1 Q (float) +#param-eq-q1=3.000000 + +# Freq 2 (Hz) (float) +#param-eq-f2=1000.000000 + +# Freq 2 gain (dB) (float) +#param-eq-gain2=0.000000 + +# Freq 2 Q (float) +#param-eq-q2=3.000000 + +# Freq 3 (Hz) (float) +#param-eq-f3=3000.000000 + +# Freq 3 gain (dB) (float) +#param-eq-gain3=0.000000 + +# Freq 3 Q (float) +#param-eq-q3=3.000000 + +[audiobargraph_a] # Audio part of the BarGraph function + +# Defines if BarGraph information should be sent (integer) +#audiobargraph_a-bargraph=1 + +# Sends the barGraph information every n audio packets (integer) +#audiobargraph_a-bargraph_repetition=4 + +# Defines if silence alarm information should be sent (integer) +#audiobargraph_a-silence=1 + +# Time window to use in ms (integer) +#audiobargraph_a-time_window=5000 + +# Minimum Audio level to raise the alarm (float) +#audiobargraph_a-alarm_threshold=0.020000 + +# Time between two alarm messages in ms (integer) +#audiobargraph_a-repetition_time=2000 + +[mono] # Stereo to mono downmixer + +# Use downmix algorithm (boolean) +#sout-mono-downmix=1 + +# Select channel to keep (integer) +#sout-mono-channel=-1 + +[scaletempo_pitch] # Pitch Shifter + +# Stride Length (integer) +#scaletempo-stride=30 + +# Overlap Length (float) +#scaletempo-overlap=0.200000 + +# Search Length (integer) +#scaletempo-search=14 + +# Pitch Shift (float) +#pitch-shift=0.000000 + +[headphone] # Headphone virtual spatialization effect + +# Characteristic dimension (integer) +#headphone-dim=10 + +# Compensate delay (boolean) +#headphone-compensate=0 + +# No decoding of Dolby Surround (boolean) +#headphone-dolby=0 + +[scaletempo] # Audio tempo scaler synched with rate + +# Stride Length (integer) +#scaletempo-stride=30 + +# Overlap Length (float) +#scaletempo-overlap=0.200000 + +# Search Length (integer) +#scaletempo-search=14 + +[stereo_widen] # Simple stereo widening effect + +# Delay time (float) +#stereowiden-delay=20.000000 + +# Feedback gain (float) +#stereowiden-feedback=0.300000 + +# Crossfeed (float) +#stereowiden-crossfeed=0.300000 + +# Dry mix (float) +#stereowiden-dry-mix=0.800000 + +[folder] # Folder meta data + +# Album art filename (string) +#album-art-filename= + +[vdpau_chroma] # VDPAU surface conversions + +# Deinterlace (integer) +#vdpau-deinterlace=1 + +# Inverse telecine (boolean) +#vdpau-ivtc=0 + +# Deinterlace chroma skip (boolean) +#vdpau-chroma-skip=0 + +# Noise reduction level (float) +#vdpau-noise-reduction=0.000000 + +# Scaling quality (integer) +#vdpau-scaling=0 + +[freetype] # Freetype2 font renderer + +# Font (string) +freetype-font=DejaVu Sans + +# Monospace Font (string) +#freetype-monofont=Monospace + +# Font size in pixels (integer) +#freetype-fontsize=0 + +# Relative font size (integer) +#freetype-rel-fontsize=0 + +# Text opacity (integer) +#freetype-opacity=255 + +# Text default color (integer) +#freetype-color=16777215 + +# Force bold (boolean) +#freetype-bold=0 + +# Background opacity (integer) +#freetype-background-opacity=0 + +# Background color (integer) +#freetype-background-color=0 + +# Outline opacity (integer) +#freetype-outline-opacity=255 + +# Outline color (integer) +#freetype-outline-color=0 + +# Outline thickness (integer) +#freetype-outline-thickness=4 + +# Shadow opacity (integer) +#freetype-shadow-opacity=128 + +# Shadow color (integer) +#freetype-shadow-color=0 + +# Shadow angle (float) +#freetype-shadow-angle=-45.000000 + +# Shadow distance (float) +#freetype-shadow-distance=0.060000 + +# Use YUVP renderer (boolean) +#freetype-yuvp=0 + +# Text direction (integer) +#freetype-text-direction=0 + +[svcdsub] # Philips OGT (SVCD subtitle) decoder + +[x264] # H.264/MPEG-4 Part 10/AVC encoder (x264) + +# Maximum GOP size (integer) +#sout-x264-keyint=250 + +# Minimum GOP size (integer) +#sout-x264-min-keyint=25 + +# Use recovery points to close GOPs (boolean) +#sout-x264-opengop=0 + +# Enable compatibility hacks for Blu-ray support (boolean) +#sout-x264-bluray-compat=0 + +# Extra I-frames aggressivity (integer) +#sout-x264-scenecut=40 + +# B-frames between I and P (integer) +#sout-x264-bframes=3 + +# Adaptive B-frame decision (integer) +#sout-x264-b-adapt=1 + +# Influence (bias) B-frames usage (integer) +#sout-x264-b-bias=0 + +# Keep some B-frames as references (string) +#sout-x264-bpyramid=normal + +# CABAC (boolean) +#sout-x264-cabac=1 + +# Use fullrange instead of TV colorrange (boolean) +#sout-x264-fullrange=0 + +# Number of reference frames (integer) +#sout-x264-ref=3 + +# Skip loop filter (boolean) +#sout-x264-nf=0 + +# Loop filter AlphaC0 and Beta parameters alpha:beta (string) +#sout-x264-deblock=0:0 + +# Strength of psychovisual optimization, default is "1.0:0.0" (string) +#sout-x264-psy-rd=1.0:0.0 + +# Use Psy-optimizations (boolean) +#sout-x264-psy=1 + +# H.264 level (string) +#sout-x264-level=0 + +# H.264 profile (string) +#sout-x264-profile=high + +# Interlaced mode (boolean) +#sout-x264-interlaced=0 + +# Frame packing (integer) +#sout-x264-frame-packing=-1 + +# Force number of slices per frame (integer) +#sout-x264-slices=0 + +# Limit the size of each slice in bytes (integer) +#sout-x264-slice-max-size=0 + +# Limit the size of each slice in macroblocks (integer) +#sout-x264-slice-max-mbs=0 + +# HRD-timing information (string) +#sout-x264-hrd=none + +# Set QP (integer) +#sout-x264-qp=-1 + +# Quality-based VBR (integer) +#sout-x264-crf=23 + +# Min QP (integer) +#sout-x264-qpmin=10 + +# Max QP (integer) +#sout-x264-qpmax=51 + +# Max QP step (integer) +#sout-x264-qpstep=4 + +# Average bitrate tolerance (float) +#sout-x264-ratetol=1.000000 + +# Max local bitrate (integer) +#sout-x264-vbv-maxrate=0 + +# VBV buffer (integer) +#sout-x264-vbv-bufsize=0 + +# Initial VBV buffer occupancy (float) +#sout-x264-vbv-init=0.900000 + +# QP factor between I and P (float) +#sout-x264-ipratio=1.400000 + +# QP factor between P and B (float) +#sout-x264-pbratio=1.300000 + +# QP difference between chroma and luma (integer) +#sout-x264-chroma-qp-offset=0 + +# Multipass ratecontrol (integer) +#sout-x264-pass=0 + +# QP curve compression (float) +#sout-x264-qcomp=0.600000 + +# Reduce fluctuations in QP (float) +#sout-x264-cplxblur=20.000000 + +# Reduce fluctuations in QP (float) +#sout-x264-qblur=0.500000 + +# How AQ distributes bits (integer) +#sout-x264-aq-mode=1 + +# Strength of AQ (float) +#sout-x264-aq-strength=1.000000 + +# Partitions to consider (string) +#sout-x264-partitions=normal + +# Direct MV prediction mode (string) +#sout-x264-direct=spatial + +# Direct prediction size (integer) +#sout-x264-direct-8x8=1 + +# Weighted prediction for B-frames (boolean) +#sout-x264-weightb=1 + +# Weighted prediction for P-frames (integer) +#sout-x264-weightp=2 + +# Integer pixel motion estimation method (string) +#sout-x264-me=hex + +# Maximum motion vector search range (integer) +#sout-x264-merange=16 + +# Maximum motion vector length (integer) +#sout-x264-mvrange=-1 + +# Minimum buffer space between threads (integer) +#sout-x264-mvrange-thread=-1 + +# Subpixel motion estimation and partition decision quality (integer) +#sout-x264-subme=7 + +# Decide references on a per partition basis (boolean) +#sout-x264-mixed-refs=1 + +# Chroma in motion estimation (boolean) +#sout-x264-chroma-me=1 + +# Adaptive spatial transform size (boolean) +#sout-x264-8x8dct=1 + +# Trellis RD quantization (integer) +#sout-x264-trellis=1 + +# Framecount to use on frametype lookahead (integer) +#sout-x264-lookahead=40 + +# Use Periodic Intra Refresh (boolean) +#sout-x264-intra-refresh=0 + +# Use mb-tree ratecontrol (boolean) +#sout-x264-mbtree=1 + +# Early SKIP detection on P-frames (boolean) +#sout-x264-fast-pskip=1 + +# Coefficient thresholding on P-frames (boolean) +#sout-x264-dct-decimate=1 + +# Noise reduction (integer) +#sout-x264-nr=0 + +# Inter luma quantization deadzone (integer) +#sout-x264-deadzone-inter=21 + +# Intra luma quantization deadzone (integer) +#sout-x264-deadzone-intra=11 + +# Non-deterministic optimizations when threaded (boolean) +#sout-x264-non-deterministic=0 + +# CPU optimizations (boolean) +#sout-x264-asm=1 + +# PSNR computation (boolean) +#sout-x264-psnr=0 + +# SSIM computation (boolean) +#sout-x264-ssim=0 + +# Quiet mode (boolean) +#sout-x264-quiet=0 + +# SPS and PPS id numbers (integer) +#sout-x264-sps-id=0 + +# Access unit delimiters (boolean) +#sout-x264-aud=0 + +# Statistics (boolean) +#sout-x264-verbose=0 + +# Filename for 2 pass stats file (string) +#sout-x264-stats=x264_2pass.log + +# Default preset setting used (string) +#sout-x264-preset= + +# Default tune setting used (string) +#sout-x264-tune= + +# x264 advanced options (string) +#sout-x264-options= + +[svgdec] # SVG video decoder + +# Image width (integer) +#svg-width=-1 + +# Image height (integer) +#svg-height=-1 + +# Scale factor (float) +#svg-scale=-1.000000 + +[a52] # ATSC A/52 (AC-3) audio decoder + +# A/52 dynamic range compression (boolean) +#a52-dynrng=1 + +[theora] # Theora video decoder + +# Post processing quality (integer) +#theora-postproc=-1 + +# Encoding quality (integer) +#sout-theora-quality=2 + +[jpeg] # JPEG image decoder + +# Quality level (integer) +#sout-jpeg-quality=95 + +[twolame] # Libtwolame audio encoder + +# Encoding quality (float) +#sout-twolame-quality=0.000000 + +# Stereo mode (integer) +#sout-twolame-mode=0 + +# VBR mode (boolean) +#sout-twolame-vbr=0 + +# Psycho-acoustic model (integer) +#sout-twolame-psy=3 + +[ddummy] # Dummy decoder + +# Save raw codec data (boolean) +#dummy-save-es=0 + +[ttml] # TTML subtitles decoder + +# Subtitle justification (integer) +#ttml-align=0 + +[speex] # Speex audio decoder + +# Mode (integer) +#sout-speex-mode=0 + +# Encoding complexity (integer) +#sout-speex-complexity=3 + +# CBR encoding (boolean) +#sout-speex-cbr=0 + +# Encoding quality (float) +#sout-speex-quality=8.000000 + +# Maximal bitrate (integer) +#sout-speex-max-bitrate=0 + +# Voice activity detection (boolean) +#sout-speex-vad=1 + +# Discontinuous Transmission (boolean) +#sout-speex-dtx=0 + +[subsdec] # Text subtitle decoder + +# Subtitle justification (integer) +#subsdec-align=-1 + +# Subtitle text encoding (string) +#subsdec-encoding= + +# UTF-8 subtitle autodetection (boolean) +#subsdec-autodetect-utf8=1 + +[x26410b] # H.264/MPEG-4 Part 10/AVC encoder (x264 10-bit) + +# Maximum GOP size (integer) +#sout-x26410b-keyint=250 + +# Minimum GOP size (integer) +#sout-x26410b-min-keyint=25 + +# Use recovery points to close GOPs (boolean) +#sout-x26410b-opengop=0 + +# Enable compatibility hacks for Blu-ray support (boolean) +#sout-x26410b-bluray-compat=0 + +# Extra I-frames aggressivity (integer) +#sout-x26410b-scenecut=40 + +# B-frames between I and P (integer) +#sout-x26410b-bframes=3 + +# Adaptive B-frame decision (integer) +#sout-x26410b-b-adapt=1 + +# Influence (bias) B-frames usage (integer) +#sout-x26410b-b-bias=0 + +# Keep some B-frames as references (string) +#sout-x26410b-bpyramid=normal + +# CABAC (boolean) +#sout-x26410b-cabac=1 + +# Use fullrange instead of TV colorrange (boolean) +#sout-x26410b-fullrange=0 + +# Number of reference frames (integer) +#sout-x26410b-ref=3 + +# Skip loop filter (boolean) +#sout-x26410b-nf=0 + +# Loop filter AlphaC0 and Beta parameters alpha:beta (string) +#sout-x26410b-deblock=0:0 + +# Strength of psychovisual optimization, default is "1.0:0.0" (string) +#sout-x26410b-psy-rd=1.0:0.0 + +# Use Psy-optimizations (boolean) +#sout-x26410b-psy=1 + +# H.264 level (string) +#sout-x26410b-level=0 + +# H.264 profile (string) +#sout-x26410b-profile=high + +# Interlaced mode (boolean) +#sout-x26410b-interlaced=0 + +# Frame packing (integer) +#sout-x26410b-frame-packing=-1 + +# Force number of slices per frame (integer) +#sout-x26410b-slices=0 + +# Limit the size of each slice in bytes (integer) +#sout-x26410b-slice-max-size=0 + +# Limit the size of each slice in macroblocks (integer) +#sout-x26410b-slice-max-mbs=0 + +# HRD-timing information (string) +#sout-x26410b-hrd=none + +# Set QP (integer) +#sout-x26410b-qp=-1 + +# Quality-based VBR (integer) +#sout-x26410b-crf=23 + +# Min QP (integer) +#sout-x26410b-qpmin=10 + +# Max QP (integer) +#sout-x26410b-qpmax=51 + +# Max QP step (integer) +#sout-x26410b-qpstep=4 + +# Average bitrate tolerance (float) +#sout-x26410b-ratetol=1.000000 + +# Max local bitrate (integer) +#sout-x26410b-vbv-maxrate=0 + +# VBV buffer (integer) +#sout-x26410b-vbv-bufsize=0 + +# Initial VBV buffer occupancy (float) +#sout-x26410b-vbv-init=0.900000 + +# QP factor between I and P (float) +#sout-x26410b-ipratio=1.400000 + +# QP factor between P and B (float) +#sout-x26410b-pbratio=1.300000 + +# QP difference between chroma and luma (integer) +#sout-x26410b-chroma-qp-offset=0 + +# Multipass ratecontrol (integer) +#sout-x26410b-pass=0 + +# QP curve compression (float) +#sout-x26410b-qcomp=0.600000 + +# Reduce fluctuations in QP (float) +#sout-x26410b-cplxblur=20.000000 + +# Reduce fluctuations in QP (float) +#sout-x26410b-qblur=0.500000 + +# How AQ distributes bits (integer) +#sout-x26410b-aq-mode=1 + +# Strength of AQ (float) +#sout-x26410b-aq-strength=1.000000 + +# Partitions to consider (string) +#sout-x26410b-partitions=normal + +# Direct MV prediction mode (string) +#sout-x26410b-direct=spatial + +# Direct prediction size (integer) +#sout-x26410b-direct-8x8=1 + +# Weighted prediction for B-frames (boolean) +#sout-x26410b-weightb=1 + +# Weighted prediction for P-frames (integer) +#sout-x26410b-weightp=2 + +# Integer pixel motion estimation method (string) +#sout-x26410b-me=hex + +# Maximum motion vector search range (integer) +#sout-x26410b-merange=16 + +# Maximum motion vector length (integer) +#sout-x26410b-mvrange=-1 + +# Minimum buffer space between threads (integer) +#sout-x26410b-mvrange-thread=-1 + +# Subpixel motion estimation and partition decision quality (integer) +#sout-x26410b-subme=7 + +# Decide references on a per partition basis (boolean) +#sout-x26410b-mixed-refs=1 + +# Chroma in motion estimation (boolean) +#sout-x26410b-chroma-me=1 + +# Adaptive spatial transform size (boolean) +#sout-x26410b-8x8dct=1 + +# Trellis RD quantization (integer) +#sout-x26410b-trellis=1 + +# Framecount to use on frametype lookahead (integer) +#sout-x26410b-lookahead=40 + +# Use Periodic Intra Refresh (boolean) +#sout-x26410b-intra-refresh=0 + +# Use mb-tree ratecontrol (boolean) +#sout-x26410b-mbtree=1 + +# Early SKIP detection on P-frames (boolean) +#sout-x26410b-fast-pskip=1 + +# Coefficient thresholding on P-frames (boolean) +#sout-x26410b-dct-decimate=1 + +# Noise reduction (integer) +#sout-x26410b-nr=0 + +# Inter luma quantization deadzone (integer) +#sout-x26410b-deadzone-inter=21 + +# Intra luma quantization deadzone (integer) +#sout-x26410b-deadzone-intra=11 + +# Non-deterministic optimizations when threaded (boolean) +#sout-x26410b-non-deterministic=0 + +# CPU optimizations (boolean) +#sout-x26410b-asm=1 + +# PSNR computation (boolean) +#sout-x26410b-psnr=0 + +# SSIM computation (boolean) +#sout-x26410b-ssim=0 + +# Quiet mode (boolean) +#sout-x26410b-quiet=0 + +# SPS and PPS id numbers (integer) +#sout-x26410b-sps-id=0 + +# Access unit delimiters (boolean) +#sout-x26410b-aud=0 + +# Statistics (boolean) +#sout-x26410b-verbose=0 + +# Filename for 2 pass stats file (string) +#sout-x26410b-stats=x264_2pass.log + +# Default preset setting used (string) +#sout-x26410b-preset= + +# Default tune setting used (string) +#sout-x26410b-tune= + +# x264 advanced options (string) +#sout-x26410b-options= + +[libass] # Subtitle renderers using libass + +# Additional fonts directory (string) +#ssa-fontsdir= + +[subsusf] # USF subtitles decoder + +# Formatted Subtitles (boolean) +#subsdec-formatted=1 + +[aribsub] # ARIB subtitles decoder + +# Ignore ruby (furigana) (boolean) +#aribsub-ignore-ruby=0 + +# Use Core Text renderer (boolean) +#aribsub-use-coretext=0 + +[spudec] # DVD subtitles decoder + +# Disable DVD subtitle transparency (boolean) +#dvdsub-transparency=0 + +[dvbsub] # DVB subtitles decoder + +# Subpicture position (integer) +#dvbsub-position=8 + +# Decoding X coordinate (integer) +#dvbsub-x=-1 + +# Decoding Y coordinate (integer) +#dvbsub-y=-1 + +# Encoding X coordinate (integer) +#sout-dvbsub-x=-1 + +# Encoding Y coordinate (integer) +#sout-dvbsub-y=-1 + +[cc] # Closed Captions decoder + +# Opacity (boolean) +#cc-opaque=1 + +[vorbis] # Vorbis audio decoder + +# Encoding quality (integer) +#sout-vorbis-quality=0 + +# Maximum encoding bitrate (integer) +#sout-vorbis-max-bitrate=0 + +# Minimum encoding bitrate (integer) +#sout-vorbis-min-bitrate=0 + +# CBR encoding (boolean) +#sout-vorbis-cbr=0 + +[kate] # Kate overlay decoder + +# Formatted Subtitles (boolean) +#kate-formatted=1 + +[zvbi] # VBI and Teletext decoder + +# Teletext page (integer) +#vbi-page=100 + +# Opacity (boolean) +#vbi-opaque=0 + +# Teletext alignment (integer) +#vbi-position=8 + +# Teletext text subtitles (boolean) +#vbi-text=0 + +# Presentation Level (integer) +#vbi-level=3 + +[avcodec] # FFmpeg audio/video decoder + +# Direct rendering (boolean) +#avcodec-dr=1 + +# Show corrupted frames (boolean) +#avcodec-corrupted=1 + +# Error resilience (integer) +#avcodec-error-resilience=1 + +# Workaround bugs (integer) +#avcodec-workaround-bugs=1 + +# Hurry up (boolean) +#avcodec-hurry-up=1 + +# Skip frame (default=0) (integer) +#avcodec-skip-frame=0 + +# Skip idct (default=0) (integer) +#avcodec-skip-idct=0 + +# Allow speed tricks (boolean) +#avcodec-fast=0 + +# Skip the loop filter for H.264 decoding (integer) +#avcodec-skiploopfilter=0 + +# Debug mask (integer) +#avcodec-debug=0 + +# Codec name (string) +#avcodec-codec= + +# Hardware decoding (string) +#avcodec-hw=any + +# Threads (integer) +#avcodec-threads=0 + +# Advanced options (string) +#avcodec-options= + +# Codec name (string) +#sout-avcodec-codec= + +# Quality level (string) +#sout-avcodec-hq=rd + +# Ratio of key frames (integer) +#sout-avcodec-keyint=0 + +# Ratio of B frames (integer) +#sout-avcodec-bframes=0 + +# Hurry up (boolean) +#sout-avcodec-hurry-up=0 + +# Interlaced encoding (boolean) +#sout-avcodec-interlace=0 + +# Interlaced motion estimation (boolean) +#sout-avcodec-interlace-me=1 + +# Video bitrate tolerance (integer) +#sout-avcodec-vt=0 + +# Pre-motion estimation (boolean) +#sout-avcodec-pre-me=0 + +# Rate control buffer size (integer) +#sout-avcodec-rc-buffer-size=0 + +# Rate control buffer aggressiveness (float) +#sout-avcodec-rc-buffer-aggressivity=1.000000 + +# I quantization factor (float) +#sout-avcodec-i-quant-factor=0.000000 + +# Noise reduction (integer) +#sout-avcodec-noise-reduction=0 + +# MPEG4 quantization matrix (boolean) +#sout-avcodec-mpeg4-matrix=0 + +# Minimum video quantizer scale (integer) +#sout-avcodec-qmin=0 + +# Maximum video quantizer scale (integer) +#sout-avcodec-qmax=0 + +# Trellis quantization (boolean) +#sout-avcodec-trellis=0 + +# Fixed quantizer scale (float) +#sout-avcodec-qscale=3.000000 + +# Strict standard compliance (integer) +#sout-avcodec-strict=0 + +# Luminance masking (float) +#sout-avcodec-lumi-masking=0.000000 + +# Darkness masking (float) +#sout-avcodec-dark-masking=0.000000 + +# Motion masking (float) +#sout-avcodec-p-masking=0.000000 + +# Border masking (float) +#sout-avcodec-border-masking=0.000000 + +# Luminance elimination (integer) +#sout-avcodec-luma-elim-threshold=0 + +# Chrominance elimination (integer) +#sout-avcodec-chroma-elim-threshold=0 + +# Specify AAC audio profile to use (string) +#sout-avcodec-aac-profile=low + +# Advanced options (string) +#sout-avcodec-options= + +[dav1d] # Dav1d video decoder + +# Frames Threads (integer) +#dav1d-thread-frames=0 + +[dca] # DTS Coherent Acoustics audio decoder + +# DTS dynamic range compression (boolean) +#dts-dynrng=1 + +[mux_ogg] # Ogg/OGM muxer + +# Index interval (integer) +#sout-ogg-indexintvl=1000 + +# Index size ratio (float) +#sout-ogg-indexratio=1.000000 + +[asf] # ASF muxer + +# Title (string) +#sout-asf-title= + +# Author (string) +#sout-asf-author= + +# Copyright (string) +#sout-asf-copyright= + +# Comment (string) +#sout-asf-comment= + +# Rating (string) +#sout-asf-rating= + +# Packet Size (integer) +#sout-asf-packet-size=4096 + +# Bitrate override (integer) +#sout-asf-bitrate-override=0 + +[ps] # PS muxer + +# DTS delay (ms) (integer) +#sout-ps-dts-delay=200 + +# PES maximum size (integer) +#sout-ps-pes-max-size=65500 + +[avi] # AVI muxer + +# Artist (string) +#sout-avi-artist= + +# Date (string) +#sout-avi-date= + +# Genre (string) +#sout-avi-genre= + +# Copyright (string) +#sout-avi-copyright= + +# Comment (string) +#sout-avi-comment= + +# Name (string) +#sout-avi-name= + +# Subject (string) +#sout-avi-subject= + +# Encoder (string) +#sout-avi-encoder=VLC Media Player - 3.0.20 Vetinari + +# Keywords (string) +#sout-avi-keywords= + +[mp4] # MP4/MOV muxer + +# Create "Fast Start" files (boolean) +#sout-mp4-faststart=1 + +[mux_ts] # TS muxer (libdvbpsi) + +# Digital TV Standard (string) +#sout-ts-standard=dvb + +# Video PID (integer) +#sout-ts-pid-video=100 + +# Audio PID (integer) +#sout-ts-pid-audio=200 + +# SPU PID (integer) +#sout-ts-pid-spu=300 + +# PMT PID (integer) +#sout-ts-pid-pmt=32 + +# TS ID (integer) +#sout-ts-tsid=0 + +# NET ID (integer) +#sout-ts-netid=0 + +# PMT Program numbers (string) +#sout-ts-program-pmt= + +# Set PID to ID of ES (boolean) +#sout-ts-es-id-pid=0 + +# Mux PMT (requires --sout-ts-es-id-pid) (string) +#sout-ts-muxpmt= + +# SDT Descriptors (requires --sout-ts-es-id-pid) (string) +#sout-ts-sdtdesc= + +# Data alignment (boolean) +#sout-ts-alignment=1 + +# Shaping delay (ms) (integer) +#sout-ts-shaping=200 + +# Use keyframes (boolean) +#sout-ts-use-key-frames=0 + +# PCR interval (ms) (integer) +#sout-ts-pcr=70 + +# Minimum B (deprecated) (integer) +#sout-ts-bmin=0 + +# Maximum B (deprecated) (integer) +#sout-ts-bmax=0 + +# DTS delay (ms) (integer) +#sout-ts-dts-delay=400 + +# Crypt audio (boolean) +#sout-ts-crypt-audio=1 + +# Crypt video (boolean) +#sout-ts-crypt-video=1 + +# CSA Key (string) +#sout-ts-csa-ck= + +# Second CSA Key (string) +#sout-ts-csa2-ck= + +# CSA Key in use (string) +#sout-ts-csa-use=1 + +# Packet size in bytes to encrypt (integer) +#sout-ts-csa-pkt=188 + +[qt] # Qt interface + +# Start in minimal view (without menus) (boolean) +#qt-minimal-view=0 + +# Systray icon (boolean) +#qt-system-tray=1 + +# Show notification popup on track change (integer) +#qt-notification=1 + +# Start VLC with only a systray icon (boolean) +#qt-start-minimized=0 + +# Pause the video playback when minimized (boolean) +#qt-pause-minimized=0 + +# Windows opacity between 0.1 and 1 (float) +#qt-opacity=1.000000 + +# Fullscreen controller opacity between 0.1 and 1 (float) +#qt-fs-opacity=0.800000 + +# Resize interface to the native video size (boolean) +#qt-video-autoresize=1 + +# Show playing item name in window title (boolean) +#qt-name-in-title=1 + +# Show a controller in fullscreen mode (boolean) +#qt-fs-controller=1 + +# Save the recently played items in the menu (boolean) +#qt-recentplay=1 + +# List of words separated by | to filter (string) +#qt-recentplay-filter= + +# Continue playback? (integer) +#qt-continue=1 + +# Embed the file browser in open dialog (boolean) +#qt-embedded-open=0 + +# Show advanced preferences over simple ones (boolean) +#qt-advanced-pref=0 + +# Show unimportant error and warnings dialogs (boolean) +#qt-error-dialogs=1 + +# Define the colors of the volume slider (string) +#qt-slider-colours=153;210;153;20;210;20;255;199;15;245;39;29 + +# Ask for network policy at start (boolean) +qt-privacy-ask=0 + +# Define which screen fullscreen goes (integer) +#qt-fullscreen-screennumber=-1 + +# Load extensions on startup (boolean) +#qt-autoload-extensions=1 + +# Display background cone or art (boolean) +#qt-bgcone=1 + +# Expanding background cone or art (boolean) +#qt-bgcone-expands=0 + +# Allow automatic icon changes (boolean) +#qt-icon-change=1 + +# Maximum Volume displayed (integer) +#qt-max-volume=125 + +# Fullscreen controller mouse sensitivity (integer) +#qt-fs-sensitivity=3 + +# When to raise the interface (integer) +#qt-auto-raise=1 + +[skins2] # Skinnable Interface + +# Skin to use (string) +#skins2-last= + +# Config of last used skin (string) +#skins2-config= + +# Enable transparency effects (boolean) +#skins2-transparency=0 + +# Use a skinned playlist (boolean) +#skinned-playlist=1 + +# Display video in a skinned window if any (boolean) +#skinned-video=1 + +[ncurses] # Ncurses interface + +# Filebrowser starting point (string) +#browse-dir= + +[stats] # Writes statistic info about stream + +# Output file (string) +#sout-stats-output= + +# Prefix to show on output line (string) +#sout-stats-prefix=stats + +[smem] # Stream output to memory buffer + +# Time Synchronized output (boolean) +#sout-smem-time-sync=1 + +[stream_out_standard] # Standard stream output + +# Output access method (string) +#sout-standard-access= + +# Output muxer (string) +#sout-standard-mux= + +# Output destination (string) +#sout-standard-dst= + +# Address to bind to (helper setting for dst) (string) +#sout-standard-bind= + +# Filename for stream (helper setting for dst) (string) +#sout-standard-path= + +# SAP announcing (boolean) +#sout-standard-sap=0 + +# Session name (string) +#sout-standard-name= + +# Session description (string) +#sout-standard-description= + +# Session URL (string) +#sout-standard-url= + +# Session email (string) +#sout-standard-email= + +[mosaic_bridge] # Mosaic bridge stream output + +# ID (string) +#sout-mosaic-bridge-id=Id + +# Video width (integer) +#sout-mosaic-bridge-width=0 + +# Video height (integer) +#sout-mosaic-bridge-height=0 + +# Sample aspect ratio (string) +#sout-mosaic-bridge-sar=1:1 + +# Image chroma (string) +#sout-mosaic-bridge-chroma= + +# Video filter (string) +#sout-mosaic-bridge-vfilter= + +# Transparency (integer) +#sout-mosaic-bridge-alpha=255 + +# X offset (integer) +#sout-mosaic-bridge-x=-1 + +# Y offset (integer) +#sout-mosaic-bridge-y=-1 + +[stream_out_chromaprint] # Chromaprint stream output + +# Duration of the fingerprinting (integer) +#duration=90 + +[setid] # Change the id of an elementary stream + +# Elementary Stream ID (integer) +#sout-setid-id=0 + +# New ES ID (integer) +#sout-setid-new-id=0 + +# Elementary Stream ID (integer) +#sout-setlang-id=0 + +# Language (string) +#sout-setlang-lang=eng + +[display] # Display stream output + +# Enable audio (boolean) +#sout-display-audio=1 + +# Enable video (boolean) +#sout-display-video=1 + +# Delay (ms) (integer) +#sout-display-delay=100 + +[es] # Elementary stream output + +# Output access method (string) +#sout-es-access= + +# Output muxer (string) +#sout-es-mux= + +# Output URL (string) +#sout-es-dst= + +# Audio output access method (string) +#sout-es-access-audio= + +# Audio output muxer (string) +#sout-es-mux-audio= + +# Audio output URL (string) +#sout-es-dst-audio= + +# Video output access method (string) +#sout-es-access-video= + +# Video output muxer (string) +#sout-es-mux-video= + +# Video output URL (string) +#sout-es-dst-video= + +[bridge] # Bridge stream output + +# ID (integer) +#sout-bridge-out-id=0 + +# Destination bridge-in name (string) +#sout-bridge-out-in-name=default + +# Delay (integer) +#sout-bridge-in-delay=0 + +# ID Offset (integer) +#sout-bridge-in-id-offset=8192 + +# Name of current instance (string) +#sout-bridge-in-name=default + +# Fallback to placeholder stream when out of data (boolean) +#sout-bridge-in-placeholder=0 + +# Placeholder delay (integer) +#sout-bridge-in-placeholder-delay=200 + +# Wait for I frame before toggling placeholder (boolean) +#sout-bridge-in-placeholder-switch-on-iframe=1 + +[stream_out_chromecast] # Chromecast stream output + +# ? (string) +#sout-chromecast-ip= + +# ? (integer) +#sout-chromecast-port=8009 + +# ? (boolean) +#sout-chromecast-video=1 + +# HTTP port (integer) +#sout-chromecast-http-port=8010 + +# Performance warning (integer) +#sout-chromecast-show-perf-warning=1 + +# Enable Audio passthrough (boolean) +#sout-chromecast-audio-passthrough=0 + +# Conversion quality (integer) +#sout-chromecast-conversion-quality=1 + +[stream_out_transcode] # Transcode stream output + +# Video encoder (string) +#sout-transcode-venc= + +# Destination video codec (string) +#sout-transcode-vcodec= + +# Video bitrate (integer) +#sout-transcode-vb=0 + +# Video scaling (float) +#sout-transcode-scale=0.000000 + +# Video frame-rate (string) +#sout-transcode-fps= + +# Deinterlace video (boolean) +#sout-transcode-deinterlace=0 + +# Deinterlace module (string) +#sout-transcode-deinterlace-module=deinterlace + +# Video width (integer) +#sout-transcode-width=0 + +# Video height (integer) +#sout-transcode-height=0 + +# Maximum video width (integer) +#sout-transcode-maxwidth=0 + +# Maximum video height (integer) +#sout-transcode-maxheight=0 + +# Video filter (string) +#sout-transcode-vfilter= + +# Audio encoder (string) +#sout-transcode-aenc= + +# Destination audio codec (string) +#sout-transcode-acodec= + +# Audio bitrate (integer) +#sout-transcode-ab=96 + +# Audio language (string) +#sout-transcode-alang= + +# Audio channels (integer) +#sout-transcode-channels=0 + +# Audio sample rate (integer) +#sout-transcode-samplerate=0 + +# Audio filter (string) +#sout-transcode-afilter= + +# Subtitle encoder (string) +#sout-transcode-senc= + +# Destination subtitle codec (string) +#sout-transcode-scodec= + +# Destination subtitle codec (boolean) +#sout-transcode-soverlay=0 + +# Overlays (string) +#sout-transcode-sfilter= + +# Number of threads (integer) +#sout-transcode-threads=0 + +# Picture pool size (integer) +#sout-transcode-pool-size=10 + +# High priority (boolean) +#sout-transcode-high-priority=0 + +[record] # Record stream output + +# Destination prefix (string) +#sout-record-dst-prefix= + +[stream_out_rtp] # RTP stream output + +# Destination (string) +#sout-rtp-dst= + +# SDP (string) +#sout-rtp-sdp= + +# Muxer (string) +#sout-rtp-mux= + +# SAP announcing (boolean) +#sout-rtp-sap=0 + +# Session name (string) +#sout-rtp-name= + +# Session category (string) +#sout-rtp-cat= + +# Session description (string) +#sout-rtp-description= + +# Session URL (string) +#sout-rtp-url= + +# Session email (string) +#sout-rtp-email= + +# Transport protocol (string) +#sout-rtp-proto=udp + +# Port (integer) +#sout-rtp-port=5004 + +# Audio port (integer) +#sout-rtp-port-audio=0 + +# Video port (integer) +#sout-rtp-port-video=0 + +# Hop limit (TTL) (integer) +#sout-rtp-ttl=-1 + +# RTP/RTCP multiplexing (boolean) +#sout-rtp-rtcp-mux=0 + +# Caching value (ms) (integer) +#sout-rtp-caching=300 + +# SRTP key (hexadecimal) (string) +#sout-rtp-key= + +# SRTP salt (hexadecimal) (string) +#sout-rtp-salt= + +# MP4A LATM (boolean) +#sout-rtp-mp4a-latm=0 + +# RTSP session timeout (s) (integer) +#rtsp-timeout=60 + +# Username (string) +#sout-rtsp-user= + +# Password (string) +#sout-rtsp-pwd= + +[delay] # Delay a stream + +# Elementary Stream ID (integer) +#sout-delay-id=0 + +# Delay of the ES (ms) (integer) +#sout-delay-delay=0 + +[vnc] # VNC client access + +# Username (string) +#rfb-user= + +# Password (string) +#rfb-password= + +# X.509 Certificate Authority (string) +#rfb-x509-ca= + +# X.509 Certificate Revocation List (string) +#rfb-x509-crl= + +# X.509 Client certificate (string) +#rfb-x509-client-cert= + +# X.509 Client private key (string) +#rfb-x509-client-key= + +# Frame rate (float) +#rfb-fps=5.000000 + +# Frame buffer depth (string) +#rfb-chroma=RV32 + +# Compression level (integer) +#rfb-compress-level=0 + +# Image quality (integer) +#rfb-quality-level=9 + +[xcb_screen] # Screen capture (with X11/XCB) + +# Frame rate (float) +#screen-fps=2.000000 + +# Region left column (integer) +#screen-left=0 + +# Region top row (integer) +#screen-top=0 + +# Capture region width (integer) +#screen-width=0 + +# Capture region height (integer) +#screen-height=0 + +# Follow the mouse (boolean) +#screen-follow-mouse=0 + +[vdr] # VDR recordings + +# Chapter offset in ms (integer) +#vdr-chapter-offset=0 + +# Frame rate (float) +#vdr-fps=25.000000 + +[dvb] # DVB input with v4l2 support + +# Probe DVB card for capabilities (boolean) +#dvb-probe=1 + +# Satellite scanning config (string) +#dvb-satellite= + +# Scan tuning list (string) +#dvb-scanlist= + +# Use NIT for scanning services (boolean) +#dvb-scan-nit=1 + +[http] # HTTP input + +# Auto re-connect (boolean) +#http-reconnect=0 + +[udp] # UDP input + +# UDP Source timeout (sec) (integer) +#udp-timeout=-1 + +[shm] # Shared memory framebuffer + +# Frame rate (float) +#shm-fps=10.000000 + +# Frame buffer depth (integer) +#shm-depth=0 + +# Frame buffer width (integer) +#shm-width=800 + +# Frame buffer height (integer) +#shm-height=480 + +[smb] # SMB input + +# Username (string) +#smb-user= + +# Password (string) +#smb-pwd= + +# SMB domain (string) +#smb-domain= + +[linsys_sdi] # SDI Input + +# Link # (integer) +#linsys-sdi-link=0 + +# Video ID (integer) +#linsys-sdi-id-video=0 + +# Aspect ratio (string) +#linsys-sdi-aspect-ratio= + +# Audio configuration (string) +#linsys-sdi-audio=0=1,1 + +# Teletext configuration (string) +#linsys-sdi-telx= + +# Teletext language (string) +#linsys-sdi-telx-lang= + +[ftp] # FTP input + +# Username (string) +#ftp-user= + +# Password (string) +#ftp-pwd= + +# FTP account (string) +#ftp-account=anonymous + +[dtv] # Digital Television and Radio + +# DVB adapter (integer) +#dvb-adapter=0 + +# DVB device (integer) +#dvb-device=0 + +# Do not demultiplex (boolean) +#dvb-budget-mode=0 + +# Frequency (Hz) (integer) +#dvb-frequency=0 + +# Spectrum inversion (integer) +#dvb-inversion=-1 + +# Bandwidth (MHz) (integer) +#dvb-bandwidth=0 + +# Transmission mode (integer) +#dvb-transmission=0 + +# Guard interval (string) +#dvb-guard= + +# High-priority code rate (string) +#dvb-code-rate-hp= + +# Low-priority code rate (string) +#dvb-code-rate-lp= + +# Hierarchy mode (integer) +#dvb-hierarchy=-1 + +# DVB-T2 Physical Layer Pipe (integer) +#dvb-plp-id=0 + +# Layer A modulation (string) +#dvb-a-modulation= + +# Layer A code rate (string) +#dvb-a-fec= + +# Layer A segments count (integer) +#dvb-a-count=0 + +# Layer A time interleaving (integer) +#dvb-a-interleaving=0 + +# Layer B modulation (string) +#dvb-b-modulation= + +# Layer B code rate (string) +#dvb-b-fec= + +# Layer B segments count (integer) +#dvb-b-count=0 + +# Layer B time interleaving (integer) +#dvb-b-interleaving=0 + +# Layer C modulation (string) +#dvb-c-modulation= + +# Layer C code rate (string) +#dvb-c-fec= + +# Layer C segments count (integer) +#dvb-c-count=0 + +# Layer C time interleaving (integer) +#dvb-c-interleaving=0 + +# Modulation / Constellation (string) +#dvb-modulation= + +# Symbol rate (bauds) (integer) +#dvb-srate=0 + +# FEC code rate (string) +#dvb-fec= + +# Stream identifier (integer) +#dvb-stream=0 + +# Pilot (integer) +#dvb-pilot=-1 + +# Roll-off factor (integer) +#dvb-rolloff=-1 + +# Transport stream ID (integer) +#dvb-ts-id=0 + +# Polarization (Voltage) (string) +#dvb-polarization= + +# (integer) +#dvb-voltage=13 + +# High LNB voltage (boolean) +#dvb-high-voltage=0 + +# Local oscillator low frequency (kHz) (integer) +#dvb-lnb-low=0 + +# Local oscillator high frequency (kHz) (integer) +#dvb-lnb-high=0 + +# Universal LNB switch frequency (kHz) (integer) +#dvb-lnb-switch=11700000 + +# DiSEqC LNB number (integer) +#dvb-satno=0 + +# Uncommitted DiSEqC LNB number (integer) +#dvb-uncommitted=0 + +# Continuous 22kHz tone (integer) +#dvb-tone=-1 + +[access_srt] # SRT input + +# Return poll wait after timeout milliseconds (-1 = infinite) (integer) +#poll-timeout=-1 + +# SRT latency (ms) (integer) +#latency=120 + +# Password for stream encryption (string) +#passphrase= + +# Crypto key length in bytes (integer) +#key-length=16 + +# SRT Stream ID (string) +#streamid= + +[filesystem] # File input + +# List special files (boolean) +#list-special-files=0 + +[rtp] # Real-Time Protocol (RTP) input + +# RTCP (local) port (integer) +#rtcp-port=0 + +# SRTP key (hexadecimal) (string) +#srtp-key= + +# SRTP salt (hexadecimal) (string) +#srtp-salt= + +# Maximum RTP sources (integer) +#rtp-max-src=1 + +# RTP source timeout (sec) (integer) +#rtp-timeout=5 + +# Maximum RTP sequence number dropout (integer) +#rtp-max-dropout=3000 + +# Maximum RTP sequence number misordering (integer) +#rtp-max-misorder=100 + +# RTP payload format assumed for dynamic payloads (string) +#rtp-dynamic-pt= + +[dvdnav] # DVDnav Input + +# DVD angle (integer) +#dvdnav-angle=1 + +# Start directly in menu (boolean) +#dvdnav-menu=1 + +[access_alsa] # ALSA audio capture + +# Stereo (boolean) +#alsa-stereo=1 + +# Sample rate (integer) +#alsa-samplerate=48000 + +[access_mms] # Microsoft Media Server (MMS) input + +# TCP/UDP timeout (ms) (integer) +#mms-timeout=5000 + +# Force selection of all streams (boolean) +#mms-all=0 + +# Maximum bitrate (integer) +#mms-maxbitrate=0 + +[rist] # RIST input + +# RIST maximum packet size (bytes) (integer) +#packet-size=1472 + +# RIST demux/decode maximum jitter (default is 5ms) (integer) +#maximum-jitter=5 + +# RIST latency (ms) (integer) +#latency=1000 + +# RIST nack retry interval (ms) (integer) +#retry-interval=132 + +# RIST reorder buffer (ms) (integer) +#reorder-buffer=70 + +# RIST maximum retry count (integer) +#max-retries=10 + +# RIST nack type, 0 = range, 1 = bitmask. Default is range (integer) +#nack-type=0 + +# Disable NACK output packets (boolean) +#disable-nacks=0 + +# Do not check for a valid rtcp message from the encoder (boolean) +#mcast-blind-nacks=0 + +[satip] # SAT>IP Receiver Plugin + +# Receive buffer (integer) +#satip-buffer=4194304 + +# Request multicast stream (boolean) +#satip-multicast=0 + +# Host (string) +#satip-host= + +[v4l2] # Video4Linux input + +# Video capture device (string) +#v4l2-dev=/dev/video0 + +# VBI capture device (string) +#v4l2-vbidev= + +# Standard (string) +#v4l2-standard= + +# Video input chroma format (string) +#v4l2-chroma= + +# Input (integer) +#v4l2-input=0 + +# Audio input (integer) +#v4l2-audio-input=-1 + +# Width (integer) +#v4l2-width=0 + +# Height (integer) +#v4l2-height=0 + +# Picture aspect-ratio n:m (string) +#v4l2-aspect-ratio=4:3 + +# Frame rate (string) +#v4l2-fps=60 + +# Radio device (string) +#v4l2-radio-dev=/dev/radio0 + +# Frequency (integer) +#v4l2-tuner-frequency=-1 + +# Audio mode (integer) +#v4l2-tuner-audio-mode=3 + +# Reset controls (boolean) +#v4l2-controls-reset=0 + +# Brightness (integer) +#v4l2-brightness=-1 + +# Automatic brightness (integer) +#v4l2-brightness-auto=-1 + +# Contrast (integer) +#v4l2-contrast=-1 + +# Saturation (integer) +#v4l2-saturation=-1 + +# Hue (integer) +#v4l2-hue=-1 + +# Automatic hue (integer) +#v4l2-hue-auto=-1 + +# White balance temperature (K) (integer) +#v4l2-white-balance-temperature=-1 + +# Automatic white balance (integer) +#v4l2-auto-white-balance=-1 + +# Red balance (integer) +#v4l2-red-balance=-1 + +# Blue balance (integer) +#v4l2-blue-balance=-1 + +# Gamma (integer) +#v4l2-gamma=-1 + +# Automatic gain (integer) +#v4l2-autogain=-1 + +# Gain (integer) +#v4l2-gain=-1 + +# Sharpness (integer) +#v4l2-sharpness=-1 + +# Chroma gain (integer) +#v4l2-chroma-gain=-1 + +# Automatic chroma gain (integer) +#v4l2-chroma-gain-auto=-1 + +# Power line frequency (integer) +#v4l2-power-line-frequency=-1 + +# Backlight compensation (integer) +#v4l2-backlight-compensation=-1 + +# Band-stop filter (integer) +#v4l2-band-stop-filter=-1 + +# Horizontal flip (boolean) +#v4l2-hflip=0 + +# Vertical flip (boolean) +#v4l2-vflip=0 + +# Rotate (degrees) (integer) +#v4l2-rotate=-1 + +# Color killer (integer) +#v4l2-color-killer=-1 + +# Color effect (integer) +#v4l2-color-effect=-1 + +# Audio volume (integer) +#v4l2-audio-volume=-1 + +# Audio balance (integer) +#v4l2-audio-balance=-1 + +# Mute (boolean) +#v4l2-audio-mute=0 + +# Bass level (integer) +#v4l2-audio-bass=-1 + +# Treble level (integer) +#v4l2-audio-treble=-1 + +# Loudness mode (boolean) +#v4l2-audio-loudness=0 + +# v4l2 driver controls (string) +#v4l2-set-ctrls= + +[concat] # Concatenated inputs + +# Inputs list (string) +#concat-list= + +[imem] # Memory input + +# ID (integer) +#imem-id=-1 + +# Group (integer) +#imem-group=0 + +# Category (integer) +#imem-cat=0 + +# Codec (string) +#imem-codec= + +# Language (string) +#imem-language= + +# Sample rate (integer) +#imem-samplerate=0 + +# Channels count (integer) +#imem-channels=0 + +# Width (integer) +#imem-width=0 + +# Height (integer) +#imem-height=0 + +# Display aspect ratio (string) +#imem-dar= + +# Frame rate (string) +#imem-fps= + +# Size (integer) +#imem-size=0 + +[cdda] # Audio CD input + +# Audio CD device (string) +#cd-audio=/dev/sr0 + +# Musicbrainz Server (string) +#musicbrainz-server=musicbrainz.org + +# CDDB Server (string) +#cddb-server=freedb.videolan.org + +# CDDB port (integer) +#cddb-port=80 + +[dvdread] # DVDRead Input (no menu support) + +# DVD angle (integer) +#dvdread-angle=1 + +[timecode] # Time code subpicture elementary stream generator + +# Frame rate (string) +#timecode-fps=25/1 + +[access] # HTTPS input + +# Cookies forwarding (boolean) +#http-forward-cookies=1 + +# User agent (string) +#http-user-agent= + +[linsys_hdsdi] # HD-SDI Input + +# Link # (integer) +#linsys-hdsdi-link=0 + +# Video ID (integer) +#linsys-hdsdi-id-video=0 + +# Aspect ratio (string) +#linsys-hdsdi-aspect-ratio= + +# Audio configuration (string) +#linsys-hdsdi-audio=0=1,1 + +[avio] # libavformat AVIO access + +# Advanced options (string) +#avio-options= + +# Advanced options (string) +#sout-avio-options= + +[sftp] # SFTP input + +# SFTP port (integer) +#sftp-port=22 + +# Username (string) +#sftp-user= + +# Password (string) +#sftp-pwd= + +[libbluray] # Blu-ray Disc support (libbluray) + +# Blu-ray menus (boolean) +#bluray-menu=1 + +# Region code (string) +#bluray-region=B + +[nfs] # NFS input + +# Set NFS uid/guid automatically (boolean) +#nfs-auto-guid=1 + +[clone] # Clone video filter + +# Number of clones (integer) +#clone-count=2 + +# Video output modules (string) +#clone-vout-list= + +[wall] # Wall video filter + +# Number of columns (integer) +#wall-cols=3 + +# Number of rows (integer) +#wall-rows=3 + +# Active windows (string) +#wall-active= + +# Element aspect ratio (string) +#wall-element-aspect=16:9 + +[panoramix] # Panoramix: wall with overlap video filter + +# Number of columns (integer) +#panoramix-cols=-1 + +# Number of rows (integer) +#panoramix-rows=-1 + +# length of the overlapping area (in %) (integer) +#panoramix-bz-length=100 + +# height of the overlapping area (in %) (integer) +#panoramix-bz-height=100 + +# Attenuation (boolean) +#panoramix-attenuate=1 + +# Attenuation, begin (in %) (integer) +#panoramix-bz-begin=0 + +# Attenuation, middle (in %) (integer) +#panoramix-bz-middle=50 + +# Attenuation, end (in %) (integer) +#panoramix-bz-end=100 + +# middle position (in %) (integer) +#panoramix-bz-middle-pos=50 + +# Gamma (Red) correction (float) +#panoramix-bz-gamma-red=1.000000 + +# Gamma (Green) correction (float) +#panoramix-bz-gamma-green=1.000000 + +# Gamma (Blue) correction (float) +#panoramix-bz-gamma-blue=1.000000 + +# Black Crush for Red (integer) +#panoramix-bz-blackcrush-red=140 + +# Black Crush for Green (integer) +#panoramix-bz-blackcrush-green=140 + +# Black Crush for Blue (integer) +#panoramix-bz-blackcrush-blue=140 + +# White Crush for Red (integer) +#panoramix-bz-whitecrush-red=200 + +# White Crush for Green (integer) +#panoramix-bz-whitecrush-green=200 + +# White Crush for Blue (integer) +#panoramix-bz-whitecrush-blue=200 + +# Black Level for Red (integer) +#panoramix-bz-blacklevel-red=150 + +# Black Level for Green (integer) +#panoramix-bz-blacklevel-green=150 + +# Black Level for Blue (integer) +#panoramix-bz-blacklevel-blue=150 + +# White Level for Red (integer) +#panoramix-bz-whitelevel-red=0 + +# White Level for Green (integer) +#panoramix-bz-whitelevel-green=0 + +# White Level for Blue (integer) +#panoramix-bz-whitelevel-blue=0 + +# Active windows (string) +#panoramix-active= + +[syslog] # System logger (syslog) + +# System log (syslog) (boolean) +#syslog=0 + +# Debug messages (boolean) +#syslog-debug=0 + +# Identity (string) +#syslog-ident=vlc + +# Facility (string) +#syslog-facility=user + +[file] # File logger + +# Log to file (boolean) +#file-logging=0 + +# Log filename (string) +#logfile= + +# Log format (string) +#logmode=text + +# Verbosity (integer) +#log-verbose=-1 + +[console] # Console logger + +[prefetch] # Stream prefetch filter + +# Buffer size (integer) +#prefetch-buffer-size=16384 + +# Read size (integer) +#prefetch-read-size=16777216 + +# Seek threshold (integer) +#prefetch-seek-threshold=16384 + +[motion] # motion control interface + +[lirc] # Infrared remote control interface + +# Change the lirc configuration file (string) +#lirc-file= + +[netsync] # Network synchronization + +# Network master clock (boolean) +#netsync-master=0 + +# Master server IP address (string) +#netsync-master-ip= + +# UDP timeout (in ms) (integer) +#netsync-timeout=500 + +[oldrc] # Remote control interface + +# Show stream position (boolean) +#rc-show-pos=0 + +# Fake TTY (boolean) +#rc-fake-tty=0 + +# UNIX socket command input (string) +#rc-unix= + +# TCP command input (string) +#rc-host= + +[gestures] # Mouse gestures control interface + +# Motion threshold (10-100) (integer) +#gestures-threshold=30 + +# Trigger button (string) +#gestures-button=left + +[visual] # Visualizer filter + +# Effects list (string) +#effect-list=spectrum + +# Video width (integer) +#effect-width=800 + +# Video height (integer) +#effect-height=500 + +# FFT window (string) +#effect-fft-window=flat + +# Kaiser window parameter (float) +#effect-kaiser-param=3.000000 + +# Show 80 bands instead of 20 (boolean) +#visual-80-bands=1 + +# Draw peaks in the analyzer (boolean) +#visual-peaks=1 + +# Enable original graphic spectrum (boolean) +#spect-show-original=0 + +# Draw the base of the bands (boolean) +#spect-show-base=1 + +# Base pixel radius (integer) +#spect-radius=42 + +# Spectral sections (integer) +#spect-sections=3 + +# V-plane color (integer) +#spect-color=80 + +# Draw bands in the spectrometer (boolean) +#spect-show-bands=1 + +# Show 80 bands instead of 20 (boolean) +#spect-80-bands=1 + +# Number of blank pixels between bands. (integer) +#spect-separ=1 + +# Amplification (integer) +#spect-amp=8 + +# Draw peaks in the analyzer (boolean) +#spect-show-peaks=1 + +# Peak extra width (integer) +#spect-peak-width=61 + +# Peak height (integer) +#spect-peak-height=1 + +[glspectrum] # 3D OpenGL spectrum visualization + +# Video width (integer) +#glspectrum-width=400 + +# Video height (integer) +#glspectrum-height=300 + +[flaschen] # Flaschen-Taschen video output + +# Flaschen-Taschen display address (string) +#flaschen-display= + +# Width (integer) +#flaschen-width=25 + +# Height (integer) +#flaschen-height=20 + +[wl_shell] # Wayland shell surface + +# Wayland display (string) +#wl-display= + +[gles2] # OpenGL for Embedded Systems 2 video output + +# OpenGL ES 2 extension (string) +#gles2= + +# Open GL/GLES hardware converter (string) +#glconv= + +# Rendering intent for color conversion (integer) +#rendering-intent=1 + +# Display primaries (integer) +#target-prim=0 + +# Display gamma / transfer function (integer) +#target-trc=0 + +# Tone-mapping algorithm (integer) +#tone-mapping=3 + +# Tone-mapping parameter (float) +#tone-mapping-param=0.000000 + +# Highlight clipped pixels (boolean) +#tone-mapping-warn=0 + +# Dithering algorithm (integer) +#dither-algo=-1 + +# Dither depth override (0 = framebuffer depth) (integer) +#dither-depth=0 + +# Desaturation strength (float) +#desat-strength=0.000000 + +# Desaturation exponent (float) +#desat-exponent=0.000000 + +# Desaturation base (float) +#desat-base=0.000000 + +# Maximum brightness boost (float) +#max-boost=0.000000 + +[gl] # OpenGL video output + +# OpenGL extension (string) +#gl= + +# Open GL/GLES hardware converter (string) +#glconv= + +# Rendering intent for color conversion (integer) +#rendering-intent=1 + +# Display primaries (integer) +#target-prim=0 + +# Display gamma / transfer function (integer) +#target-trc=0 + +# Tone-mapping algorithm (integer) +#tone-mapping=3 + +# Tone-mapping parameter (float) +#tone-mapping-param=0.000000 + +# Highlight clipped pixels (boolean) +#tone-mapping-warn=0 + +# Dithering algorithm (integer) +#dither-algo=-1 + +# Dither depth override (0 = framebuffer depth) (integer) +#dither-depth=0 + +# Desaturation strength (float) +#desat-strength=0.000000 + +# Desaturation exponent (float) +#desat-exponent=0.000000 + +# Desaturation base (float) +#desat-base=0.000000 + +# Maximum brightness boost (float) +#max-boost=0.000000 + +[fb] # GNU/Linux framebuffer video output + +# Framebuffer device (string) +#fbdev=/dev/fb0 + +# Run fb on current tty (boolean) +#fb-tty=1 + +# Image format (default RGB) (string) +#fb-chroma= + +# Framebuffer resolution to use (integer) +#fb-mode=4 + +# Framebuffer uses hw acceleration (boolean) +#fb-hw-accel=1 + +[xcb_window] # X11 video window (XCB) + +# X11 display (string) +#x11-display= + +[xcb_xv] # XVideo output (XCB) + +# XVideo adaptor number (integer) +#xvideo-adaptor=-1 + +# XVideo format id (integer) +#xvideo-format-id=0 + +[xcb_x11] # X11 video output (XCB) + +[vmem] # Video memory output + +# Width (integer) +#vmem-width=320 + +# Height (integer) +#vmem-height=200 + +# Pitch (integer) +#vmem-pitch=640 + +# Chroma (string) +#vmem-chroma=RV16 + +[vdummy] # Dummy video output + +# Dummy image chroma format (string) +#dummy-chroma= + +[xdg_shell] # XDG shell surface + +# Wayland display (string) +#wl-display= + +[yuv] # YUV video output + +# device, fifo or filename (string) +#yuv-file=stream.yuv + +# Chroma used (string) +#yuv-chroma= + +# Add a YUV4MPEG2 header (boolean) +#yuv-yuv4mpeg2=0 + +[file] # Secrets are stored on a file without any encryption + +# ? (string) +#keystore-file= + +[swscale] # Video scaling filter + +# Scaling mode (integer) +#swscale-mode=2 + +[audioscrobbler] # Submission of played songs to last.fm + +# Username (string) +#lastfm-username= + +# Password (string) +#lastfm-password= + +# Scrobbler URL (string) +#scrobbler-url=post.audioscrobbler.com + +[gnutls] # GNU TLS transport layer security + +# Use system trust database (boolean) +#gnutls-system-trust=1 + +# Trust directory (string) +#gnutls-dir-trust= + +# TLS cipher priorities (string) +#gnutls-priorities=NORMAL + +[rtsp] # Legacy RTSP VoD server + +# MUX for RAW RTSP transport (string) +#rtsp-raw-mux=ts + +# Maximum number of connections (integer) +#rtsp-throttle-users=0 + +# Sets the timeout option in the RTSP session string (integer) +#rtsp-session-timeout=5 + +[logger] # File logging + +[vaapi_filters] # Video Accelerated API filters + +# Denoise strength (0-2) (float) +#denoise-sigma=1.000000 + +[alsa] # ALSA audio output + +# Audio output device (string) +#alsa-audio-device=default + +# Audio output channels (integer) +#alsa-audio-channels=6 + +# Software gain (float) +#alsa-gain=1.000000 + +[amem] # Audio memory output + +# Sample format (string) +#amem-format=S16N + +# Sample rate (integer) +#amem-rate=44100 + +# Channels count (integer) +#amem-channels=2 + +[afile] # File audio output + +# Output file (string) +#audiofile-file=audiofile.wav + +# Output format (string) +#audiofile-format=s16 + +# Number of output channels (integer) +#audiofile-channels=0 + +# Add WAVE header (boolean) +#audiofile-wav=1 + +[vc1] # VC1 video demuxer + +# Frames per Second (float) +#vc1-fps=25.000000 + +[mp4] # MP4 stream demuxer + +# M4A audio only (boolean) +#mp4-m4a-audioonly=0 + +[ts] # MPEG Transport Stream demuxer + +# Digital TV Standard (string) +#ts-standard=auto + +# Extra PMT (string) +#ts-extra-pmt= + +# Trust in-stream PCR (boolean) +#ts-trust-pcr=1 + +# Set id of ES to PID (boolean) +#ts-es-id-pid=1 + +# CSA Key (string) +#ts-csa-ck= + +# Second CSA Key (string) +#ts-csa2-ck= + +# Packet size in bytes to decrypt (integer) +#ts-csa-pkt=188 + +# Separate sub-streams (boolean) +#ts-split-es=1 + +# Seek based on percent not time (boolean) +#ts-seek-percent=0 + +# Check packets continuity counter (boolean) +#ts-cc-check=1 + +# Only create ES on program sending data (boolean) +#ts-pmtfix-waitdata=1 + +# Try to generate PAT/PMT if missing (boolean) +#ts-patfix=1 + +# Try to fix too early PCR (or late DTS) (boolean) +#ts-pcr-offsetfix=1 + +[rawvid] # Raw video demuxer + +# Frames per Second (string) +#rawvid-fps= + +# Width (integer) +#rawvid-width=0 + +# Height (integer) +#rawvid-height=0 + +# Force chroma (Use carefully) (string) +#rawvid-chroma= + +# Aspect ratio (string) +#rawvid-aspect-ratio= + +[ps] # MPEG-PS demuxer + +# Trust MPEG timestamps (boolean) +#ps-trust-timestamps=1 + +[rawdv] # DV (Digital Video) demuxer + +# Hurry up (boolean) +#rawdv-hurry-up=0 + +[subtitle] # Text subtitle parser + +# Frames per Second (float) +#sub-fps=0.000000 + +# Subtitle delay (integer) +#sub-delay=0 + +# Subtitle format (string) +#sub-type=auto + +# Subtitle description (string) +#sub-description= + +[adaptive] # Unified adaptive streaming for DASH/HLS + +# Adaptive Logic (string) +#adaptive-logic= + +# Maximum device width (integer) +#adaptive-maxwidth=0 + +# Maximum device height (integer) +#adaptive-maxheight=0 + +# Fixed Bandwidth in KiB/s (integer) +#adaptive-bw=250 + +# Use regular HTTP modules (boolean) +#adaptive-use-access=0 + +# Live Playback delay (ms) (integer) +#adaptive-livedelay=15000 + +# Max buffering (ms) (integer) +#adaptive-maxbuffer=30000 + +# Low latency (integer) +#adaptive-lowlatency=-1 + +[avformat] # Avformat demuxer + +# Format name (string) +#avformat-format= + +# Advanced options (string) +#avformat-options= + +# Avformat mux (string) +#sout-avformat-mux= + +# Advanced options (string) +#sout-avformat-options= + +# Reset timestamps (boolean) +#sout-avformat-reset-ts=1 + +[mjpeg] # M-JPEG camera demuxer + +# Frames per Second (float) +#mjpeg-fps=0.000000 + +[rawaud] # Raw audio demuxer + +# Audio channels (integer) +#rawaud-channels=2 + +# Audio samplerate (Hz) (integer) +#rawaud-samplerate=48000 + +# FOURCC code of raw input format (string) +#rawaud-fourcc=s16l + +# Forces the audio language (string) +#rawaud-lang=eng + +[es] # MPEG-I/II/4 / A52 / DTS / MLP audio + +# Frames per Second (float) +#es-fps=25.000000 + +[avi] # AVI demuxer + +# Force interleaved method (boolean) +#avi-interleaved=0 + +# Force index creation (integer) +#avi-index=0 + +[demuxdump] # File dumper + +# Dump module (string) +#demuxdump-access=file + +# Dump filename (string) +#demuxdump-file=stream-demux.dump + +# Append to existing file (boolean) +#demuxdump-append=0 + +[image] # Image demuxer + +# ES ID (integer) +#image-id=-1 + +# Group (integer) +#image-group=0 + +# Decode (boolean) +#image-decode=1 + +# Forced chroma (string) +#image-chroma= + +# Duration in seconds (float) +#image-duration=10.000000 + +# Frame rate (string) +#image-fps=10/1 + +# Real-time (boolean) +#image-realtime=0 + +[mod] # MOD demuxer (libmodplug) + +# Noise reduction (boolean) +#mod-noisereduction=1 + +# Reverb (boolean) +#mod-reverb=0 + +# Reverberation level (integer) +#mod-reverb-level=0 + +# Reverberation delay (integer) +#mod-reverb-delay=40 + +# Mega bass (boolean) +#mod-megabass=0 + +# Mega bass level (integer) +#mod-megabass-level=0 + +# Mega bass cutoff (integer) +#mod-megabass-range=10 + +# Surround (boolean) +#mod-surround=0 + +# Surround level (integer) +#mod-surround-level=0 + +# Surround delay (ms) (integer) +#mod-surround-delay=5 + +[playlist] # Playlist + +# Skip ads (boolean) +#playlist-skip-ads=1 + +# Show shoutcast adult content (boolean) +#shoutcast-show-adult=0 + +[diracsys] # Dirac video demuxer + +# Value to adjust dts by (integer) +#dirac-dts-offset=0 + +[mkv] # Matroska stream demuxer + +# Respect ordered chapters (boolean) +#mkv-use-ordered-chapters=1 + +# Chapter codecs (boolean) +#mkv-use-chapter-codec=1 + +# Preload MKV files in the same directory (boolean) +#mkv-preload-local-dir=1 + +# Seek based on percent not time (boolean) +#mkv-seek-percent=0 + +# Dummy Elements (boolean) +#mkv-use-dummy=0 + +# Preload clusters (boolean) +#mkv-preload-clusters=0 + +[h26x] # H264 video demuxer + +# Frames per Second (float) +#h264-fps=0.000000 + +# Frames per Second (float) +#hevc-fps=0.000000 + +[rss] # RSS and Atom feed display + +# Feed URLs (string) +#rss-urls= + +# X offset (integer) +#rss-x=0 + +# Y offset (integer) +#rss-y=0 + +# Text position (integer) +#rss-position=-1 + +# Opacity (integer) +#rss-opacity=255 + +# Color (integer) +#rss-color=16777215 + +# Font size, pixels (integer) +#rss-size=0 + +# Speed of feeds (integer) +#rss-speed=100000 + +# Max length (integer) +#rss-length=60 + +# Refresh time (integer) +#rss-ttl=1800 + +# Feed images (boolean) +#rss-images=1 + +# Title display mode (integer) +#rss-title=-1 + +[audiobargraph_v] # Audio Bar Graph Video sub source + +# X coordinate (integer) +#audiobargraph_v-x=0 + +# Y coordinate (integer) +#audiobargraph_v-y=0 + +# Transparency of the bargraph (integer) +#audiobargraph_v-transparency=255 + +# Bargraph position (integer) +#audiobargraph_v-position=-1 + +# Bar width in pixel (integer) +#audiobargraph_v-barWidth=10 + +# Bar Height in pixel (integer) +#audiobargraph_v-barHeight=400 + +[logo] # Logo sub source + +# Logo filenames (string) +#logo-file= + +# X coordinate (integer) +#logo-x=-1 + +# Y coordinate (integer) +#logo-y=-1 + +# Logo individual image time in ms (integer) +#logo-delay=1000 + +# Logo animation # of loops (integer) +#logo-repeat=-1 + +# Opacity of the logo (integer) +#logo-opacity=255 + +# Logo position (integer) +#logo-position=-1 + +[subsdelay] # Subtitle delay + +# Delay calculation mode (integer) +#subsdelay-mode=1 + +# Calculation factor (float) +#subsdelay-factor=2.000000 + +# Maximum overlapping subtitles (integer) +#subsdelay-overlap=3 + +# Minimum alpha value (integer) +#subsdelay-min-alpha=70 + +# Interval between two disappearances (integer) +#subsdelay-min-stops=1000 + +# Interval between appearance and disappearance (integer) +#subsdelay-min-start-stop=1000 + +# Interval between disappearance and appearance (integer) +#subsdelay-min-stop-start=1000 + +[mosaic] # Mosaic video sub source + +# Transparency (integer) +#mosaic-alpha=255 + +# Height (integer) +#mosaic-height=100 + +# Width (integer) +#mosaic-width=100 + +# Mosaic alignment (integer) +#mosaic-align=5 + +# Top left corner X coordinate (integer) +#mosaic-xoffset=0 + +# Top left corner Y coordinate (integer) +#mosaic-yoffset=0 + +# Border width (integer) +#mosaic-borderw=0 + +# Border height (integer) +#mosaic-borderh=0 + +# Positioning method (integer) +#mosaic-position=0 + +# Number of rows (integer) +#mosaic-rows=2 + +# Number of columns (integer) +#mosaic-cols=2 + +# Keep aspect ratio (boolean) +#mosaic-keep-aspect-ratio=0 + +# Keep original size (boolean) +#mosaic-keep-picture=0 + +# Elements order (string) +#mosaic-order= + +# Offsets in order (string) +#mosaic-offsets= + +# Delay (integer) +#mosaic-delay=0 + +[remoteosd] # Remote-OSD over VNC + +# VNC Host (string) +#rmtosd-host=myvdr + +# VNC Port (integer) +#rmtosd-port=20001 + +# VNC Password (string) +#rmtosd-password= + +# VNC poll interval (integer) +#rmtosd-update=1000 + +# VNC polling (boolean) +#rmtosd-vnc-polling=0 + +# Mouse events (boolean) +#rmtosd-mouse-events=0 + +# Key events (boolean) +#rmtosd-key-events=0 + +# Alpha transparency value (default 255) (integer) +#rmtosd-alpha=255 + +[dynamicoverlay] # Dynamic video overlay + +# Input FIFO (string) +#overlay-input= + +# Output FIFO (string) +#overlay-output= + +[marq] # Marquee display + +# Text (string) +#marq-marquee=VLC + +# Text file (string) +#marq-file= + +# X offset (integer) +#marq-x=0 + +# Y offset (integer) +#marq-y=0 + +# Marquee position (integer) +#marq-position=-1 + +# Opacity (integer) +#marq-opacity=255 + +# Color (integer) +#marq-color=16777215 + +# Font size, pixels (integer) +#marq-size=0 + +# Timeout (integer) +#marq-timeout=0 + +# Refresh period in ms (integer) +#marq-refresh=1000 + +[core] # core program + +# Enable audio (boolean) +#audio=1 + +# Audio gain (float) +#gain=1.000000 + +# Audio output volume step (float) +#volume-step=12.800000 + +# Remember the audio volume (boolean) +#volume-save=1 + +# Force S/PDIF support (boolean) +#spdif=0 + +# Force detection of Dolby Surround (integer) +#force-dolby-surround=0 + +# Stereo audio output mode (integer) +#stereo-mode=0 + +# Audio desynchronization compensation (integer) +#audio-desync=0 + +# Replay gain mode (string) +#audio-replay-gain-mode=none + +# Replay preamp (float) +#audio-replay-gain-preamp=0.000000 + +# Default replay gain (float) +#audio-replay-gain-default=-7.000000 + +# Peak protection (boolean) +#audio-replay-gain-peak-protection=1 + +# Enable time stretching audio (boolean) +#audio-time-stretch=1 + +# Audio output module (string) +#aout= + +# Media role (string) +#role=video + +# Audio filters (string) +audio-filter=compressor + +# Audio visualizations (string) +#audio-visual=none + +# Audio resampler (string) +#audio-resampler= + +# Enable video (boolean) +#video=1 + +# Grayscale video output (boolean) +#grayscale=0 + +# Fullscreen video output (boolean) +#fullscreen=0 + +# Embedded video (boolean) +#embedded-video=1 + +# (boolean) +#xlib=1 + +# Drop late frames (boolean) +#drop-late-frames=1 + +# Skip frames (boolean) +#skip-frames=1 + +# Quiet synchro (boolean) +#quiet-synchro=0 + +# Key press events (boolean) +#keyboard-events=1 + +# Mouse events (boolean) +#mouse-events=1 + +# Always on top (boolean) +#video-on-top=0 + +# Enable wallpaper mode (boolean) +#video-wallpaper=0 + +# Disable screensaver (boolean) +#disable-screensaver=1 + +# Show media title on video (boolean) +#video-title-show=1 + +# Show video title for x milliseconds (integer) +#video-title-timeout=5000 + +# Position of video title (integer) +#video-title-position=8 + +# Hide cursor and fullscreen controller after x milliseconds (integer) +#mouse-hide-timeout=1000 + +# Video snapshot directory (or filename) (string) +#snapshot-path= + +# Video snapshot file prefix (string) +#snapshot-prefix=vlcsnap- + +# Video snapshot format (string) +#snapshot-format=png + +# Display video snapshot preview (boolean) +#snapshot-preview=1 + +# Use sequential numbers instead of timestamps (boolean) +#snapshot-sequential=0 + +# Video snapshot width (integer) +#snapshot-width=-1 + +# Video snapshot height (integer) +#snapshot-height=-1 + +# Video width (integer) +#width=-1 + +# Video height (integer) +#height=-1 + +# Video X coordinate (integer) +#video-x=0 + +# Video Y coordinate (integer) +#video-y=0 + +# Video cropping (string) +#crop= + +# Custom crop ratios list (string) +#custom-crop-ratios= + +# Source aspect ratio (string) +#aspect-ratio= + +# Video Auto Scaling (boolean) +#autoscale=1 + +# Monitor pixel aspect ratio (string) +#monitor-par= + +# Custom aspect ratios list (string) +#custom-aspect-ratios= + +# Fix HDTV height (boolean) +#hdtv-fix=1 + +# Window decorations (boolean) +#video-deco=1 + +# Video title (string) +#video-title= + +# Video alignment (integer) +#align=0 + +# Zoom video (float) +#zoom=1.000000 + +# Deinterlace (integer) +#deinterlace=-1 + +# Deinterlace mode (string) +#deinterlace-mode=auto + +# Video output module (string) +#vout= + +# Video filter module (string) +#video-filter= + +# Video splitter module (string) +#video-splitter= + +# Enable sub-pictures (boolean) +#spu=1 + +# On Screen Display (boolean) +#osd=1 + +# Text rendering module (string) +#text-renderer= + +# Use subtitle file (string) +#sub-file= + +# Autodetect subtitle files (boolean) +#sub-autodetect-file=1 + +# Subtitle autodetection fuzziness (integer) +#sub-autodetect-fuzzy=3 + +# Subtitle autodetection paths (string) +#sub-autodetect-path=./Subtitles, ./subtitles, ./Subs, ./subs + +# Force subtitle position (integer) +#sub-margin=0 + +# Subpictures source module (string) +#sub-source= + +# Subpictures filter module (string) +#sub-filter= + +# Program (integer) +#program=0 + +# Programs (string) +#programs= + +# Audio track (integer) +#audio-track=-1 + +# Subtitle track (integer) +#sub-track=-1 + +# Audio language (string) +#audio-language= + +# Subtitle language (string) +sub-language=none + +# Menu language (string) +#menu-language= + +# Audio track ID (integer) +#audio-track-id=-1 + +# Subtitle track ID (integer) +#sub-track-id=-1 + +# Preferred Closed Captions decoder (integer) +#captions=608 + +# Preferred video resolution (integer) +#preferred-resolution=-1 + +# Input repetitions (integer) +#input-repeat=0 + +# Start time (float) +#start-time=0.000000 + +# Stop time (float) +#stop-time=0.000000 + +# Run time (float) +#run-time=0.000000 + +# Fast seek (boolean) +#input-fast-seek=0 + +# Playback speed (float) +#rate=1.000000 + +# Input list (string) +#input-list= + +# Input slave (experimental) (string) +#input-slave= + +# Bookmarks list for a stream (string) +#bookmarks= + +# DVD device (string) +#dvd=/dev/sr0 + +# VCD device (string) +#vcd=/dev/sr0 + +# MTU of the network interface (integer) +#mtu=1400 + +# TCP connection timeout (integer) +#ipv4-timeout=5000 + +# HTTP server address (string) +#http-host= + +# HTTP server port (integer) +#http-port=8080 + +# HTTPS server port (integer) +#https-port=8443 + +# RTSP server address (string) +#rtsp-host= + +# RTSP server port (integer) +#rtsp-port=554 + +# HTTP/TLS server certificate (string) +#http-cert= + +# HTTP/TLS server private key (string) +#http-key= + +# SOCKS server (string) +#socks= + +# SOCKS user name (string) +#socks-user= + +# SOCKS password (string) +#socks-pwd= + +# Title metadata (string) +#meta-title= + +# Author metadata (string) +#meta-author= + +# Artist metadata (string) +#meta-artist= + +# Genre metadata (string) +#meta-genre= + +# Copyright metadata (string) +#meta-copyright= + +# Description metadata (string) +#meta-description= + +# Date metadata (string) +#meta-date= + +# URL metadata (string) +#meta-url= + +# File caching (ms) (integer) +#file-caching=1000 + +# Live capture caching (ms) (integer) +#live-caching=300 + +# Disc caching (ms) (integer) +#disc-caching=300 + +# Network caching (ms) (integer) +#network-caching=1000 + +# Clock reference average counter (integer) +#cr-average=40 + +# Clock synchronisation (integer) +#clock-synchro=-1 + +# Clock jitter (integer) +#clock-jitter=5000 + +# Network synchronisation (boolean) +#network-synchronisation=0 + +# Record directory (string) +#input-record-path= + +# Prefer native stream recording (boolean) +#input-record-native=1 + +# Timeshift directory (string) +#input-timeshift-path= + +# Timeshift granularity (integer) +#input-timeshift-granularity=-1 + +# Change title according to current media (string) +#input-title-format=$Z + +# Disable all lua plugins (boolean) +#lua=1 + +# Preferred decoders list (string) +#codec= + +# Preferred encoders list (string) +#encoder= + +# Access module (string) +#access= + +# Demux module (string) +#demux=any + +# Stream filter module (string) +#stream-filter= + +# Demux filter module (string) +#demux-filter= + +# Default stream output chain (string) +#sout= + +# Display while streaming (boolean) +#sout-display=0 + +# Keep stream output open (boolean) +#sout-keep=0 + +# Enable streaming of all ES (boolean) +#sout-all=1 + +# Enable audio stream output (boolean) +#sout-audio=1 + +# Enable video stream output (boolean) +#sout-video=1 + +# Enable SPU stream output (boolean) +#sout-spu=1 + +# Stream output muxer caching (ms) (integer) +#sout-mux-caching=1500 + +# VLM configuration file (string) +#vlm-conf= + +# SAP announcement interval (integer) +#sap-interval=5 + +# Mux module (string) +#mux= + +# Access output module (string) +#access_output= + +# Hop limit (TTL) (integer) +#ttl=-1 + +# Multicast output interface (string) +#miface= + +# DiffServ Code Point (integer) +#dscp=0 + +# Preferred packetizer list (string) +#packetizer= + +# VoD server module (string) +#vod-server= + +# Use a plugins cache (boolean) +#plugins-cache=1 + +# Scan for new plugins (boolean) +#plugins-scan=1 + +# Preferred keystore list (string) +#keystore= + +# Allow real-time priority (boolean) +#rt-priority=0 + +# Adjust VLC priority (integer) +#rt-offset=0 + +# Play files randomly forever (boolean) +#random=0 + +# Repeat all (boolean) +#loop=0 + +# Repeat current item (boolean) +#repeat=0 + +# Play and exit (boolean) +#play-and-exit=0 + +# Play and stop (boolean) +#play-and-stop=0 + +# Play and pause (boolean) +#play-and-pause=0 + +# Start paused (boolean) +#start-paused=0 + +# Auto start (boolean) +#playlist-autostart=1 + +# Pause on audio communication (boolean) +#playlist-cork=1 + +# Allow only one running instance (boolean) +#one-instance=0 + +# Use only one instance when started from file manager (boolean) +#one-instance-when-started-from-file=1 + +# Enqueue items into playlist in one instance mode (boolean) +#playlist-enqueue=0 + +# Expose media player via D-Bus (boolean) +#dbus=0 + +# Use media library (boolean) +#media-library=0 + +# Display playlist tree (boolean) +#playlist-tree=0 + +# Default stream (string) +#open= + +# Automatically preparse items (boolean) +#auto-preparse=1 + +# Preparsing timeout (integer) +#preparse-timeout=5000 + +# Allow metadata network access (boolean) +#metadata-network-access=0 + +# Subdirectory behavior (string) +#recursive=collapse + +# Ignored extensions (string) +#ignore-filetypes=m3u,db,nfo,ini,jpg,jpeg,ljpg,gif,png,pgm,pgmyuv,pbm,pam,tga,bmp,pnm,xpm,xcf,pcx,tif,tiff,lbm,sfv,txt,sub,idx,srt,cue,ssa + +# Show hidden files (boolean) +#show-hiddenfiles=0 + +# Services discovery modules (string) +#services-discovery= + +# Run as daemon process (boolean) +#daemon=0 + +# Write process id to file (string) +#pidfile= + +# Show advanced options (boolean) +#advanced=0 + +# Interface interaction (boolean) +#interact=1 + +# Locally collect statistics (boolean) +#stats=1 + +# Interface module (string) +#intf= + +# Extra interface modules (string) +#extraintf= + +# Control interfaces (string) +#control= + +# Mouse wheel vertical axis control (integer) +#hotkeys-y-wheel-mode=0 + +# Mouse wheel horizontal axis control (integer) +#hotkeys-x-wheel-mode=2 + +# Fullscreen (string) +#global-key-toggle-fullscreen= + +# Fullscreen (string) +#key-toggle-fullscreen=f + +# Exit fullscreen (string) +#global-key-leave-fullscreen= + +# Exit fullscreen (string) +#key-leave-fullscreen=Esc + +# Play/Pause (string) +#global-key-play-pause= + +# Play/Pause (string) +#key-play-pause=Space Media Play Pause + +# Pause only (string) +#global-key-pause= + +# Pause only (string) +#key-pause=Browser Stop + +# Play only (string) +#global-key-play= + +# Play only (string) +#key-play=Browser Refresh + +# Faster (string) +#global-key-faster= + +# Faster (string) +#key-faster=+ + +# Slower (string) +#global-key-slower= + +# Slower (string) +#key-slower=- + +# Normal rate (string) +#global-key-rate-normal= + +# Normal rate (string) +#key-rate-normal== + +# Faster (fine) (string) +#global-key-rate-faster-fine= + +# Faster (fine) (string) +#key-rate-faster-fine=] + +# Slower (fine) (string) +#global-key-rate-slower-fine= + +# Slower (fine) (string) +#key-rate-slower-fine=[ + +# Next (string) +#global-key-next= + +# Next (string) +#key-next=n Media Next Track + +# Previous (string) +#global-key-prev= + +# Previous (string) +#key-prev=p Media Prev Track + +# Stop (string) +#global-key-stop= + +# Stop (string) +#key-stop=s Media Stop + +# Position (string) +#global-key-position= + +# Position (string) +#key-position=t + +# Very short backwards jump (string) +#global-key-jump-extrashort= + +# Very short backwards jump (string) +#key-jump-extrashort=Shift+Left + +# Very short forward jump (string) +#global-key-jump+extrashort= + +# Very short forward jump (string) +#key-jump+extrashort=Shift+Right + +# Short backwards jump (string) +#global-key-jump-short= + +# Short backwards jump (string) +#key-jump-short=Alt+Left + +# Short forward jump (string) +#global-key-jump+short= + +# Short forward jump (string) +#key-jump+short=Alt+Right + +# Medium backwards jump (string) +#global-key-jump-medium= + +# Medium backwards jump (string) +#key-jump-medium=Ctrl+Left + +# Medium forward jump (string) +#global-key-jump+medium= + +# Medium forward jump (string) +#key-jump+medium=Ctrl+Right + +# Long backwards jump (string) +#global-key-jump-long= + +# Long backwards jump (string) +#key-jump-long=Ctrl+Alt+Left + +# Long forward jump (string) +#global-key-jump+long= + +# Long forward jump (string) +#key-jump+long=Ctrl+Alt+Right + +# Next frame (string) +#global-key-frame-next= + +# Next frame (string) +#key-frame-next=e Browser Next + +# Activate (string) +#global-key-nav-activate= + +# Activate (string) +#key-nav-activate=Enter + +# Navigate up (string) +#global-key-nav-up= + +# Navigate up (string) +#key-nav-up=Up + +# Navigate down (string) +#global-key-nav-down= + +# Navigate down (string) +#key-nav-down=Down + +# Navigate left (string) +#global-key-nav-left= + +# Navigate left (string) +#key-nav-left=Left + +# Navigate right (string) +#global-key-nav-right= + +# Navigate right (string) +#key-nav-right=Right + +# Go to the DVD menu (string) +#global-key-disc-menu= + +# Go to the DVD menu (string) +#key-disc-menu=Shift+m + +# Select previous DVD title (string) +#global-key-title-prev= + +# Select previous DVD title (string) +#key-title-prev=Shift+o + +# Select next DVD title (string) +#global-key-title-next= + +# Select next DVD title (string) +#key-title-next=Shift+b + +# Select prev DVD chapter (string) +#global-key-chapter-prev= + +# Select prev DVD chapter (string) +#key-chapter-prev=Shift+p + +# Select next DVD chapter (string) +#global-key-chapter-next= + +# Select next DVD chapter (string) +#key-chapter-next=Shift+n + +# Quit (string) +#global-key-quit= + +# Quit (string) +#key-quit=Ctrl+q + +# Volume up (string) +#global-key-vol-up= + +# Volume up (string) +#key-vol-up=Ctrl+Up Volume Up + +# Volume down (string) +#global-key-vol-down= + +# Volume down (string) +#key-vol-down=Ctrl+Down Volume Down + +# Mute (string) +#global-key-vol-mute= + +# Mute (string) +#key-vol-mute=m Volume Mute + +# Subtitle delay up (string) +#global-key-subdelay-up= + +# Subtitle delay up (string) +#key-subdelay-up=h + +# Subtitle delay down (string) +#global-key-subdelay-down= + +# Subtitle delay down (string) +#key-subdelay-down=g + +# Subtitle sync / bookmark audio timestamp (string) +#global-key-subsync-markaudio= + +# Subtitle sync / bookmark audio timestamp (string) +#key-subsync-markaudio=Shift+h + +# Subtitle sync / bookmark subtitle timestamp (string) +#global-key-subsync-marksub= + +# Subtitle sync / bookmark subtitle timestamp (string) +#key-subsync-marksub=Shift+j + +# Subtitle sync / synchronize audio & subtitle timestamps (string) +#global-key-subsync-apply= + +# Subtitle sync / synchronize audio & subtitle timestamps (string) +#key-subsync-apply=Shift+k + +# Subtitle sync / reset audio & subtitle synchronization (string) +#global-key-subsync-reset= + +# Subtitle sync / reset audio & subtitle synchronization (string) +#key-subsync-reset=Ctrl+Shift+k + +# Subtitle position up (string) +#global-key-subpos-up= + +# Subtitle position up (string) +#key-subpos-up= + +# Subtitle position down (string) +#global-key-subpos-down= + +# Subtitle position down (string) +#key-subpos-down= + +# Audio delay up (string) +#global-key-audiodelay-up= + +# Audio delay up (string) +#key-audiodelay-up=k + +# Audio delay down (string) +#global-key-audiodelay-down= + +# Audio delay down (string) +#key-audiodelay-down=j + +# Cycle audio track (string) +#global-key-audio-track= + +# Cycle audio track (string) +#key-audio-track=b + +# Cycle through audio devices (string) +#global-key-audiodevice-cycle= + +# Cycle through audio devices (string) +#key-audiodevice-cycle=Shift+a + +# Cycle subtitle track in reverse order (string) +#global-key-subtitle-revtrack= + +# Cycle subtitle track in reverse order (string) +#key-subtitle-revtrack=Alt+v + +# Cycle subtitle track (string) +#global-key-subtitle-track= + +# Cycle subtitle track (string) +#key-subtitle-track=v + +# Toggle subtitles (string) +#global-key-subtitle-toggle= + +# Toggle subtitles (string) +#key-subtitle-toggle=Shift+v + +# Cycle next program Service ID (string) +#global-key-program-sid-next= + +# Cycle next program Service ID (string) +#key-program-sid-next=x + +# Cycle previous program Service ID (string) +#global-key-program-sid-prev= + +# Cycle previous program Service ID (string) +#key-program-sid-prev=Shift+x + +# Cycle source aspect ratio (string) +#global-key-aspect-ratio= + +# Cycle source aspect ratio (string) +#key-aspect-ratio=a + +# Cycle video crop (string) +#global-key-crop= + +# Cycle video crop (string) +#key-crop=c + +# Toggle autoscaling (string) +#global-key-toggle-autoscale= + +# Toggle autoscaling (string) +#key-toggle-autoscale=o + +# Increase scale factor (string) +#global-key-incr-scalefactor= + +# Increase scale factor (string) +#key-incr-scalefactor=Alt+o + +# Decrease scale factor (string) +#global-key-decr-scalefactor= + +# Decrease scale factor (string) +#key-decr-scalefactor=Alt+Shift+o + +# Toggle deinterlacing (string) +#global-key-deinterlace= + +# Toggle deinterlacing (string) +#key-deinterlace=d + +# Cycle deinterlace modes (string) +#global-key-deinterlace-mode= + +# Cycle deinterlace modes (string) +#key-deinterlace-mode=Shift+d + +# Show controller in fullscreen (string) +#global-key-intf-show= + +# Show controller in fullscreen (string) +#key-intf-show=i + +# Boss key (string) +#global-key-intf-boss= + +# Boss key (string) +#key-intf-boss= + +# Context menu (string) +#global-key-intf-popup-menu= + +# Context menu (string) +#key-intf-popup-menu=Menu + +# Take video snapshot (string) +#global-key-snapshot= + +# Take video snapshot (string) +#key-snapshot=Shift+s + +# Record (string) +#global-key-record= + +# Record (string) +#key-record=Shift+r + +# Zoom (string) +#global-key-zoom= + +# Zoom (string) +#key-zoom=z + +# Un-Zoom (string) +#global-key-unzoom= + +# Un-Zoom (string) +#key-unzoom=Shift+z + +# Toggle wallpaper mode in video output (string) +#global-key-wallpaper= + +# Toggle wallpaper mode in video output (string) +#key-wallpaper=w + +# Crop one pixel from the top of the video (string) +#global-key-crop-top= + +# Crop one pixel from the top of the video (string) +#key-crop-top=Alt+r + +# Uncrop one pixel from the top of the video (string) +#global-key-uncrop-top= + +# Uncrop one pixel from the top of the video (string) +#key-uncrop-top=Alt+Shift+r + +# Crop one pixel from the left of the video (string) +#global-key-crop-left= + +# Crop one pixel from the left of the video (string) +#key-crop-left=Alt+d + +# Uncrop one pixel from the left of the video (string) +#global-key-uncrop-left= + +# Uncrop one pixel from the left of the video (string) +#key-uncrop-left=Alt+Shift+d + +# Crop one pixel from the bottom of the video (string) +#global-key-crop-bottom= + +# Crop one pixel from the bottom of the video (string) +#key-crop-bottom=Alt+c + +# Uncrop one pixel from the bottom of the video (string) +#global-key-uncrop-bottom= + +# Uncrop one pixel from the bottom of the video (string) +#key-uncrop-bottom=Alt+Shift+c + +# Crop one pixel from the right of the video (string) +#global-key-crop-right= + +# Crop one pixel from the right of the video (string) +#key-crop-right=Alt+f + +# Uncrop one pixel from the right of the video (string) +#global-key-uncrop-right= + +# Uncrop one pixel from the right of the video (string) +#key-uncrop-right=Alt+Shift+f + +# Random (string) +#global-key-random= + +# Random (string) +#key-random=r + +# Normal/Loop/Repeat (string) +#global-key-loop= + +# Normal/Loop/Repeat (string) +#key-loop=l + +# Shrink the viewpoint field of view (360°) (string) +#global-key-viewpoint-fov-in= + +# Shrink the viewpoint field of view (360°) (string) +#key-viewpoint-fov-in=Page Up + +# Expand the viewpoint field of view (360°) (string) +#global-key-viewpoint-fov-out= + +# Expand the viewpoint field of view (360°) (string) +#key-viewpoint-fov-out=Page Down + +# Roll the viewpoint clockwise (360°) (string) +#global-key-viewpoint-roll-clock= + +# Roll the viewpoint clockwise (360°) (string) +#key-viewpoint-roll-clock= + +# Roll the viewpoint anti-clockwise (360°) (string) +#global-key-viewpoint-roll-anticlock= + +# Roll the viewpoint anti-clockwise (360°) (string) +#key-viewpoint-roll-anticlock= + +# 1:4 Quarter (string) +#global-key-zoom-quarter= + +# 1:4 Quarter (string) +#key-zoom-quarter=Alt+1 + +# 1:2 Half (string) +#global-key-zoom-half= + +# 1:2 Half (string) +#key-zoom-half=Alt+2 + +# 1:1 Original (string) +#global-key-zoom-original= + +# 1:1 Original (string) +#key-zoom-original=Alt+3 + +# 2:1 Double (string) +#global-key-zoom-double= + +# 2:1 Double (string) +#key-zoom-double=Alt+4 + +# Very short jump length (integer) +#extrashort-jump-size=3 + +# Short jump length (integer) +#short-jump-size=10 + +# Medium jump length (integer) +#medium-jump-size=60 + +# Long jump length (integer) +#long-jump-size=300 + +# Set playlist bookmark 1 (string) +#global-key-set-bookmark1= + +# Set playlist bookmark 1 (string) +#key-set-bookmark1=Ctrl+F1 + +# Set playlist bookmark 2 (string) +#global-key-set-bookmark2= + +# Set playlist bookmark 2 (string) +#key-set-bookmark2=Ctrl+F2 + +# Set playlist bookmark 3 (string) +#global-key-set-bookmark3= + +# Set playlist bookmark 3 (string) +#key-set-bookmark3=Ctrl+F3 + +# Set playlist bookmark 4 (string) +#global-key-set-bookmark4= + +# Set playlist bookmark 4 (string) +#key-set-bookmark4=Ctrl+F4 + +# Set playlist bookmark 5 (string) +#global-key-set-bookmark5= + +# Set playlist bookmark 5 (string) +#key-set-bookmark5=Ctrl+F5 + +# Set playlist bookmark 6 (string) +#global-key-set-bookmark6= + +# Set playlist bookmark 6 (string) +#key-set-bookmark6=Ctrl+F6 + +# Set playlist bookmark 7 (string) +#global-key-set-bookmark7= + +# Set playlist bookmark 7 (string) +#key-set-bookmark7=Ctrl+F7 + +# Set playlist bookmark 8 (string) +#global-key-set-bookmark8= + +# Set playlist bookmark 8 (string) +#key-set-bookmark8=Ctrl+F8 + +# Set playlist bookmark 9 (string) +#global-key-set-bookmark9= + +# Set playlist bookmark 9 (string) +#key-set-bookmark9=Ctrl+F9 + +# Set playlist bookmark 10 (string) +#global-key-set-bookmark10= + +# Set playlist bookmark 10 (string) +#key-set-bookmark10=Ctrl+F10 + +# Play playlist bookmark 1 (string) +#global-key-play-bookmark1= + +# Play playlist bookmark 1 (string) +#key-play-bookmark1=F1 + +# Play playlist bookmark 2 (string) +#global-key-play-bookmark2= + +# Play playlist bookmark 2 (string) +#key-play-bookmark2=F2 + +# Play playlist bookmark 3 (string) +#global-key-play-bookmark3= + +# Play playlist bookmark 3 (string) +#key-play-bookmark3=F3 + +# Play playlist bookmark 4 (string) +#global-key-play-bookmark4= + +# Play playlist bookmark 4 (string) +#key-play-bookmark4=F4 + +# Play playlist bookmark 5 (string) +#global-key-play-bookmark5= + +# Play playlist bookmark 5 (string) +#key-play-bookmark5=F5 + +# Play playlist bookmark 6 (string) +#global-key-play-bookmark6= + +# Play playlist bookmark 6 (string) +#key-play-bookmark6=F6 + +# Play playlist bookmark 7 (string) +#global-key-play-bookmark7= + +# Play playlist bookmark 7 (string) +#key-play-bookmark7=F7 + +# Play playlist bookmark 8 (string) +#global-key-play-bookmark8= + +# Play playlist bookmark 8 (string) +#key-play-bookmark8=F8 + +# Play playlist bookmark 9 (string) +#global-key-play-bookmark9= + +# Play playlist bookmark 9 (string) +#key-play-bookmark9=F9 + +# Play playlist bookmark 10 (string) +#global-key-play-bookmark10= + +# Play playlist bookmark 10 (string) +#key-play-bookmark10=F10 + +# Clear the playlist (string) +#global-key-clear-playlist= + +# Clear the playlist (string) +#key-clear-playlist=Ctrl+w + +# Reset subtitles text scale (string) +#global-key-subtitle-text-scale-normal= + +# Reset subtitles text scale (string) +#key-subtitle-text-scale-normal=Ctrl+0 + +# Scale down subtitles text (string) +#global-key-subtitle-text-scale-up= + +# Scale down subtitles text (string) +#key-subtitle-text-scale-up=Ctrl+Mouse Wheel Up + +# Scale up subtitles text (string) +#global-key-subtitle-text-scale-down= + +# Scale up subtitles text (string) +#key-subtitle-text-scale-down=Ctrl+Mouse Wheel Down + +# Playlist bookmark 1 (string) +#bookmark1= + +# Playlist bookmark 2 (string) +#bookmark2= + +# Playlist bookmark 3 (string) +#bookmark3= + +# Playlist bookmark 4 (string) +#bookmark4= + +# Playlist bookmark 5 (string) +#bookmark5= + +# Playlist bookmark 6 (string) +#bookmark6= + +# Playlist bookmark 7 (string) +#bookmark7= + +# Playlist bookmark 8 (string) +#bookmark8= + +# Playlist bookmark 9 (string) +#bookmark9= + +# Playlist bookmark 10 (string) +#bookmark10= + diff --git a/collections/ansible_collections/nullified/infrastructure/roles/workstation/templates/.xsession b/collections/ansible_collections/nullified/infrastructure/roles/workstation/templates/.xsession new file mode 100644 index 0000000..d9ed8c4 --- /dev/null +++ b/collections/ansible_collections/nullified/infrastructure/roles/workstation/templates/.xsession @@ -0,0 +1,3 @@ +setxkbmap -layout us -variant alt-intl +picom --daemon +exec awesome diff --git a/collections/ansible_collections/nullified/infrastructure/roles/workstation/templates/bin_wrapper.sh.j2 b/collections/ansible_collections/nullified/infrastructure/roles/workstation/templates/bin_wrapper.sh.j2 new file mode 100644 index 0000000..29ca6ea --- /dev/null +++ b/collections/ansible_collections/nullified/infrastructure/roles/workstation/templates/bin_wrapper.sh.j2 @@ -0,0 +1,9 @@ +#!/usr/bin/env zsh + +APP_BIN="{{ application }}" + +if [ ! -x "${APP_BIN}" ]; then + printf "%s: target not found" "${APP_BIN}" >&2 +fi + +exec "${APP_BIN}" "$@" diff --git a/collections/ansible_collections/nullified/infrastructure/roles/workstation/templates/system/xorg.conf b/collections/ansible_collections/nullified/infrastructure/roles/workstation/templates/system/xorg.conf new file mode 100644 index 0000000..328a24c --- /dev/null +++ b/collections/ansible_collections/nullified/infrastructure/roles/workstation/templates/system/xorg.conf @@ -0,0 +1,105 @@ +############################################# +# FILES # +############################################# +Section "Files" + ModulePath "/usr/lib/xorg/modules" + FontPath "/usr/share/fonts/X11/misc" + FontPath "/usr/share/fonts/X11/100dpi/:unscaled" + FontPath "/usr/share/fonts/X11/75dpi/:unscaled" + FontPath "/usr/share/fonts/X11/Type1" + FontPath "/usr/share/fonts/X11/100dpi" + FontPath "/usr/share/fonts/X11/75dpi" + FontPath "built-ins" +EndSection + +############################################# +# MODULES # +############################################# +Section "Module" + Load "glx" +EndSection + +############################################# +# INPUTDEVICES # +############################################# +Section "InputDevice" + Identifier "Mouse0" + Driver "mouse" + Option "Protocol" "auto" + Option "Device" "/dev/input/mice" + Option "ZAxisMapping" "4 5 6 7" + Option "CorePointer" +EndSection + +Section "InputDevice" + Identifier "Keyboard0" + Driver "keyboard" + Option "CoreKeyboard" + Option "XkbRules" "xorg" +EndSection + +############################################# +# DEVICES # +############################################# +Section "Device" + Identifier "Card0" + Driver "amdgpu" + Option "Monitor-HDMI-A-0" "VG248" + Option "HDMI-A-0" "VG248" + Option "Monitor-DisplayPort-2" "LG UWQHD" + Option "DisplayPort-2" "LG UWQHD" + Option "Monitor-DisplayPort-0" "LG ULTRAWIDE" + Option "DisplayPort-0" "LG ULTRAWIDE" +EndSection + +############################################# +# SERVER LAYOUT # +############################################# +Section "ServerLayout" + Identifier "Layout0" + Screen 0 "Screen0" 0 0 + InputDevice "Keyboard0" "CoreKeyboard" + InputDevice "Mouse0" "CorePointer" + Option "Xinerama" "0" +EndSection + +############################################# +# SCREENS # +############################################# +Section "Screen" + Identifier "Screen0" + Device "Card0" +EndSection + +############################################# +# MONITORS # +############################################# +Section "Monitor" + Identifier "VG248" + ModelName "VG248" + VendorName "ACI" + Option "DPMS" "on" + Option "PreferredMode" "1920x1080" + Option "LeftOf" "DisplayPort-2" + Option "Position" "0 520" +EndSection + +Section "Monitor" + Identifier "LG UWQHD" + ModelName "LG UWQHD" + VendorName "GSM" + Option "LeftOf" "DisplayPort-0" + Option "DPMS" "on" + Option "PreferredMode" "3840x1600" + Option "Primary" "true" + Option "Position" "1920 0" +EndSection + +Section "Monitor" + Identifier "LG ULTRAWIDE" + ModelName "LG ULTRAWIDE" + VendorName "GSM" + Option "DPMS" "on" + Option "PreferredMode" "3440x1440" + Option "Position" "5760 160" +EndSection diff --git a/inventory/host_vars/lithium/vars.yml b/inventory/host_vars/lithium/vars.yml new file mode 100644 index 0000000..e7c8a02 --- /dev/null +++ b/inventory/host_vars/lithium/vars.yml @@ -0,0 +1,3 @@ +ansible_become_password: "{{ vault_root_pass }}" +ansible_host: "{{ vault_ansible_host }}" +ansible_user: "{{ vault_ssh_user }}" diff --git a/inventory/host_vars/localhost/vars.yml b/inventory/host_vars/localhost/vars.yml new file mode 100644 index 0000000..22cc91f --- /dev/null +++ b/inventory/host_vars/localhost/vars.yml @@ -0,0 +1,19 @@ +ansible_become_password: "{{ vault_root_pass }}" +ansible_host: "{{ vault_ansible_host }}" +ansible_connection: local + +custom_sysctl: + 'fs.inotify.max_user_watches': 1048576 + 'vm.swappiness': 1 + +common_apt_packages: + - pcscd + - pinentry-curses + - radeontop + +common_gitconfig_enable: true +common_gitconfig_username: "{{ vault_common_gitconfig_username }}" +common_gitconfig_email: "{{ vault_common_gitconfig_email }}" +common_gitconfig_force_sign: true +common_gitconfig_signingkey: "{{ vault_common_gitconfig_signingkey }}" +common_install_fonts: true diff --git a/inventory/host_vars/unobtainium/vars.yml b/inventory/host_vars/unobtainium/vars.yml new file mode 100644 index 0000000..22cc91f --- /dev/null +++ b/inventory/host_vars/unobtainium/vars.yml @@ -0,0 +1,19 @@ +ansible_become_password: "{{ vault_root_pass }}" +ansible_host: "{{ vault_ansible_host }}" +ansible_connection: local + +custom_sysctl: + 'fs.inotify.max_user_watches': 1048576 + 'vm.swappiness': 1 + +common_apt_packages: + - pcscd + - pinentry-curses + - radeontop + +common_gitconfig_enable: true +common_gitconfig_username: "{{ vault_common_gitconfig_username }}" +common_gitconfig_email: "{{ vault_common_gitconfig_email }}" +common_gitconfig_force_sign: true +common_gitconfig_signingkey: "{{ vault_common_gitconfig_signingkey }}" +common_install_fonts: true diff --git a/inventory/inventory.yml.dist b/inventory/inventory.yml.dist index b7f7954..57b50a2 100644 --- a/inventory/inventory.yml.dist +++ b/inventory/inventory.yml.dist @@ -1,2 +1,14 @@ all: hosts: + +external: + hosts: + +main_desktop: + hosts: + +internal: + hosts: + +server: + hosts: diff --git a/inventory/vault.yml.dist b/inventory/vault.yml.dist index ec22e6e..32f12d1 100644 --- a/inventory/vault.yml.dist +++ b/inventory/vault.yml.dist @@ -1,2 +1,3 @@ -vault_custom_base_user_account: -vault_custom_github_token: +vault_custom_base_user_account: "" +vault_custom_github_token: "" +vault_custom_dockerhub_password: "" diff --git a/playbooks/internal.yml b/playbooks/internal.yml index ed97d53..5297e84 100644 --- a/playbooks/internal.yml +++ b/playbooks/internal.yml @@ -1 +1,9 @@ --- +- name: setup internal infrastructure + hosts: internal + gather_facts: false + vars_files: ../inventory/vault.yml + tasks: + - include_vars: ../inventory/vault.yml + +- ansible.builtin.import_playbook: nullified.infrastructure.main_desktop diff --git a/scripts/generate_ansible_config.sh b/scripts/generate_ansible_config.sh index 84ed1f6..e7e5866 100755 --- a/scripts/generate_ansible_config.sh +++ b/scripts/generate_ansible_config.sh @@ -12,7 +12,7 @@ USAGE \$> ./$(basename "$0") [option [option...]] [file_path] ARGUMENTS - file_path file path where the file will be saved; defaults to '\$HOME/.ansible.cfg'; + file_path file path where the file will be saved; if neither this argument nor the environment variable \$ANSIBLE_CFG_PATH is provided, the content will be printed on stdout.