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

Use ffmpeg, add support for multiple monitors #146

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

rinfiyks
Copy link

@rinfiyks rinfiyks commented Mar 31, 2019

The main motivation for this was to speed up the script (see #6). I also added support for an arbitrary number of monitors (see #10).
It now takes around 0.3 s on my desktop and 0.6 s on my laptop (0.2/0.4 if you use -pixelate).

The method is to build up a filtergraph for ffmpeg. The stages of the filtergraph are as follows:

  • Blur or pixelate or greyscale the input image.
  • Add the lock images.
  • Add text. This is achieved by creating a small (800x100) area which black text is added to and then blurred, then adding some non-blurred black text for a more solid outline, and finally adding the white text over the top. The result is a black shadow around the text so it can be read on any background. The reason for the 800x100 area is it's quicker to apply the blur.

Missing features and problems:

  • No lightness/darkness detection.
  • As ffmpeg handles capturing the desktop now, I removed the custom scrot command part, so you can no longer set custom flags e.g. imposing a delay. I don't think this is a huge problem as you can create your delay before executing the script.
  • Using xrandr to figure out the size and location of all the displays. It's probably not ideal but I couldn't find an easier way.

@llenck llenck mentioned this pull request Dec 23, 2019
@AladW
Copy link
Collaborator

AladW commented Jun 25, 2020

There's way too many unrelated changes here. Otherwise the filtergraph functionality could likely be implemented in a seperate command.

#155

@AladW AladW closed this Jun 25, 2020
@AladW AladW mentioned this pull request Jun 27, 2020
@rinfiyks
Copy link
Author

Hi @AladW, if you could give me some direction on what I could do to make this more reviewable then I can open a new one that is hopefully better.

Regarding the 'too many unrelated changes', I could remove all of the multi-monitor code and leave just the ffmpeg stuff?

@AladW
Copy link
Collaborator

AladW commented Jul 18, 2020

I'm pressed for time now, so I'll reopen this to address it in the future. Splitting up the ffmpeg and multi-monitor (to several commits) would indeed be a good start.

@AladW AladW reopened this Jul 18, 2020
@brodokk
Copy link

brodokk commented Apr 12, 2022

While this branch is in conflict with master I want anyway to add a fix to it since the PR is still open because its not working by itself for me on archlinux...

The lock_file path is incorrect. It should be /usr/share/i3lock-fancy/icons/lock.png, the lock icon is in an icons folder and not at the root of the i3lock-fancy folder.

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

Successfully merging this pull request may close these issues.

3 participants