-
-
Notifications
You must be signed in to change notification settings - Fork 137
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
API feature #235
API feature #235
Conversation
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.
Do we really need to include word expansion into i3lock-color? I feel that should be the job for the scripts writing the the fifo and not here.
pthread_t api_thread; | ||
// this enables api access to update i3lock | ||
bool api_enabled = false; | ||
char *api_fifo_path = "/tmp/i3lock-api"; |
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.
We can probably utilize XDG_RUNTIME_DIR
environment variable before falling back to a default (in addition to specifying a path from command line).
@@ -1437,19 +1489,10 @@ static void load_slideshow_images(const char *path, char *image_raw_format) { | |||
closedir(d); | |||
} | |||
|
|||
int main(int argc, char *argv[]) { |
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.
This might make merging from upstream harder, although I don't have a better way for now
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.
@Raymo111 I think you're usually the one merging from upstream, what do you think?
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.
Yeah this would probably pose issues down the line, can we make this work without shrinking main by that much?
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 wonder if it's possible to rearrange the code a bit to reduce the diff size. Seems like most of the diff are in this file?
Changes
Considerations
Video.29-8-21.23.29.59.mov |
Changes
|
Setting images through API works without any issue (no crashes): Upload.from.GitHub.for.iOS.MOVHowever, big files at low intervals can slow i3lock if your graphics are slow: Upload.from.GitHub.for.iOS.MOV |
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.
Besides the comments in code, I think it looks good.
I'm personally not a big fan of parse_args
related code (maybe something like wordexp(3)
can be used instead). But it's probably fine for now.
text[i] = c; | ||
i++; | ||
} | ||
text[i] = '\0'; |
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.
Is the size of text
is always larger than i
here?
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.
Yep, as we increase the memory of text
by 2 if the size of text
is lower or equal than i
. It should always be enough memory to insert the NULL character.
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.
What about the case when in the beginning of the loop i == size - 1
. The loop doesn't get extended and i++
gets executed. If the loop exits at this iteration, i == size
and writing to text[size]
is out of bounds.
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.
Sure, it would be out of bounds. if (size <= i + 1) { /* reallocate */ }
should do the thing.
@@ -1437,19 +1489,10 @@ static void load_slideshow_images(const char *path, char *image_raw_format) { | |||
closedir(d); | |||
} | |||
|
|||
int main(int argc, char *argv[]) { |
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 wonder if it's possible to rearrange the code a bit to reduce the diff size. Seems like most of the diff are in this file?
But
|
Sorry I'm incinsistent, ignore me on this whole parsing part. I'm not sure which way I like either :P. I looked at my old comment and I agree with my previous self, wordexp does too much. I completely forgot what it does other than the function name. It's good right now. |
Hi, this looks pretty good. Why it hasn't been merged yet? |
This feature is huge, and it does some big changes inside the main function, which could make it difficult to pull from i3lock. Besides, even if this feature looks cool, it's mostly unnecessary. It's an extra that does a lot~ |
Yeah what @JezerM said basically. Jez I think I'll close this PR for now, and if we really need it someday we can reconsider it. Thanks for putting in all the effort still, it means a lot. If you'd like you can maintain an API branch/fork and keep it up to date with master so that if someone wants the feature they can use your fork? |
Yeah, I could~ |
Closes #234
Description
--api-enable
flagIt is insecure. Send(Fixed)--no-verify
and screen is unlocked.Screenshots/screencaps
Video.25-8-21.21.01.05.mov
Release notes
Notes: Added API feature