GithubHelp home page GithubHelp logo

Background transparency about lush.nvim HOT 17 CLOSED

Deep-Six avatar Deep-Six commented on June 12, 2024
Background transparency

from lush.nvim.

Comments (17)

rktjmp avatar rktjmp commented on June 12, 2024 1

Here is a very basic watcher plugin:

https://github.com/rktjmp/fwatch.nvim

The API for that plugin might change as I think about it more and it probably has a bug or two, but it should let you at least try the idea.

You need to make your background change effect a file somehow.

from lush.nvim.

Deep-Six avatar Deep-Six commented on June 12, 2024 1

@rktjmp the watch works perfect making this totally dynamic! Thanks!

from lush.nvim.

Davincible avatar Davincible commented on June 12, 2024 1

Stumbled upon this thread after I found your pywal lush theme and modified to work with wpgtk, and was looking for dynamic reloading. Thanks a lot to both of you for your work

from lush.nvim.

rktjmp avatar rktjmp commented on June 12, 2024 1

Closing this as it seems to be sorted out.

from lush.nvim.

rktjmp avatar rktjmp commented on June 12, 2024

I'm working on a pywal based theme, which ingesting the pywal colors from ~/.cache/was/colors and thanks working great. However, I'm unable to get the background to be transparent.

Generally that's dependent on the terminal and set separately I think?

Also is there any facility to reapply lush based on an event? Currently I have to rerun Lushify when I change a background.

You mean from an external-to-vim event? I think you can hook into nvim via it's RPC system and basically use that to tell lush to re-run (or rather, just tell vim to reload it's colorscheme). I'm not sure how complicated that would be though, depends on what's changing your wallpaper and your language/msgpack library.

Another option would be making a small plugin that watches a file for changes and executes a command when they change. I might look at making that actually.

from lush.nvim.

rktjmp avatar rktjmp commented on June 12, 2024

In your case you're probably doing something like:

lua << EOF
local fwatch = require('fwatch')

fwatch.watch("/home/deepsix/.config/feh_config_file_or_whatever", "colorscheme my_scheme")
EOF

?

from lush.nvim.

Deep-Six avatar Deep-Six commented on June 12, 2024

@rktjmp I've published my really rough (but working) pywal based theme, I am definitely open to suggestions, this is my first Lua program, and I really don't consider myself a developer per se. I'm sure you can improve upon it, more importantly I think long term basing it on pywal might not be the greatest idea because it often times doesn't extract more than 8 colours for a pallete.

I am still unable to get lightline or transparency to work..

Code is here:

https://github.com/Deep-Six/pywal-lush

from lush.nvim.

rktjmp avatar rktjmp commented on June 12, 2024

That's actually pretty neat if not somewhat unpredictable.

I managed to get the auto application working with fwatch, but you have to put a small timer to avoid trying to generate the scheme from a half updated file.

I just put this after where I set my colorscheme

lua << EOF
fwatch = require('fwatch')
fwatch.watch("/home/soup/.cache/wal/colors", {
  -- when file changes
  on_event = function()
    -- wait 200ms then
    vim.defer_fn(function()
      -- reapply the colorscheme
      vim.cmd("colorscheme pywal")
    end, 200)
  end
})
EOF

Lightline is pretty awkward. You can see in the examples a bit on how to get it to work, it involves basically building a separate dictionary for lightline and then turning it off and on again.

Not sure if all status lines are like that or not, I think lualine just uses regular highlight groups so lush should just be able to set them no problem.

The transparency (as in, see wallpaper through vim) stuff will be per-terminal and not controlled by lush or vim.

from lush.nvim.

Deep-Six avatar Deep-Six commented on June 12, 2024

from lush.nvim.

Davincible avatar Davincible commented on June 12, 2024

Since the issue title is still background transparency, I am experiencing the following; with some wallpapers (and associated color scheme) my vim background is non-existent (as desired), but with some, there is a background. I'm not sure what's causing this, do you have any idea how I can make them all transparent?

image
image

from lush.nvim.

rktjmp avatar rktjmp commented on June 12, 2024

Possibly pywal/wpgtk sets something funny depending on what the background is? Sounds weird though.

Does it persist if you re-open the terminal? It may be something like compiz/picom/whatever acting up.

That sporadic strip down the right is from the ColorColumn group, see :h colorcolumn for info on disabling it.

Actually, the ColorColumn seems like it's never being blended, maybe because it's so dark. I wonder if the term/compositor has trouble mixing dark colours and some wallpapers just have darker backgrounds?

from lush.nvim.

Davincible avatar Davincible commented on June 12, 2024

The background colors do change per wallpaper, but are all a slightly different shade of black/gray. Re-opening the terminal doesn't change anything. What's funny is that only with 3 specific wallpapers I always have a transparent background, with the rest I don't.

Before migrating over to lua, I used the native .vim theme for pywal/wpgtk, and there I had no problems. However then I was also in 8 bit color mode, this is 24 bit color mode.

The color column is intentional yeah

from lush.nvim.

Davincible avatar Davincible commented on June 12, 2024

Okay so its probaby because a background is explicitly set on all highlight groups. If I remove the bg= call from a specific highlight group, that group gets transparent.

Edit: after removing all bg = color1 in my case everything is transparent. I do agree this is probably only necessary because picom doesn't mix them properly.

from lush.nvim.

Deep-Six avatar Deep-Six commented on June 12, 2024

from lush.nvim.

Davincible avatar Davincible commented on June 12, 2024

Background works perfectly now, after deleting all explicit bg = color definitions for right highlight groups
image

from lush.nvim.

Deep-Six avatar Deep-Six commented on June 12, 2024

from lush.nvim.

Davincible avatar Davincible commented on June 12, 2024

Just run :%s/ bg = color1,//g << that's all I've done to solve the the background issue

from lush.nvim.

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.