diff --git a/README.rst b/README.rst index 7cf79c1..8ec8bc0 100644 --- a/README.rst +++ b/README.rst @@ -23,7 +23,7 @@ Install using pip (recommended): :: - pip install pi3-switch + pip install pi3-smart-workspace Example config to be inserted into your i3 config. diff --git a/pi3/__pycache__/__init__.cpython-38.pyc b/pi3/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 0000000..f28d6cf Binary files /dev/null and b/pi3/__pycache__/__init__.cpython-38.pyc differ diff --git a/pi3/__pycache__/smart_workspace.cpython-38.pyc b/pi3/__pycache__/smart_workspace.cpython-38.pyc new file mode 100644 index 0000000..b9c811a Binary files /dev/null and b/pi3/__pycache__/smart_workspace.cpython-38.pyc differ diff --git a/pi3/smart-workspace.py b/pi3/smart_workspace.py similarity index 96% rename from pi3/smart-workspace.py rename to pi3/smart_workspace.py index e9296b1..b7124a8 100644 --- a/pi3/smart-workspace.py +++ b/pi3/smart_workspace.py @@ -1,6 +1,5 @@ from i3ipc import Connection import sys -from pprint import pprint import pynput import re import argparse @@ -28,13 +27,11 @@ class WorkSpacer: re.finditer(r'set (\$[a-zA-Z]+) ((HDMI|DP|VGA)-\d)', self.config, re.MULTILINE), start=1 ): config_outputs[match.group(1)] = match.group(2) - pprint(config_outputs) config_workspace_names = {} for matchNum, match in enumerate( re.finditer(r'set (\$.*) (\d.*)', self.config, re.MULTILINE) ): config_workspace_names[match.group(1)] = match.group(2) - pprint(config_workspace_names) for matchNum, match in enumerate( re.finditer(r'workspace (\$.*) output (\$.*)', self.config, re.MULTILINE) ): @@ -88,7 +85,6 @@ def main(): ws.run() -# Press the green button in the gutter to run the script. if __name__ == '__main__': main() diff --git a/pi3_smart_workspace.egg-info/PKG-INFO b/pi3_smart_workspace.egg-info/PKG-INFO new file mode 100644 index 0000000..2f235ec --- /dev/null +++ b/pi3_smart_workspace.egg-info/PKG-INFO @@ -0,0 +1,127 @@ +Metadata-Version: 1.1 +Name: pi3-smart-workspace +Version: 0.0.1 +Summary: 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. +Home-page: https://github.com/GeneralDenmark/PyOutputHandler +Author: Asger Geel Weirsøe +Author-email: asger@weirsoe.dk +License: Apache-2.0 License +Description: About + ----- + + 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. + + Allowing for a more seameless interaction with how workspaces are openend. + + Usage + ----- + + :: + + usage: pi3-smart-switch [-h] -i num + Openens the [i] number of workspace assigned in the config, on the output the cursor is currently on. + + + requred arguments: + -i, --index the number index of the workspace that should be openend. 1 = first workspace in config etc. + Installation + ------------ + + Install using pip (recommended): + + :: + + pip install pi3-smart-workspace + + Example config to be inserted into your i3 config. + + :: + + # Displays + set $primary DP-2 + set $left HDMI-0 + set $right HDMI-1 + + # WOrkspaces + set $ws1 1:1:Code + set $ws2 2:2:Code + set $ws3 3:3:Code + set $ws4 4:4:Code + set $ws5 5:5:Code + set $ws6 6:6:Code + set $ws7 7:7:Code + set $ws8 8:8:Code + + set $LeftWs1 1:1:Browser + set $LeftWs2 2:2:Left + set $LeftWs3 3:3:Left + set $LeftWs4 4:4:Left + set $LeftWs5 5:5:Left + set $LeftWs6 6:6:Left + set $LeftWs7 7:7:Left + set $LeftWs8 8:8:Left + + set $RightWs1 1:1:Right + set $RightWs2 2:2:Right + set $RightWs3 3:3:Right + set $RightWs4 4:4:Right + set $RightWs5 5:5:Right + set $RightWs6 6:6:Right + set $RightWs7 7:7:Right + set $RightWs8 8:8:Right + + # Workspace assignments + workspace $ws1 output $primary + workspace $ws2 output $primary + workspace $ws3 output $primary + workspace $ws4 output $primary + workspace $ws5 output $primary + workspace $ws6 output $primary + workspace $ws7 output $primary + workspace $ws8 output $primary + + workspace $LeftWs1 output $left + workspace $LeftWs2 output $left + workspace $LeftWs3 output $left + workspace $LeftWs4 output $left + workspace $LeftWs5 output $left + workspace $LeftWs6 output $left + workspace $LeftWs7 output $left + workspace $LeftWs8 output $left + + workspace $RightWs1 output $right + workspace $RightWs2 output $right + workspace $RightWs3 output $right + workspace $RightWs4 output $right + workspace $RightWs5 output $right + workspace $RightWs6 output $right + workspace $RightWs7 output $right + workspace $RightWs8 output $right + + # Binded + bindsym $mod+Mod1+1 exec pi3-smart-workspace -i 1 + bindsym $mod+Mod1+2 exec pi3-smart-workspace -i 2 + bindsym $mod+Mod1+3 exec pi3-smart-workspace -i 3 + bindsym $mod+Mod1+4 exec pi3-smart-workspace -i 4 + bindsym $mod+Mod1+5 exec pi3-smart-workspace -i 5 + bindsym $mod+Mod1+6 exec pi3-smart-workspace -i 6 + bindsym $mod+Mod1+7 exec pi3-smart-workspace -i 7 + bindsym $mod+Mod1+8 exec pi3-smart-workspace -i 8 + + + Credits + ------- + + Thanks to Michał Wieluński for an inspiration (`pi3-switch`_) and + Tony Crisci for an easy-to-use i3 python library (`i3ipc-python`_). + + .. _pipsi: https://github.com/mitsuhiko/pipsi + .. _pi3-switch: https://github.com/landmaj/pi3-switch + .. _i3ipc-python: https://github.com/acrisci/i3ipc-python + +Platform: UNKNOWN +Classifier: Development Status :: 2 - Pre-Alpha +Classifier: License :: OSI Approved :: Apache Software License +Classifier: Operating System :: POSIX :: Linux +Classifier: Programming Language :: Python :: 3 +Classifier: Topic :: Desktop Environment :: Window Managers diff --git a/pi3_smart_workspace.egg-info/SOURCES.txt b/pi3_smart_workspace.egg-info/SOURCES.txt new file mode 100644 index 0000000..b49632d --- /dev/null +++ b/pi3_smart_workspace.egg-info/SOURCES.txt @@ -0,0 +1,10 @@ +README.rst +setup.py +pi3/__init__.py +pi3/smart_workspace.py +pi3_smart_workspace.egg-info/PKG-INFO +pi3_smart_workspace.egg-info/SOURCES.txt +pi3_smart_workspace.egg-info/dependency_links.txt +pi3_smart_workspace.egg-info/entry_points.txt +pi3_smart_workspace.egg-info/requires.txt +pi3_smart_workspace.egg-info/top_level.txt \ No newline at end of file diff --git a/pi3_smart_workspace.egg-info/dependency_links.txt b/pi3_smart_workspace.egg-info/dependency_links.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/pi3_smart_workspace.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/pi3_smart_workspace.egg-info/entry_points.txt b/pi3_smart_workspace.egg-info/entry_points.txt new file mode 100644 index 0000000..578d604 --- /dev/null +++ b/pi3_smart_workspace.egg-info/entry_points.txt @@ -0,0 +1,3 @@ +[console_scripts] +pi3-smart-workspace = pi3.smart_workspace:main + diff --git a/pi3_smart_workspace.egg-info/requires.txt b/pi3_smart_workspace.egg-info/requires.txt new file mode 100644 index 0000000..57eb532 --- /dev/null +++ b/pi3_smart_workspace.egg-info/requires.txt @@ -0,0 +1,5 @@ +evdev==1.3.0 +i3ipc==2.2.1 +pynput==1.7.1 +python-xlib==0.27 +six==1.15.0 diff --git a/pi3_smart_workspace.egg-info/top_level.txt b/pi3_smart_workspace.egg-info/top_level.txt new file mode 100644 index 0000000..dbe1dee --- /dev/null +++ b/pi3_smart_workspace.egg-info/top_level.txt @@ -0,0 +1 @@ +pi3 diff --git a/setup.py b/setup.py index e2e78d3..fc85a92 100644 --- a/setup.py +++ b/setup.py @@ -1,27 +1,26 @@ from setuptools import setup - with open('README.rst', 'r') as fh: long_description = fh.read() -with open('requirements.txt', 'r') as file: - required = [] - for x in file.readline(): - required.append(x) - setup( - name="pi3-smart-workspace", - description="A smart switcher for multiple workspaces.", + name='pi3-smart-workspace', + version='0.0.1', + packages=['pi3'], + url='https://github.com/GeneralDenmark/PyOutputHandler', + license='Apache-2.0 License ', + install_requires=[ + "evdev==1.3.0", + "i3ipc==2.2.1", + "pynput==1.7.1", + "python-xlib==0.27", + "six==1.15.0" + ], + entry_points={"console_scripts": ["pi3-smart-workspace=pi3.smart_workspace:main"]}, + scripts=["pi3/smart_workspace.py"], long_description=long_description, - version="0.0.1", - license="Apache License", - author="Asger Geel Weirsøe", - author_email="asger@weirsoe.dk", - url="https://github.com/GeneralDenmark/PyOutputHandler", - install_requires=required, - packages=["pi3"], - zip_safe=True, - entry_points={"console_scripts": ["pi3-smart-workspace = pi3.smart-workspace:main"]}, - scripts=["pi3/smart-workspace.py"], + author='Asger Geel Weirsøe', + 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.', classifiers=[ "Development Status :: 2 - Pre-Alpha", "License :: OSI Approved :: Apache Software License", @@ -29,4 +28,4 @@ setup( "Programming Language :: Python :: 3", "Topic :: Desktop Environment :: Window Managers", ], -) \ No newline at end of file +)