Skip to content

Commit

Permalink
chore: Rename config files to "termvisage.json"
Browse files Browse the repository at this point in the history
- Change: "config.json" -> "termvisage.json".
- Change: Rename sample config files.
- Change: Update README and the docs.
  • Loading branch information
AnonymouX47 committed May 6, 2023
1 parent d5852e6 commit a23f2fe
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ Pressing the `F1` key (in most contexts) brings up a **help** menu describing th
The TUI can be configured using a config file. See the [Configuration](https://termvisage.readthedocs.io/en/latest/config.html) section of the docs.
[Here](https://github.com/AnonymouX47/termvisage/blob/main/vim-style_config.json) is a config file with Vim-style key-bindings (majorly navigation).
[Here](https://github.com/AnonymouX47/termvisage/blob/main/vim_style-termvisage.json) is a config file with Vim-style key-bindings (majorly navigation).
See the [TUI manual](https://termvisage.readthedocs.io/en/latest/tui.html).
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions docs/source/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ The configuration file is written in **JSON** format, using a *partial config* s
i.e only the fields to be modified need to be present in the config file.

By default, ``termvisage`` searches the following locations, **in the specified order**,
for ``$DIR/termvisage/config.json`` (a file named ``config.json`` within a ``termvisage``
directory):
for ``$DIR/termvisage/termvisage.json`` (a file named ``termvisage.json`` within a
directory named ``termvisage``):

* All valid directories specified in the ``XDG_CONFIG_DIRS`` enviroment variable,
**in reverse order** or ``/etc/xdg`` if not set.
Expand All @@ -31,7 +31,7 @@ To use the default configuration and not load any config file, use :option:`--no
file and reports any errors. To see information about how the errors are resolved
(if resolvable), use :option:`-v`.

`This <https://raw.githubusercontent.com/AnonymouX47/termvisage/main/default_config.json>`_
`This <https://raw.githubusercontent.com/AnonymouX47/termvisage/main/default-termvisage.json>`_
is a sample config file with all options and keybindings at their defaults.
Note that **this is only for reference**, using any field within it as-is has no effect.

Expand Down Expand Up @@ -255,7 +255,7 @@ The format of the ``keys`` field is thus::
from that config file are considered invalid and any changes already made are
reverted.

`Here <https://raw.githubusercontent.com/AnonymouX47/termvisage/main/vim-style_config.json>`_
`Here <https://raw.githubusercontent.com/AnonymouX47/termvisage/main/vim_style-termvisage.json>`_
is a sample config file with Vim-style (majorly navigation) keybindings.

Below is a list of all **valid** values for *key*::
Expand Down
2 changes: 1 addition & 1 deletion docs/source/tui.rst
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,4 @@ An action has the following defining properties:
.. tip::

All contexts and their actions (excluding navigation actions) with default properties
can be found `here <https://github.com/AnonymouX47/termvisage/blob/main/default_config.json>`_.
can be found `here <https://github.com/AnonymouX47/termvisage/blob/main/default-termvisage.json>`_.
4 changes: 2 additions & 2 deletions src/termvisage/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def revert_context_update(
def load_xdg_config() -> None:
"""Loads user config files according to the XDG Base Directories spec."""
for config_dir in reversed(os.environ.get("XDG_CONFIG_DIRS", "/etc").split(":")):
config_file = path.join(config_dir, "termvisage", "config.json")
config_file = path.join(config_dir, "termvisage", "termvisage.json")
if (
# The XDG Base Dirs spec states that relative paths should be ignored
path.abspath(config_dir) == config_dir
Expand Down Expand Up @@ -499,7 +499,7 @@ def update_context_nav(
xdg_config_file = path.join(
os.environ.get("XDG_CONFIG_HOME", path.join(path.expanduser("~"), ".config")),
"termvisage",
"config.json",
"termvisage.json",
)

_valid_keys = {*bytes(range(32, 127)).decode(), *urwid.escape._keyconv.values(), "esc"}
Expand Down
File renamed without changes.

0 comments on commit a23f2fe

Please sign in to comment.