-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
Sync wallpaper to greeter #72
Conversation
src/Backends/InterfaceSettings.vala
Outdated
if (folder.query_exists ()) { | ||
var enumerator = folder.enumerate_children ("standard::*", FileQueryInfoFlags.NOFOLLOW_SYMLINKS); | ||
FileInfo? info = null; | ||
while ((info = enumerator.next_file ()) != null) { | ||
enumerator.get_child (info).@delete (); | ||
} | ||
} else { | ||
folder.make_directory_with_parents (); | ||
} | ||
|
||
source.copy (dest, FileCopyFlags.OVERWRITE | FileCopyFlags.ALL_METADATA); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does we need all this? wouldn't $XDG_GREETER_DATA_DIR/wallpaper.$ext
and $XDG_GREETER_DATA_DIR/wallpaper-dark.$ext
be enough? this way we can skip this enumerator loop and just do:
if (!folder.query_exists ()) { // folder here point to $XDG_GREETER_DATA_DIR
folder.make_directory_with_parents ();
}
source.copy (folder.get_child (wallpaper_name), OVERWRITE | ALL_METADATA); // wallpaper_name would be "wallpaper.png" for a png file, or "wallpaper.xml" for a dynamic one, etc...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see a straightforward way of getting a file extension. Can we just drop it and use $XDG_GREETER_DATA_DIR/wallpaper
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this need a test with a animated/dynamic wallpaper, if they end working correct in the greeter, i think it would be better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just tested it, Greeter doesn't support dynamic wallpapers, instead it falls back to /usr/share/backgrounds/elementaryos-default
file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh just got that you're talking about file without extensions sorry.
What if we check it's mimetype? Is it dependent on file extension?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think Gdk.Pixbuf will already check it for us, the problematic case was dynamic ones, since theses are XML files, and sometimes they don't have the XML header that is used to define the mimetype when the file has no extension.
but since we don't support them in the greeter, we don't need to worry about that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested again, now with
wallpaper
file, greeter falls back in this case too.
wait, you tested a static or dynamic one? if it a static one, and fails, the fallback one would fail too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested both.
if it a static one, and fails, the fallback one would fail too.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because it doesn't have a extension too, so if Gdk.Pixbuf fails to check the mimetype for the wallpaper
named one it would fail in the elementaryos-default
too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested here, and \var\lib\lightdm-data\$user\wallpaper
woked fine with my current wallpaper (a .jpg file).
Co-authored-by: Gustavo Marques <pushstarttocontinue@outlook.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fixes #4
Requires elementary/switchboard-plug-pantheon-shell#361