Skip to content
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.

Commit

Permalink
Update i3-workspace-reset.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenneth Schnall committed Jun 14, 2020
1 parent abc6f2b commit ec84cc7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions i3-workspace-reset.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from i3ipc import Connection

i3 = Connection()

EXCLUDED_OUTPUTS = ["__i3"]

connection = Connection()


def append_string_to_workspaces(append_string, workspace_counter, workspace_name):
"""Rename the given workspace by appending a string to the workspace name."""
Expand All @@ -15,7 +15,7 @@ def append_string_to_workspaces(append_string, workspace_counter, workspace_name
def get_outputs():
"""Get the available outputs, excluding outputs in the EXCLUDED_OUTPUTS variable."""
outputs = []
tree = i3.get_tree()
tree = connection.get_tree()
for node in filter(
lambda node: node.type == "output" and node.name not in EXCLUDED_OUTPUTS, tree
):
Expand All @@ -27,7 +27,7 @@ def get_outputs():

def rename_workspace(original_workspace_name, new_workspace_name):
"""Rename a workspace."""
i3.command(
connection.command(
f'rename workspace "{original_workspace_name}" to "{new_workspace_name}"'
)

Expand Down

0 comments on commit ec84cc7

Please sign in to comment.