Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
i3-woman
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jiří Kalvoda
i3-woman
Commits
8b1fc1b9
Commit
8b1fc1b9
authored
2 years ago
by
Jiří Kalvoda
Browse files
Options
Downloads
Patches
Plain Diff
Shared: workspace_exist
parent
ca2ef2f0
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
woman/lib.py
+4
-2
4 additions, 2 deletions
woman/lib.py
woman/shared.py
+2
-2
2 additions, 2 deletions
woman/shared.py
with
6 additions
and
4 deletions
woman/lib.py
+
4
−
2
View file @
8b1fc1b9
...
...
@@ -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
:
...
...
This diff is collapsed.
Click to expand it.
woman/shared.py
+
2
−
2
View file @
8b1fc1b9
...
...
@@ -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}")
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment