Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wayfire: init #765

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

wayfire: init #765

wants to merge 1 commit into from

Conversation

0x5a4
Copy link

@0x5a4 0x5a4 commented Jan 9, 2025

Wayfire is a 3D Wayland compositor, inspired by Compiz and based on wlroots.

Sadly, we cannot use stylix.image. Wayfire currently isnt smart enough to understand what file type an image has if it doesnt have a file ending and we cannot depend on that being set.

@0x5a4
Copy link
Author

0x5a4 commented Jan 9, 2025

Hm, the home-manager module is pretty new. Should I just update the input within this PR?

Copy link
Collaborator

@trueNAHO trueNAHO left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sadly, we cannot use stylix.image. Wayfire currently isnt smart enough to understand what file type an image has if it doesnt have a file ending and we cannot depend on that being set.

Maybe we can pass a renamed file with something like "${stylix.image}.png"?

Hm, the home-manager module is pretty new. Should I just update the input within this PR?

Yes.

@0x5a4
Copy link
Author

0x5a4 commented Jan 10, 2025

Maybe we can pass a renamed file with something like "${stylix.image}.png"?

The file might be a jpeg though. I think the only automatic option is IFD, but I'm not sure what the policy is here.

@0x5a4
Copy link
Author

0x5a4 commented Jan 10, 2025

It seems only PNG and JPEG are supported, the implementation is a bit... primitive.

@danth
Copy link
Owner

danth commented Jan 15, 2025

Regarding the image, the way I've handled this in the past was to convert the wallpaper using ImageMagick. That means we know it's in a supported format, and also the derivation which does the conversion can output an appropriately named file.

@0x5a4
Copy link
Author

0x5a4 commented Jan 15, 2025

i totally forgot that you can convert images lol this should work now. i kind of forgot that wf-shell exists, so i think we should configure this as well. maybe dont merge this yet

Copy link
Collaborator

@trueNAHO trueNAHO left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i totally forgot that you can convert images lol this should work now. i kind of forgot that wf-shell exists, so i think we should configure this as well. maybe dont merge this yet

We could also support Wayfire and wf-shell in separate PRs. I leave the decision up to you.

@0x5a4
Copy link
Author

0x5a4 commented Jan 18, 2025

oh, i've already implemented the wf-shell part. i was just scared you'd merge this while i was off to get lunch ;) this is ready to merge from my point of view

modules/wayfire/hm.nix Show resolved Hide resolved
modules/wayfire/hm.nix Outdated Show resolved Hide resolved
flake.lock Outdated Show resolved Hide resolved
modules/wayfire/hm.nix Show resolved Hide resolved
modules/wayfire/hm.nix Show resolved Hide resolved
modules/wayfire/hm.nix Outdated Show resolved Hide resolved
modules/wayfire/hm.nix Outdated Show resolved Hide resolved
@0x5a4 0x5a4 force-pushed the init-wayfire branch 2 times, most recently from 2eeda3b to 1ab9026 Compare January 18, 2025 16:27
Copy link
Owner

@danth danth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't tested this, however I see no obvious issues.

@danth danth requested a review from trueNAHO January 20, 2025 21:03
modules/wayfire/hm.nix Outdated Show resolved Hide resolved
@trueNAHO trueNAHO changed the title wayfire: init hm module wayfire: init Jan 23, 2025
@0x5a4 0x5a4 closed this Jan 23, 2025
@0x5a4
Copy link
Author

0x5a4 commented Jan 23, 2025

it seems githubs web interface has screwed me once more

@0x5a4 0x5a4 reopened this Jan 23, 2025
Copy link
Collaborator

@trueNAHO trueNAHO left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The following question has not been addressed yet:

Wayfire currently isnt smart enough to understand what file type an image has if it doesnt have a file ending and we cannot depend on that being set.

This adds the .png extension to the realpath of the /nix/store/<HASH>-wayfire-background.png symlink. Does the convert "$stylix_image" result command actually do something? Also, does this work when stylix.image is not a PNG?

-- #765 (comment)

@0x5a4
Copy link
Author

0x5a4 commented Jan 23, 2025

i dont understand what you mean by this. could you please elaborate what problem you're seeing here?

edit: didnt intend to sound that angry, sorry

Comment on lines +22 to +24
wayfireBackground = pkgs.runCommand "wayfire-background.png" { } ''
${lib.getExe' pkgs.imagemagick "convert"} ${config.stylix.image} $out
'';
Copy link
Collaborator

@trueNAHO trueNAHO Jan 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i dont understand what you mean by this. could you please elaborate what problem you're seeing here?

Essentially, does this work even when stylix.image is not a PNG file? Note that the file extension does not dictate the actual file type:

$ file image.png
image.png: PNG image data, [...]

$ file image.jpg
image.jpg: JPEG image data, [...]

Just try your module with some files and tell me if it worked.

edit: didnt intend to sound that angry, sorry

No worries. My explanation was not very clear :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants