Skip to content
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

Option to only apply the icon to one monitor? #73

Open
michaelplews opened this issue Mar 6, 2017 · 15 comments
Open

Option to only apply the icon to one monitor? #73

michaelplews opened this issue Mar 6, 2017 · 15 comments
Labels

Comments

@michaelplews
Copy link

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!

@AladW AladW added the question label Mar 6, 2017
@meskarune
Copy link
Owner

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?

@patrick96
Copy link
Contributor

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?

@PandorasFox
Copy link
Contributor

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)

@patrick96
Copy link
Contributor

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)

@PandorasFox
Copy link
Contributor

I could possibly do something like i3lock --displays or something to dump the different outputs, so that there's sorta not an external dep

@patrick96
Copy link
Contributor

patrick96 commented Jun 27, 2017

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.

@AladW
Copy link
Collaborator

AladW commented Jun 29, 2017

Moving that to i3lock-color means more functionality wouldn't be available with regular i3lock though.

@patrick96
Copy link
Contributor

Normal i3lock can't display the unlock indicator on a specific monitor anyways.

@PandorasFox
Copy link
Contributor

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.

@Fenwick17
Copy link

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.

@patrick96
Copy link
Contributor

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.

@Fenwick17
Copy link

@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.

@patrick96
Copy link
Contributor

Did you checkout the multimonitor branch?

@Fenwick17
Copy link

Well there was the issue, working perfectly for what I need. Thank you

@meskarune
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants