-
Notifications
You must be signed in to change notification settings - Fork 184
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
Proper multimonitor support #84
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Uses a new way to determine the brightness of the image, gives about the same values as the old one, is less complex, and a little faster
The original screenshot is cut into pieces corresponding to the different monitors and all the operations (including brightness calculation) are done on those pieces individually Right now this is extremely slow, a lot of it due to stitching together at the end is_dark has been removed because all it did was basically just compare two numbers and set a different return value depending on which number was bigger
Will be used later to properly center text relative to the monitor
Splitting and rejoining the images took way to long Now we calculate the absolute positions of the locks and text instead of using '-gravity Center' because the gravity option only makes sense if a single monitor is in the image We also only use a single convert call to apply all the effects and add the icons and text to the image which should increase the speed
We again only use a single file so we just create a temp png file
Empty text would crash the get_text_width function
Since we again only have a single file to delete
Merged
Sorry, I accidentally merged this. I was looking at the man page one... |
No worries. I'll open another one EDIT: New one: #87 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Does brightness detection on a per monitor basis
Averages the brightness of the centers of all monitors to determine the colors
to pass to i3lock (color version)
Calculates the text width to determine the exact position so this should work
with any text
Speed wise, I was quite surprised:
On my desktop (dualmonitor) the old dualmonitor branch takes 4.48 seconds, the
master branch takes 2.5s and the code in this pull-request takes takes 2.9s to
lock
On my laptop (single screen) both this pull-request and the master branch take
1.8s
So the multimonitor functionality does not seem to add that much overhead for
single monitor systems
If this is satisfactory, I think it would solve the problems described in #10 and #70