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

Merge dev at 1.2.0 to master #18

Merged
merged 31 commits into from
Dec 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
cd79eb2
Split the code into modules
hhannine Jul 11, 2019
b9871f5
Add gitignore for __pycache__
hhannine Nov 17, 2019
243eb7c
Add support for Kubuntu and any other KDE system reporting DESKTOP_SE…
hhannine Nov 17, 2019
48ef997
Sanitize path handling for temp output images.
hhannine Nov 17, 2019
12aac36
On linux move config and temp file paths into XDG_CONFIG_HOME and XDG…
hhannine Nov 17, 2019
62dfde5
Improve Quick Profile Switch on KDE by using old cropped images. XFCE…
hhannine Dec 1, 2019
622d223
Update XFCE support for piecewise quick switch.
hhannine Dec 1, 2019
5e55463
Make temp crop filename removal matching more exact.
hhannine Dec 2, 2019
219f00a
KDE scripting improvements: reduce script calls to one by looping ove…
hhannine Dec 2, 2019
88ec19c
Add requirements files.
hhannine Dec 4, 2019
2c3b69e
Add .desktop file
hhannine Dec 4, 2019
8c951c5
Move .desktop and create icon for installation.
hhannine Dec 7, 2019
3a81889
Update .gitignore
hhannine Dec 7, 2019
c5808fa
Relocate resources for installation availability.
hhannine Dec 8, 2019
88148a7
Add MANIFEST.in
hhannine Dec 8, 2019
7b8651f
Make local module imports explicit. Bump version.
hhannine Dec 8, 2019
62c8f3c
Add setup.py. Beta-stage, only linux compatible.
hhannine Dec 8, 2019
c037b2d
Fix full requirements
hhannine Dec 9, 2019
aece35a
Fix example profile installation
hhannine Dec 9, 2019
7e98623
Rework bezel correction feature.
hhannine Dec 10, 2019
2a34b81
Update setup.py, fix paths.
hhannine Dec 10, 2019
82bae5a
Update help, readme for bezel feature change.
hhannine Dec 10, 2019
fec5463
Add tooling and resources for Windows builds.
hhannine Dec 15, 2019
3ddafb0
Start work on Windows release tooling
hhannine Dec 17, 2019
7962f9e
Make Inno Setup script paths relative, add option to start installati…
hhannine Dec 18, 2019
c1dae35
Fix working directory paths on windows installation. Update examples.
hhannine Dec 19, 2019
0994f59
Pass version string from python to inno setup
hhannine Dec 19, 2019
b75266b
Fix setup.py typo, add a note on setup.py builds and pypi
hhannine Dec 20, 2019
4be3efe
Update install instructions.
hhannine Dec 20, 2019
8c05622
Small README changes.
hhannine Dec 20, 2019
24369ac
Update version and status classifier
hhannine Dec 20, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
__pycache__/
superpaper/__pycache__
build/
dist/
releases/
superpaper.egg-info/
*.spec
4 changes: 4 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include resources/superpaper.png
include resources/test.png
include profiles/*

83 changes: 58 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,45 +47,78 @@ using the manual offset.

In the above banner photo you can see the PPI and bezel corrections in action. The left one is a 27" 4K display, and the right one is a 25" 1440p display.

## Support
If you find Superpaper useful please consider supporting its development: [Support via PayPal][paypal-superpaper].
### Support
If you find Superpaper useful please consider supporting its development: [Support via PayPal][paypal-superpaper] or [Support via Github Sponsors][github-sponsors]. Github matches your donations done through the sponsorship program!

[paypal-superpaper]: https://www.paypal.me/superpaper/5
[github-sponsors]: https://github.com/sponsors/hhannine

## Installation

### A. Portable releases
For Linux and Windows there are portable stand-alone binary packages available under [releases](https://github.com/hhannine/Superpaper/releases).
These work on a download-and-run basis without additional requirements. Look for the executable "superpaper.exe", or "superpaper" on Linux.

Standalone package for Mac OS X is unfortunately unavailable at this time, but you may look at the alternative way to run Superpaper.
## Installation

### Linux

### B. Run the script
Superpaper is available from PyPI, [here][sp-on-pypi].

You may either clone the repository or download the packaged script under releases. You will need to take care of its dependencies, which are:
[sp-on-pypi]: https://pypi.org/project/superpaper

#### Requirements
- Python 3.5+
- Pillow (or the slower PIL should also work, or on Linux the faster Pillow-SIMD)
- Pillow
- screeninfo
- wxpython (tray applet & slideshow, optional)
- wxpython (tray applet, GUI & slideshow, optional)
- system_hotkey (hotkeys, optional)
- xcffib (dep for system_hotkey)
- xpybutil (dep for system_hotkey)

If you install Superpaper from PyPI, pip will handle everything else other than _wxPython_. It will be easiest to install wxPython from your distribution specific package repository:
#### Arch / Manjaro
```
sudo pacman -S python-wxpython
```
#### Debian / Ubuntu and derivatives
```
sudo apt install python3-wxgtk4.0
```
#### Fedora
```
sudo dnf install python3-wxpython4
```
#### Python wheels (if wxPython4 is not in your standard repositories)
For a few CentOS, Debian, Fedora and Ubuntu flavors there are pre-built wheels so on those you can look at the [instructions](https://wxpython.org/pages/downloads/) to install wxpython through pip, without having to build it as you do when installing directly from PyPI.
#### Installing other dependencies manually:
Install via pip3:
```
pip3 install -U Pillow screeninfo system_hotkey xcffib xpybutil
```
#### Running CLI only
If you are going to run only in CLI mode you will need to install the first two modules in the list:
```
pip3 install -U Pillow screeninfo
```
### Installing Superpaper from PyPI
Once wxPython4 is installed, you can just run:
```
pip3 install -U superpaper
```
This will install an icon and .desktop file for menu entries.

If you are going to run only in CLI mode you will need to install the first three in the list. For full functionality you will of course need to install all of them.
### Windows
For Windows an installer and a portable package are available under [releases](https://github.com/hhannine/superpaper/releases).
These work on a download-and-run basis without additional requirements. In the portable package, look for the executable "superpaper.exe" in the subfolder "superpaper".

One can install these easily via pip3:
If you want to run the cloned repo on Windows, on top of the requirements listed in the Linux section, you will need the "pywin32" module (instead of the xcffib and xpybutil modules). Installation through pip:
```
pip3 install -U Pillow screeninfo wxpython system_hotkey pywin32
```
pip3 install Pillow
pip3 install screeninfo
pip3 install wxpython
pip3 install system_hotkey

### Max OS X
Basic support for OS X has been kept in the script but it has not been tested. If you want to try to run it, best bet would be to install the dependencies through pip:
```
System_hotkey has dependencies: on Linux it needs "xcffib" and "xpybutil" modules, and on Windows it needs "pywin32".
Note that on Linux wxpython needs to be built and even though it is automated via pip, it has its own [dependencies](https://wxpython.org/blog/2017-08-17-builds-for-linux-with-pip/index.html),
and the build may take some time.
However for a few CentOS, Debian, Fedora and Ubuntu flavors there are pre-built wheels so on those you can look at the [instructions](https://wxpython.org/pages/downloads/) to install wxpython
without having to build it yourself.
pip install -U wxpython Pillow screeninfo
```
and then clone the repository.



## Usage
Expand Down Expand Up @@ -133,8 +166,8 @@ Accepted values and their explanations are:
- offsets
- horizontal,vertical pixel offsets with offsets of different monitors separated by ";"
- bezels
- List of monitor bezel thicknesses in millimeters, floats are accepted, values separated by ";".
- Measure at the edges where monitor sides meet. A possible gap can be included in the values given.
- List of adjacent monitor bezel pairs' thicknesses in millimeters, i.e. "bezel+gap+bezel", floats are accepted, values separated by ";".
- Measure adjacent bezels and add them together with a possible gap to get a combined thickness. One value for 2 monitors, two values for 3 and so on.
- diagonal_inches
- List of monitor diagonals in inches. Used for computing display pixel densities (PPI).
- hotkey
Expand Down
9 changes: 9 additions & 0 deletions pyinstaller_wrapper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"""
Simple wrapper that makes the module structure of Superpaper
compatible with PyInstaller builds.
"""

from superpaper.superpaper import main

if __name__ == '__main__':
main()
11 changes: 11 additions & 0 deletions readme-setuppy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Some notes on building and uploading PyPI packages

## Building a wheel / sdist
python3 setup.py sdist bdist_wheel

## Checking that twine (pypi tool) passes the built package
twine check dist/*

## Uploading to PyPI
python3 -m twine upload dist/*

2 changes: 2 additions & 0 deletions requirements_cli.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Pillow>=6.0.0
screeninfo>=0.6.1
5 changes: 5 additions & 0 deletions requirements_full_linux.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Pillow>=6.0.0
screeninfo>=0.6.1
system_hotkey>=1.0
xcffib>=0.8.0
xpybutil>=0.0.5
5 changes: 5 additions & 0 deletions requirements_full_windows.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Pillow>=6.0.0
screeninfo>=0.6.1
wxPython>=4.0.4
system_hotkey>=1.0
pywin32
85 changes: 85 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import os
import platform
import sys
from setuptools import setup


def read_version():
with open("superpaper/__version__.py") as verfile:
verlines = verfile.readlines()
for line in verlines:
if "__version__" in line:
ver_str = line.split("=")[1].strip().replace('"',"")
print(ver_str)
return ver_str
print("Version not found, exitting install.")
sys.exit(1)


def test_import(packaname, humanname):
try:
__import__(packaname)
except ImportError:
print("{} import failed; refer to the install instructions.".format(humanname))
sys.exit(1)

if __name__ == "__main__":
test_import("wx", "wxPython")

with open(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'README.md'),
encoding='utf-8') as f:
long_description = f.read()

setup(
name="superpaper",
version=read_version(),
author="Henri Hänninen",
description="Cross-platform wallpaper manager that focuses on "
"multi-monitor support. Features include ppi corrections, "
"keyboard shortcuts, slideshow.",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/hhannine/superpaper",

classifiers=[
# "Development Status :: 4 - Beta",
"Development Status :: 5 - Production/Stable",
"Environment :: X11 Applications",
# "Environment :: Win32",
"Intended Audience :: End Users/Desktop",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: POSIX :: Linux",
# "Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 3.5",
"Topic :: Utilities",
],
keywords="dual-monitor multi-monitor wallpaper background manager",
license="MIT",

# python_requires="~=3.5",
install_requires=[
"Pillow>=6.0.0",
"screeninfo>=0.6.1",
"system_hotkey>=1.0.3",
"xcffib>=0.8.0",
"xpybutil>=0.0.5"
],
packages=["superpaper"],
entry_points={
"console_scripts": ["superpaper = superpaper.superpaper:main"]
# "gui_scripts": ["superpaper = superpaper.superpaper:main"] # for possible future windows install support.
},
package_data={
"superpaper": ["resources/superpaper.png",
"resources/test.png",
"profiles/example.profile",
"profiles/example_multi.profile"
]
},
data_files=[
("share/applications", ["superpaper/resources/superpaper.desktop"]),
("share/icons/hicolor/256x256/apps", ["superpaper/resources/superpaper.png"]),
]

)
Loading