Skip to content

Commit

Permalink
get usage from readme
Browse files Browse the repository at this point in the history
  • Loading branch information
HDembinski committed May 31, 2021
1 parent daaefc0 commit cf6b89f
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 48 deletions.
45 changes: 0 additions & 45 deletions README.md

This file was deleted.

1 change: 1 addition & 0 deletions README.md
45 changes: 45 additions & 0 deletions monolens/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# monolens

<!-- description begin -->
View part of your screen in monochrome colors or in simulated protanopia, deuteranopia, or tritanopia.
<!-- description end -->

[<img src="https://img.shields.io/pypi/v/monolens.svg">](https://pypi.org/project/monolens)

Watch the demo on YouTube.

[<img src="https://img.youtube.com/vi/f8FRBlSoqWQ/0.jpg">](https://youtu.be/f8FRBlSoqWQ)

Install with `pip install monolens` and then run `monolens` in a terminal or do it in one
command with or `pipx run monolens`.

# Usage

<!-- usage begin -->
- Drag the lens around by holding a Mouse button down inside the window
- To quit, press Escape, Q, or double click on the lens
- Resize the lens by pressing up, down, left, right
- Press Tab to switch between monochrome view and simulated protanopia, deuteranopia, tritanopia
- Press I to switch view label on/off
- To move the lens to another screen, press M

On OSX, you need to give Monolens permission to make screenshots, which is safe.
<!-- usage end -->

# Known limitations

- The app is tested on OSX and Linux. It may flicker when you move the lens (less so on
OSX). If you know how to fix this, please help. :)
- Pulling the lens to another screen is currently not supported. Press S to switch screens
instead.
- The lens actually uses a static screenshot which is updated as you move the lens around.
This trick is necessary, because an app cannot read the pixels under its own window.
Because of this, the pixels under the app are only updated when you move the lens away
first and then back.
- On OSX, an ordinary app is not allowed to read pixels outside of its window for security
reasons, which is why this app needs special permissions. Doing this is safe; Monolens
contains no networking code and will neither store nor send your pixels anywhere.

# Future plans

- Support gestures to rescale the lens (pinch etc)
8 changes: 7 additions & 1 deletion monolens/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ def main():
import signal
import re

if sys.version_info < (3, 9):
import importlib_resources
else:
import importlib.resources as importlib_resources

QtCore.QCoreApplication.setOrganizationName("Monolens")
QtCore.QCoreApplication.setApplicationName("Monolens")

Expand All @@ -20,7 +25,8 @@ def main():
if "--reset" in app.arguments()[1:]:
settings.clear()

with open("README.md") as f:
pkg = importlib_resources.files("monolens")
with open(pkg / "README.md") as f:
tx = f.read()
tag = "<!-- {0} begin -->\n(.+?)\n<!-- {0} end -->"
m = re.search(tag.format("description"), tx, re.DOTALL)
Expand Down
7 changes: 5 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ version = attr: monolens._version.version
author = Hans Dembinski
author_email = hans.dembinski@gmail.com
description = View part of your screen in monochrome colors or in simulated protanopia, deuteranopia, or tritanopia
license = MIT
license_file = LICENSE
long_description = file: README.md
long_description_content_type = text/markdown
Expand All @@ -22,13 +23,15 @@ install_requires =
pyside6
numpy
numba
importlib_resources;python_version<'3.9'
include_package_data = true
package_data =
monolens = README.md

[options.entry_points]
console_scripts =
monolens = monolens:main

[options.package_data]
* = README.md

[flake8]
max-line-length = 90

0 comments on commit cf6b89f

Please sign in to comment.