diff options
-rw-r--r-- | autotiling.sh (renamed from main.py) | 48 |
1 files changed, 14 insertions, 34 deletions
@@ -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() |