-
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 (2nd try) #87
Conversation
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
For someone that doesn't know what i3lock-fancy does, this may clear some things up
Hmm, I'm still not fond of the "<<<xrandr" construction, as with #68. More generally, I think the added complexity and specific use case warrants splitting this up to several smaller scripts. (not necessarily just a bunch of files that are sourced, but independent modules) |
By different modules do you mean something like this?
This way xrandr is only used, if the user explicitly requests multimonitor support. |
Any update on this? |
Sorry, this is a rather large pull request and I'm in the middle of the exam period. Regarding your question on modules, it's a start but also more a superficial change. Ideally the functionality could be split in small blocks that would be interconnected (e.g. via pipes). |
Thanks for the quick response. I don't really understand how you want me to split up the functionality, could you give me some example? Also we don't have to discuss that now, if you don't have time. We can talk about this once exams are over. Good luck on those btw. |
fix typo
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
We again only use a single file so we just create a temp png file
Since we again only have a single file to delete
is this pr ready for use? i will build my package based on this pr if this is working. Looks like this is not getting merged for a long time. |
Ready for use? Yes, I use it on a daily basis. That being said, I cannot guarantee it will work for everyone else and I will also not provide support for the code. I will close this PR as I don't have the time to do any more work on this right now or in the near future. |
I still plan to look at this at some point, so I'll reopen this PR if you don't mind. |
Please test #155. Latter seems to have most of the functionality while being relatively easy to review. |
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