Skip to content
Snippets Groups Projects
Commit 8b1fc1b9 authored by Jiří Kalvoda's avatar Jiří Kalvoda
Browse files

Shared: workspace_exist

parent ca2ef2f0
Branches
No related tags found
No related merge requests found
......@@ -88,9 +88,11 @@ def swap_workspace(a_master, a_slave, b_master, b_slave):
a = (a_master, a_slave)
b = (b_master, b_slave)
if a_master not in shared.output_of_workspace or a_slave not in shared.output_of_workspace[a_master]:
if not shared.workspace_exist(*a):
if not shared.workspace_exist(*b):
return
return rename_workspace(*b, *a)
if b_master not in shared.output_of_workspace or b_slave not in shared.output_of_workspace[b_master]:
if not shared.workspace_exist(*b):
return rename_workspace(*a, *b)
shared.i3_cmd(f'rename workspace {workspace(*a)} to tmp_swap')
try:
......
......@@ -65,8 +65,8 @@ class Shared:
self.qt_local_queue.value = []
self.i3.value = i3ipc.Connection()
def workspace_exist(self, master, slave):
return master in self.output_of_workspace and slave in self.output_of_workspace[master]
def qt_task(self, *arg, otherwise=lambda: False):
# print(f"QT TASK FROM {threading.current_thread()}: {arg}")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment