i3lock-fancy
i3lock-fancy copied to clipboard
Option to only apply the icon to one monitor?
Hi,
I was just wondering if the master branch could have an option to only overlay the icon on one monitor? That way, when I use my laptop with my external monitor as well as on the go the result is the same. Right now on the master branch version the icon goes in the middle.
Not sure if this is possible or not.
Thanks!
Hello, I'm working on support for dual monitors and would like to see it in the master branch. I just haven't figured out how to handle the light/dark detection and maybe using multiple processes for image manipulations. Would you be interested in seeing the icon/text on all connected monitors?
I'll try my hands on this, once #84 is merged.
Only having the lock and text on a specific monitor (or the one set as primary by xrandr) should be quite easy.
The problem is with i3lock itself. When using the regular i3lock, there is no way to only show the unlock indicator on a single monitor (you can only turn it off entirely), with https://github.com/chrjguill/i3lock-color the unlock indicator can be displayed on a single monitor but identifying the monitor may be a problem because i3lock-color
expects a number that depends on libxinerama
and we use xrandr
which does not give any indices to the monitors and I don't know if the order in which xrandr
lists the monitors is the same order as xinerama uses to number the monitors.
Does anyone know how to determine the xinerama monitor indices from xrandr?
Worst case, we can reuse the code in xinerama.h to reliably get the same output as i3lock.
So far, it seems to be in left to right order, I think (probably ordered somehow off of the offsets)
Yeah, but that would mean we would either need to add a component that needs to be compiled to this project or build a command line wrapper for xinerama, which would add another external dependency.
For now I think, we can just add a parameter where the user has to provide the monitor number and that will then be passed to i3lock This means we would have to have two parameters, one to only show the unlock indicator on a given monitor (by number, same as if passed to i3lock directly) and one to only show the lock icon and text on a given monitor (xrandr name)
I could possibly do something like i3lock --displays
or something to dump the different outputs, so that there's sorta not an external dep
That would be great. I haven't looked too hard at xcb/xinerama.h
and others but I couldn't find a way to get a xrandr style name for a xinerama monitor index.
But maybe you can figure something out.
Moving that to i3lock-color means more functionality wouldn't be available with regular i3lock though.
Normal i3lock can't display the unlock indicator on a specific monitor anyways.
Yeah, normal i3lock just tosses it on every monitor. It's already something that isn't in regular i3lock, so I may as well add some easily grep-able output that can be used.
Ideally I'll be able to just dump a mapping of HDMI-1 -> display 1, DVI-D-1 -> display 0, etc, but I haven't taken a stab at it yet, so I'll see next weekend after I'm done travelling.
How has this progressed?
Just set everything up, with 3 monitors, 2 across the top and one at the bot (L on its side). All screens lock fine, however the lock symbol is bang in the middle of all three is you can see a corner of it on each screen.
As I said before, I will work on this feature once #87 gets merged. This may take a while since everyone is very busy.
If you want you can try to use my multimonitor branch, on which that pull-request is based. While it will not display the lock on one monitor only, it will display the locks on the center of each monitor. I would appreciate the feedback since I could only test it on my dualmonitor setup, please post any comments about that directly on the pull-request.
@patrick96 Cloned your repo, and installed i3lock-fancy-git from AUR.
Moved the icons/ and lock to /usr/local/bin and when typing lock -f FiraCode-Regular -- scrot -z
the lock symbol still appears between all 3 monitors.
Is there an additional step I missed.
Did you checkout the multimonitor branch?
Well there was the issue, working perfectly for what I need. Thank you
Yes, I think having the icon and text message on the first monitor makes sense as an option. I think the lock should either do that, or have it on all monitors.