aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2024-05-29 20:58:54 +0200
committerMatěj Cepl <mcepl@cepl.eu>2024-05-29 20:58:54 +0200
commit799c5a397a90102b6fd53a8201654d5d3645bb70 (patch)
tree5f22e17f2e43e7ad6f4b29c9a33e335108bf5625
parent1a494fa2da0f42ddc5f316f6d6a4e9b4838aa0b5 (diff)
downloadautotiling-bash.tar.gz
more destruction of unnecessarybash
-rw-r--r--autotiling.sh (renamed from main.py)48
1 files changed, 14 insertions, 34 deletions
diff --git a/main.py b/autotiling.sh
index 4ccfe59..db1c2e6 100644
--- a/main.py
+++ b/autotiling.sh
@@ -1,36 +1,20 @@
-#!/usr/bin/env python3
-
-"""
-This script uses the i3ipc python module to switch the layout splith / splitv
-for the currently focused window, depending on its dimensions.
-It works on both sway and i3 window managers.
-
-Inspired by https://github.com/olemartinorg/i3-alternating-layout
-
-Copyright: 2019-2021 Piotr Miller & Contributors
-e-mail: nwg.piotr@gmail.com
-Project: https://github.com/nwg-piotr/autotiling
-License: GPL3
-
-Dependencies: python-i3ipc>=2.0.1 (i3ipc-python)
-"""
-import argparse
-import os
-import sys
-from functools import partial
+#!/usr/bin/bash
+
+# This script uses the i3ipc python module to switch the layout splith / splitv
+# for the currently focused window, depending on its dimensions.
+# It works on both sway and i3 window managers.
+#
+# Inspired by https://github.com/olemartinorg/i3-alternating-layout
+#
+# Copyright: 2019-2021 Piotr Miller & Contributors
+# e-mail: nwg.piotr@gmail.com
+# Project: https://github.com/nwg-piotr/autotiling
+# License: GPL3
+#
+# Dependencies: python-i3ipc>=2.0.1 (i3ipc-python)
from i3ipc import Connection, Event
-try:
- from .__about__ import __version__
-except ImportError:
- __version__ = "unknown"
-
-
-def temp_dir():
- return os.getenv("TMPDIR") or os.getenv("TEMP") or os.getenv("TMP") or "/tmp"
-
-
def save_string(string, file_path):
try:
with open(file_path, "wt") as file:
@@ -208,7 +192,3 @@ def main():
print(f"'{e}' is not a valid event", file=sys.stderr)
i3.main()
-
-
-if __name__ == "__main__":
- main()