Giter Site home page Giter Site logo

hyprshade's People

Contributors

loqusion avatar mariasolos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

hyprshade's Issues

systemd timer need an additional rule 'AccuracySec=1ms'

systemd tend to excute on some random secs to avoid cpu request peak.But hyprshade need to run exactly at starttime.
In install.py,

[Timer]
AccuracySec=1ms
{timer_config}

I found hyprshade failed to run ,or maybe it run before some secs leads to shade change didnot apply.So I add the rule in hyprshade.timer, have not test it.

Screenshot ... *without shader*

Hey, just a minor issue/request.

I would like to be able to take screenshots (currently using grim and slurp) in such a a way that the shader isn't present.

I saw that at one point this was behavior and it was "fixed" so I can understand if my request seems backwards. It would be nice because if you send the screenshot to someone that also has a filter on then they'll see the images as extra yellow due to the stacked filters. Overall keeping the filter applied on the screenshots is just a destructive operation and removes the true colors from the underlying image.

I do have a simple workaround so it's not thaat big of an issue, so it's just a nice-to-have:
hyprshade off && grim -g "$(slurp)" - | xsel -b && hyprshade on blue-light-filter.glsl

Thanks for making hyprshade.

`scandir_recrusive` edge cases

scandir_recursive is used to find shader files in one's shader directory. It has various issues that will probably only occur for less than 0.1% of users:

  • It should find and return files higher up the directory tree first via breadth-first search, but instead it does a reverse pre-order depth-first search. This can have various performance and resource usage implications in niche situations.
  • It doesn't properly handle cases where a symlink to a directory higher in the tree (e.g. a node is its own ancestor) causes an infinite loop which only breaks due to max_depth.

def scandir_recursive(
path: GenericPath[AnyStr], *, max_depth: int
) -> Iterator[os.DirEntry[AnyStr]]:
assert max_depth >= 0
dir_stack = []
with os.scandir(path) as it:
for direntry in it:
if not direntry.is_dir():
yield direntry
elif max_depth > 0:
dir_stack.append(direntry)
while dir_stack:
yield from scandir_recursive(dir_stack.pop(), max_depth=max_depth - 1)

Reduce intensity?

Is there a way to reduce intensity on the "night-light-filter"?
If not I think its a must have!

`ls` edge case

If any of the directories ls searches has any subdirectories, they will be treated as regular files due to the implementation of ls_dirs. This means any shader files within subdirectories will not be listed, and it also means that if you run the command with -l, it will panic.

`hyprshade install` cannot create the systemd file itself

After copying the configuration file according to the document, directly running hyprshade install will return an error:

Error: [Errno 2] No such file or directory: '/home/<username>/.config/systemd/user/hyprshade.service'

hyprshade install can run successfully only after manually creating this systemd file.

OS: Arch Linux x86_64
Kernel: 6.5.1
hyprshade version: aur/hyprshade-git 0.10.0.r1.g7b78d98-1, however, this error has occurred in previous versions.

Support shader directory searching `~/.config/hyprshade/shaders`

~/.config
❯ nix shell nixpkgs#hyprshade

~/.config 
❯ mkdir -p hyprshade/shaders

~/.config 
❯ cd hyprshade/

~/.config/hyprshade 
❯ nvim shaders/blue-light.glsl

~/.config/hyprshade  took 40s
❯ hyprshade on blue-light
Error: Shader 'blue-light' could not be found in any of the following directories:

[ble: exit 1]

~/.config/hyprshade 
❯ hyprshade on ./shaders/blue-light.glsl
Error: Shader 'blue-light' could not be found in any of the following directories:

[ble: exit 1]

~/.config/hyprshade 
❯ ls shaders
blue-light.glsl

~/.config/hyprshade 
❯ hyprshade on /home/x/.config/hyprshade/shaders/hyblue-light.glsl

~/.config/hyprshade 
❯ # success!

~/.config/hyprshade 
❯ mkdir ~/.config/hypr/shaders

~/.config/hyprshade 
❯ cp ./shaders/blue-light.glsl ../hypr/shaders/

~/.config/hyprshade 
❯ hyprshade off

~/.config/hyprshade 
❯ hyprshade on blue-light

~/.config/hyprshade 
❯ # success!
        
        

The program does not print the directories it searched, but to my understanding it looks in some share folder and in in ~/.config/hypr/shaders.

If the hyprshader config is allowed to live in ~/.config/hyprshader, I want to also put my shaders in ~/.config/hyprshader/shaders.

AUR installation fails with `hyprland exists in filesytem`

Installing hyprshade with yay fails with:

(13/13) checking for file conflicts                                      [#########################################] 100%
error: failed to commit transaction (conflicting files)
hyprland: /usr/bin/Hyprland exists in filesystem
hyprland: /usr/bin/hyprctl exists in filesystem
hyprland: /usr/lib/libwlroots.so.13032 exists in filesystem
hyprland: /usr/share/wayland-sessions exists in filesystem

I just reinstalled Hyprland but built it manually. Could that be linked?

Thanks! ❤️

search shade by name have flaws

I create a new shade named 'blue-light-filter-gentle.glsl' in config/hypr/shaders, there already have a blue-light-filter.glsl in /usr/share/hyprshade/,but when blue-light-filter-gentle.glsl is applied when its blue-light-filter's turn, hyprshade auto can't switch to it.
I have to rename blue-light-filter-gentle.glsl to gentle-blue-light-filter.glsl, in that way hyprshade can tell them apart.
please check it ,I hope I am wrong.I just rename the file ,did not dig into the source file.

Replace blue-light-filter's code.

Please replace the code below with blue-light-shader.glsl. This one is properly formatted.

// from https://github.com/hyprwm/Hyprland/issues/1140#issuecomment-1335128437

precision mediump float;
varying vec2 v_texcoord;
uniform sampler2D tex;

const float temperatureStrength = 1.0;
const float temperature = 4800.0;

#define WithQuickAndDirtyLuminancePreservation
const float LuminancePreservationFactor = 1.0;

// function from https://www.shadertoy.com/view/4sc3D7
vec3 colorTemperatureToRGB(const in float temperature) {
  // values from: http://blenderartists.org/forum/showthread.php?270332-OSL-Goodness&p=2268693&viewfull=1#post2268693
  mat3 m = (temperature <= 6500.0) ?
    mat3 (
      vec3 (0.0, -2902.1955373783176   , -8257.7997278925690   ),
      vec3 (0.0,  1669.5803561666639   ,  2575.2827530017594   ),
      vec3 (1.0,     1.3302673723350029,     1.8993753891711275)
    ) :
    mat3 (
      vec3 ( 1745.0425298314172    ,  1216.6168361476490    , -8257.7997278925690   ),
      vec3 (-2666.3474220535695    , -2173.1012343082230    ,  2575.2827530017594   ),
      vec3 (    0.55995389139931482,     0.70381203140554553,     1.8993753891711275)
    );
  return mix (
    clamp (
      vec3 (
        m[0] / (
          vec3 (
            clamp (
              temperature,
              1000.0,
              40000.0
            )
          ) + m[1]
        ) + m[2]
      ),
      vec3(0.0),
      vec3(1.0)
    ),
    vec3(1.0),
    smoothstep(
      1000.0,
      0.0,
      temperature
    )
  );
}

void main() {
  vec4 pixColor = texture2D (
    tex,
    v_texcoord
  );

  // RGB
  vec3 color = vec3 (
    pixColor[0],
    pixColor[1],
    pixColor[2]
  );

  #ifdef WithQuickAndDirtyLuminancePreservation
  color *= mix (
    1.0,
    dot (
      color,
      vec3 (
        0.2126,
        0.7152,
        0.0722
      )
    ) / max (
      dot (
        color,
        vec3 (
          0.2126,
          0.7152,
          0.0722
        )
      ),
      1e-5
    ),
    LuminancePreservationFactor
  );
  #endif

  color = mix (
    color,
    color * colorTemperatureToRGB (
      temperature
    ),
    temperatureStrength
  );

  vec4 outCol = vec4 (
    color,
    pixColor[3]
  );

  gl_FragColor = outCol;
}

Screenshots - Discussion

It would be nice if the README had screenshots of shaders for demonstration purposes. However, I (and others) have not been able to take proper screenshots (a screenshot is taken without the shader applied).

EDIT: Ok, screenshots with shaders are working again. I'll upload them soon.

[Bug] Shader doesn't apply to cursor

The shaders apply to my whole screen except the cursor, I would attach a screenshot but not sure how to take one with a cursor in it.

Thanks for this awesome piece of software, would love if this issue could be resolved :)

Dedup `hyprshade ls` output

Example:

   bloom              /home/loqusion/.config/hypr/shaders
-  blue-light-filter  /home/loqusion/.config/hypr/shaders
   blue-light-filter  /usr/share/hyprshade/shaders
 * blue-light-filter  /home/loqusion/.config/hypr/shaders
   blur               /home/loqusion/.config/hypr/shaders
   crt                /home/loqusion/.config/hypr/shaders
   drugs              /home/loqusion/.config/hypr/shaders
   vibrance           /usr/share/hyprshade/shaders

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.