Welcome to Custom Screen Resolution’s documentation!

Custom Screen Resolution

https://snapcraft.io//custom-screen-resolution/badge.svg https://img.shields.io/pypi/v/custom_screen_resolution.svg https://travis-ci.com/anopensourcecoder/custom_screen_resolution.svg?branch=master Documentation Status Updates

Create custom resolution base on screen size, dpi and zoom level.

I find myself to be comfortable with screen DPI between 100 to 140. It also depends to the distance between display and my eys. Plus the font size and sharpness of font.

High DPI might be usefull for graphic software but it has issue with remote desktop and older software. Also when you have multiple displays with different DPI.

This software allows findout best DPI that can solve the problem. It can also can suggest same DPI at higher scaling level. For example a 14 inch display with resolution of 2560x1440 has a DPI equal to 209.

dpi 2560 1440 14 DPI: 209.80

A quick solution is to set the resolution to 1280x720 because the DPI of 100.5 falls into comfortable level. dpi 1280 720 14 DPI: 104.90

Unfortunately the output become blury because LCD disply only can provide sharp display at native resolution. This issue can be solved by creating a custom resolution that is integer scaled by 2.

Here is an example how you can calculate it 2560 1440 14 –zoom 2 DPI: 104.90

As you see now we can have a lower DPI resolution at higer native LCD resolution that is integer scaled by 2. This give you best of both worlds. Sharp text with lower DPI.

Note. Currently only latest Xrandr development version hub support integer scaling.

This way you can have both sharp pixel at native resolution while having lower DPI. You also can use it to have a lower resolution at your comfort DPI level. This can help to save power and battery life that is important for portable device. Lower resolution and DPI need less internet bandwidth too. This can improve remote desktop performance.

Features

  • Gui and Cli interface.
  • Calculate Width and height base on screen size, dpi and aspect ratio
  • Calculate screen size base on resolution and dpi
  • Calculate screen size base on screen size and dpi and zoom level

How to install

https://snapcraft.io/static/images/badges/en/snap-store-black.svg

Please install using Snapcraft:

$ snap install custom-screen-resolution

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

Installation

From Snap Store

Get it from Snap store at https://snapcraft.io/custom-screen-resolution

https://snapcraft.io/static/images/badges/en/snap-store-black.svg

To install Custom Screen Resolution, run this command in your terminal:

$ snap install custom-screen-resolution

This is the preferred method to install Custom Screen Resolution, as it will always install the most recent stable release.

Stable release

To install Custom Screen Resolution, run this command in your terminal:

$ pip install custom_screen_resolution

This is the preferred method to install Custom Screen Resolution, as it will always install the most recent stable release.

If you don’t have pip installed, this Python installation guide can guide you through the process.

From sources

The sources for Custom Screen Resolution can be downloaded from the Github repo.

You can either clone the public repository:

$ git clone git://github.com/anopensourcecoder/custom_screen_resolution

Or download the tarball:

$ curl -OJL https://github.com/anopensourcecoder/custom_screen_resolution/tarball/master

Once you have a copy of the source, you can install it with:

$ python setup.py install

Usage

To use Custom Screen Resolution in a project:

import custom_screen_resolution

custom_screen_resolution

custom_screen_resolution package

Submodules

custom_screen_resolution.cli module

custom_screen_resolution.custom_screen_resolution module

class custom_screen_resolution.custom_screen_resolution.Height(ratio_x, ratio_y, width_pixels)[source]

Bases: object

display()[source]
get()[source]
class custom_screen_resolution.custom_screen_resolution.PPI(x, y, size, scale=1)[source]

Bases: object

display()[source]
get_effective_resolution()[source]
get_ppi()[source]
class custom_screen_resolution.custom_screen_resolution.Resolution(diagonal_size, ppi, ratio_x, ratio_y)[source]

Bases: object

display()[source]
get()[source]
get_diagonal_size()[source]
get_height_pixels()[source]
get_ratio()[source]
get_ratio_x()[source]
get_ratio_y()[source]
get_width_pixels()[source]
class custom_screen_resolution.custom_screen_resolution.Scale(x, y, size, ppi)[source]

Bases: object

display()[source]
get()[source]
class custom_screen_resolution.custom_screen_resolution.Screen_Info(width, height, video_port='HDMI1', zoom=1, rotate='normal')[source]

Bases: object

generate()[source]
get_xrandr_activate_mode()[source]
get_xrandr_add_mode()[source]
get_xrandr_new_mode()[source]

custom_screen_resolution.gui module

class custom_screen_resolution.gui.CSR_GUI(main_form)[source]

Bases: object

about_command()[source]
close_about_window(about_window)[source]
demo_dpi()[source]
demo_side()[source]
demo_size()[source]
logo_command()[source]
quit(event)[source]
screen_dpi_command()[source]
screen_size_command()[source]
side_command()[source]
window_xrandr_command()[source]
xrandr_apply_commnad()[source]
xrandr_close_commnad(xrandr_window)[source]
custom_screen_resolution.gui.main()[source]

Module contents

Top-level package for Custom Screen Resolution.

class custom_screen_resolution.Resolution(diagonal_size, ppi, ratio_x, ratio_y)[source]

Bases: object

display()[source]
get()[source]
get_diagonal_size()[source]
get_height_pixels()[source]
get_ratio()[source]
get_ratio_x()[source]
get_ratio_y()[source]
get_width_pixels()[source]
class custom_screen_resolution.Height(ratio_x, ratio_y, width_pixels)[source]

Bases: object

display()[source]
get()[source]
class custom_screen_resolution.PPI(x, y, size, scale=1)[source]

Bases: object

display()[source]
get_effective_resolution()[source]
get_ppi()[source]
class custom_screen_resolution.Scale(x, y, size, ppi)[source]

Bases: object

display()[source]
get()[source]
class custom_screen_resolution.Screen_Info(width, height, video_port='HDMI1', zoom=1, rotate='normal')[source]

Bases: object

generate()[source]
get_xrandr_activate_mode()[source]
get_xrandr_add_mode()[source]
get_xrandr_new_mode()[source]

Contributing

Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.

You can contribute in many ways:

Types of Contributions

Report Bugs

Report bugs at https://github.com/anopensourcecoder/custom_screen_resolution/issues.

If you are reporting a bug, please include:

  • Your operating system name and version.
  • Any details about your local setup that might be helpful in troubleshooting.
  • Detailed steps to reproduce the bug.

Fix Bugs

Look through the GitHub issues for bugs. Anything tagged with “bug” and “help wanted” is open to whoever wants to implement it.

Implement Features

Look through the GitHub issues for features. Anything tagged with “enhancement” and “help wanted” is open to whoever wants to implement it.

Write Documentation

Custom Screen Resolution could always use more documentation, whether as part of the official Custom Screen Resolution docs, in docstrings, or even on the web in blog posts, articles, and such.

Submit Feedback

The best way to send feedback is to file an issue at https://github.com/anopensourcecoder/custom_screen_resolution/issues.

If you are proposing a feature:

  • Explain in detail how it would work.
  • Keep the scope as narrow as possible, to make it easier to implement.
  • Remember that this is a volunteer-driven project, and that contributions are welcome :)

Get Started!

Ready to contribute? Here’s how to set up custom_screen_resolution for local development.

  1. Fork the custom_screen_resolution repo on GitHub.

  2. Clone your fork locally:

    $ git clone git@github.com:your_name_here/custom_screen_resolution.git
    
  3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development:

    $ mkvirtualenv custom_screen_resolution
    $ cd custom_screen_resolution/
    $ python setup.py develop
    
  4. Create a branch for local development:

    $ git checkout -b name-of-your-bugfix-or-feature
    

    Now you can make your changes locally.

  5. When you’re done making changes, check that your changes pass flake8 and the tests, including testing other Python versions with tox:

    $ flake8 custom_screen_resolution tests
    $ python setup.py test or pytest
    $ tox
    

    To get flake8 and tox, just pip install them into your virtualenv.

  6. Commit your changes and push your branch to GitHub:

    $ git add .
    $ git commit -m "Your detailed description of your changes."
    $ git push origin name-of-your-bugfix-or-feature
    
  7. Submit a pull request through the GitHub website.

Pull Request Guidelines

Before you submit a pull request, check that it meets these guidelines:

  1. The pull request should include tests.
  2. If the pull request adds functionality, the docs should be updated. Put your new functionality into a function with a docstring, and add the feature to the list in README.rst.
  3. The pull request should work for Python 3.5, 3.6, 3.7 and 3.8, and for PyPy. Check https://travis-ci.com/anopensourcecoder/custom_screen_resolution/pull_requests and make sure that the tests pass for all supported Python versions.

Tips

To run a subset of tests:

$ pytest tests.test_custom_screen_resolution

Deploying

A reminder for the maintainers on how to deploy. Make sure all your changes are committed (including an entry in HISTORY.rst). Then run:

$ bump2version patch # possible: major / minor / patch
$ git push
$ git push --tags

Travis will then deploy to PyPI if tests pass.

Generating docs

Generate doc with:

$ pip3 install sphinx
$ make docs

Credits

Development Lead

Contributors

None yet. Why not be the first?

History

1.17.0 (2020-05-28)

Uploaded on snap store at https://snapcraft.io/custom-screen-resolution

Install from store or from terminal:

$ snap install custom-screen-resolution

0.1.0 (2020-02-21)

  • First release on PyPI.

Indices and tables