4 Commits

Author SHA1 Message Date
Asger Geel Weirsøe
f4ec4385b2 v0.1.2 2020-09-05 12:36:16 +02:00
Asger Geel Weirsøe
184832d805 updates readme 2020-09-05 12:29:38 +02:00
Asger Geel Weirsøe
d6015c5576 adds build script for deploying to pypi.org and smaller changes to the setup script 2020-09-05 12:25:33 +02:00
Asger Geel Weirsøe
4646f1c230 final fixes for v0.1.1 2020-09-05 11:59:07 +02:00
4 changed files with 49 additions and 2 deletions

3
.gitignore vendored
View File

@@ -1,3 +1,6 @@
**__pycache__/ **__pycache__/
.idea .idea
**.egg-info/ **.egg-info/
build/
dist/
.pypirc

View File

@@ -16,6 +16,14 @@ Usage
requred arguments: requred arguments:
-i, --index the number index of the workspace that should be openend. 1 = first workspace in config etc. -i, --index the number index of the workspace that should be openend. 1 = first workspace in config etc.
Current limitations
--------------------
The way this script is set up, it is sending commands in strings. and thus we cannot keep track of each workspace other than by its name. This is a limmitiaion as there is no way for us to know if the workspace "1" is reffering to the workspace 1 assigned to output DS-1 or output HDMI-2..
So in order to differentiate between these, you need to name your workspaces new names for each output. See example configuration under #Installation.
Installation Installation
------------ ------------
@@ -34,7 +42,7 @@ Example config to be inserted into your i3 config.
set $left HDMI-0 set $left HDMI-0
set $right HDMI-1 set $right HDMI-1
# WOrkspaces # Workspaces
set $ws1 1:1:Code set $ws1 1:1:Code
set $ws2 2:2:Code set $ws2 2:2:Code
set $ws3 3:3:Code set $ws3 3:3:Code

35
build.py Normal file
View File

@@ -0,0 +1,35 @@
import argparse
import subprocess
def main():
parser = argparse.ArgumentParser("Build script for pypi and pypi test")
group = parser.add_mutually_exclusive_group(required=True)
group.add_argument(
'--test',
action='store_true',
help='Build to test.pypi.org'
)
group.add_argument(
'--re',
action='store_true',
help='Build to pypi.org'
)
group.add_argument(
'--check',
action='store_true',
help='Displays the twine check for dist'
)
args = parser.parse_args()
subprocess.call(['python3', 'setup.py', 'sdist', 'bdist_wheel'])
if args.test:
subprocess.call(['twine', 'upload', '--config-file', '.pypirc', '--repository', 'testpypi', 'dist/*'])
elif args.re:
subprocess.call(['twine', 'upload', '--config-file', '.pypirc', '--repository', 'pypi', 'dist/*'])
else:
subprocess.call(['twine', 'check', 'dist/*'])
if __name__ == '__main__':
main()

View File

@@ -4,7 +4,7 @@ with open('README.rst', 'r') as fh:
setup( setup(
name='pi3-smart-workspace', name='pi3-smart-workspace',
version='0.1.0', version='0.1.2',
packages=['pi3'], packages=['pi3'],
url='https://github.com/GeneralDenmark/PyOutputHandler', url='https://github.com/GeneralDenmark/PyOutputHandler',
license='Apache-2.0 License ', license='Apache-2.0 License ',
@@ -18,6 +18,7 @@ setup(
entry_points={"console_scripts": ["pi3-smart-workspace=pi3.smart_workspace:main"]}, entry_points={"console_scripts": ["pi3-smart-workspace=pi3.smart_workspace:main"]},
scripts=["pi3/smart_workspace.py"], scripts=["pi3/smart_workspace.py"],
long_description=long_description, long_description=long_description,
long_description_content_type='text/x-rst',
author='Asger Geel Weirsøe', author='Asger Geel Weirsøe',
author_email='asger@weirsoe.dk', author_email='asger@weirsoe.dk',
description='Simple program that looks through the i3 config and finds the bound workspaces for each output, and then opening that workspace on the output, that the mouse is currently on.', description='Simple program that looks through the i3 config and finds the bound workspaces for each output, and then opening that workspace on the output, that the mouse is currently on.',