aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPiotr Miller <nwg.piotr@gmail.com>2020-10-15 10:27:46 +0200
committerGitHub <noreply@github.com>2020-10-15 10:27:46 +0200
commit58de027b790d56515b202d4a26abe7fda9cd9dbc (patch)
treeba285f875e38304cff4384c21bfdedb3cbff33b6
parent7cdfd0e61bc512cf863bfe1986b4c2e64b28c28f (diff)
parent616b2089e8fec55f610e03b0186ee90c48cdf49a (diff)
downloadautotiling-58de027b790d56515b202d4a26abe7fda9cd9dbc.tar.gz
Merge pull request #18 from Lqp1/master
Allow autotiling to be run manually again
-rw-r--r--autotiling/main.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/autotiling/main.py b/autotiling/main.py
index f3644a7..3f6969e 100644
--- a/autotiling/main.py
+++ b/autotiling/main.py
@@ -18,7 +18,12 @@ from functools import partial
from i3ipc import Connection, Event
-from .__about__ import __version__
+
+try:
+ from .__about__ import __version__
+except ImportError:
+ __version__ = "unknown"
+
def switch_splitting(i3, e, debug):
@@ -84,3 +89,8 @@ def main():
i3 = Connection()
i3.on(Event.WINDOW_FOCUS, handler)
i3.main()
+
+
+if __name__ == "__main__":
+ # execute only if run as a script
+ main()