Giter Club home page Giter Club logo

Comments (4)

tstack avatar tstack commented on August 20, 2024

Fwiw, I've tried the indicated directory and others that I thought could be an option:

~/.lnav/configs/installed/
~/.lnav/configs/themes/
~/.lnav/themes/
~/.config/lnav/configs/installed/
~/.config/lnav/configs/themes/
~/.config/lnav/themes/

Running lnav -h should show the lnav directory that would be used. This is what I see:

Paths
 • Format files are read from:
    📂 /etc/lnav
    📂 /usr/local/etc/lnav
 • Configuration, session, and format files are stored in:
    📂 /Users/tstack/.config/lnav

Under that directory, configs/installed should work.

The theme file that was put into each of these folders is tokyonight-storm-theme.json.

Would you be able to attach this file?

A configuration file must have a $schema property in the top level object, like so:

    "$schema": "https://lnav.org/schemas/config-v1.schema.json"

To get a dump of the full lnav configuration, you can run lnav -m config get. To get a listing of where the value of each property came from, you can run lnav -m config blame.

Running lnav with -d /tmp/lnav-debug.log will write the lnav debug log to that file. Near the start there are some log messages related to loading the configuration. In the snippet below, you can see a theme configuration being loaded:

2024-05-23T20:56:54.287-07:00 I t0 lnav.cc:2559 lnav started
2024-05-23T20:56:54.290-07:00 I t0 lnav_config.cc:1879 loading builtin configuration into default
2024-05-23T20:56:54.295-07:00 I t0 lnav_config.cc:1881 loading builtin configuration into base
2024-05-23T20:56:54.300-07:00 I t0 lnav_config.cc:1884 loading installed configuration files
2024-05-23T20:56:54.300-07:00 I t0 lnav_config.cc:1769 loading configuration from /Users/tstack/.config/lnav/configs/installed/config.simple_theme.json
2024-05-23T20:56:54.300-07:00 I t0 lnav_config.cc:1769 loading configuration from /Users/tstack/.config/lnav/configs/installed/config.simple_theme.json
2024-05-23T20:56:54.301-07:00 I t0 lnav_config.cc:1914 loading user configuration
2024-05-23T20:56:54.301-07:00 I t0 lnav_config.cc:1769 loading configuration from /Users/tstack/.config/lnav/config.json

Let me know what happens, there might be a better error/help message I can add somewhere.

from lnav.

ylluminate avatar ylluminate commented on August 20, 2024

Hmm, interesting. I had been running lnav for years with config info under ~/.lnav/ instead of ~/.confifig/lnav/...

Here's the theme (along with the command to cat it so you can see the source location): cat_of_tokyonight-storm-theme.json

Shell incantations:

# tried to start after ensured it was in a properly supported path of ~/.config/lnav/configs/installed/tokyonight-storm-theme.json
$ lnav
✘ error: invalid value for property “/ui/theme”
 reason: unknown theme -- “tokyonight-storm”
 |        = help: The available themes are: default, dracula, eldar, grayscale, monocai, night-owl, solarized-dark, solarized-light
 --> /Users/username/.config/lnav/config.json:3
 = help: Property Synopsis
           /ui/theme theme_name
         Description
           The name of the theme to use.

# attempted suggested command, again with the theme name inserted into config.json of `"theme": "tokyonight-storm"`:
$ lnav -m config get
✘ error: invalid value for property “/ui/theme”
 reason: unknown theme -- “tokyonight-storm”
 |        = help: The available themes are: default, dracula, eldar, grayscale, monocai, night-owl, solarized-dark, solarized-light
 --> /Users/username/.config/lnav/config.json:3
 = help: Property Synopsis
           /ui/theme theme_name
         Description
           The name of the theme to use.

# attempted to modify theme name to `"theme": "tokyonight-storm-theme"`:
$ nano ~/.config/lnav/config.json

# again attempted suggested command:
$ lnav -m config get
✘ error: invalid value for property “/ui/theme”
 reason: unknown theme -- “tokyonight-storm-theme”
 |        = help: The available themes are: default, dracula, eldar, grayscale, monocai, night-owl, solarized-dark, solarized-light
 --> /Users/username/.config/lnav/config.json:3
 = help: Property Synopsis
           /ui/theme theme_name
         Description
           The name of the theme to use.

# other suggested command just for thoroughness, knowing it wouldn't yield much:
$ lnav -m config blame
✘ error: invalid value for property “/ui/theme”
 reason: unknown theme -- “tokyonight-storm-theme”
 |        = help: The available themes are: default, dracula, eldar, grayscale, monocai, night-owl, solarized-dark, solarized-light
 --> /Users/username/.config/lnav/config.json:3
 = help: Property Synopsis
           /ui/theme theme_name
         Description
           The name of the theme to use.

# debug generation:
$ lnav -d /tmp/lnav-debug.log
✘ error: invalid value for property “/ui/theme”
 reason: unknown theme -- “tokyonight-storm-theme”
 |        = help: The available themes are: default, dracula, eldar, grayscale, monocai, night-owl, solarized-dark, solarized-light
 --> /Users/username/.config/lnav/config.json:3
 = help: Property Synopsis
           /ui/theme theme_name
         Description
           The name of the theme to use.

Debug output: lnav-debug.log

The debug log contains attempted start with both the name defined as tokyonight-storm-theme and as tokyonight-storm in the config.json, so seems to indicate the theme is maybe being loaded, but still no success...

from lnav.

tstack avatar tstack commented on August 20, 2024

You need to change “default” under “theme-defs” to the theme name. The name does not come from the file name. Right now, that file is overriding the default theme properties.

from lnav.

ylluminate avatar ylluminate commented on August 20, 2024

So you're saying config.json should have:

  {
      "ui": {
          "theme": "tokyonight-storm",
          "theme-defs": {
              "tokyonight-storm": {
                  "highlights": {
...

This does seem to evoke a change - even though now I simply lack formatting. I have to assume that the actual theme is not configured properly and now it will be a matter of iterating through the json theme file to implement a theme that I would expect to see.

Thanks.

from lnav.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.