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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jiří Kalvoda
i3-woman
Commits
8626b8ca
Commit
8626b8ca
authored
2 years ago
by
Jiří Kalvoda
Browse files
Options
Downloads
Patches
Plain Diff
Qt: Container switch
Part of
#4
parent
98e53d39
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/help.py
+2
-0
2 additions, 0 deletions
woman/help.py
woman/qt.py
+55
-42
55 additions, 42 deletions
woman/qt.py
with
57 additions
and
42 deletions
woman/help.py
+
2
−
0
View file @
8626b8ca
...
@@ -54,6 +54,7 @@ On middle-click on a container, floating will be toggled.
...
@@ -54,6 +54,7 @@ On middle-click on a container, floating will be toggled.
You can use drag-and-drop for windows/containers or whole workspaces.
You can use drag-and-drop for windows/containers or whole workspaces.
Using left button only members of container will be taken.
Using left button only members of container will be taken.
Using middle button containers will be swapped.
You can search for a window by its name by typing the query to the relevant
You can search for a window by its name by typing the query to the relevant
input field (labeled find).
input field (labeled find).
...
@@ -98,6 +99,7 @@ m<id><id><key> - Move window/container/workspace near other container
...
@@ -98,6 +99,7 @@ m<id><id><key> - Move window/container/workspace near other container
m - expand in front of
m - expand in front of
j/b/y/d - expand to new horizontal/vertical/tabbed/stacked layout
j/b/y/d - expand to new horizontal/vertical/tabbed/stacked layout
J/B/Y/D - expand to new layout before the target container
J/B/Y/D - expand to new layout before the target container
c - change (swap) workspaces
(the second part is the same moved one key right)
(the second part is the same moved one key right)
c<id>... - select container/window/workspace and ...
c<id>... - select container/window/workspace and ...
m<workspace> - move to workspace
m<workspace> - move to workspace
...
...
This diff is collapsed.
Click to expand it.
woman/qt.py
+
55
−
42
View file @
8626b8ca
...
@@ -171,9 +171,13 @@ def qt_main():
...
@@ -171,9 +171,13 @@ def qt_main():
shared
.
i3_cmd
(
f
'
[con_id=
{
target
.
container_id
}
] mark tmp
'
)
shared
.
i3_cmd
(
f
'
[con_id=
{
target
.
container_id
}
] mark tmp
'
)
shared
.
i3_cmd
(
f
'
[con_id=
{
self
.
container_id
}
] move container to mark tmp
'
)
shared
.
i3_cmd
(
f
'
[con_id=
{
self
.
container_id
}
] move container to mark tmp
'
)
def
move
(
self
,
target
,
before
=
False
,
expand
=
False
,
new_container
=
None
):
def
move
(
self
,
target
,
swap
=
False
,
before
=
False
,
expand
=
False
,
new_container
=
None
):
self
.
workspace_widget
.
screenshot_changed
()
self
.
workspace_widget
.
screenshot_changed
()
target
.
workspace_widget
.
screenshot_changed
()
target
.
workspace_widget
.
screenshot_changed
()
if
swap
:
shared
.
i3_cmd
(
f
'
[con_id=
{
self
.
container_id
}
] mark tmp
'
)
shared
.
i3_cmd
(
f
'
[con_id=
{
target
.
container_id
}
] swap container with mark tmp
'
)
else
:
if
new_container
is
not
None
:
if
new_container
is
not
None
:
target
.
put_in_new_container
(
None
if
new_container
is
True
else
new_container
)
target
.
put_in_new_container
(
None
if
new_container
is
True
else
new_container
)
if
expand
and
type
(
self
)
!=
I3InnerNodeWidget
:
if
expand
and
type
(
self
)
!=
I3InnerNodeWidget
:
...
@@ -276,6 +280,9 @@ def qt_main():
...
@@ -276,6 +280,9 @@ def qt_main():
m_win
.
cmd_msg_clean
()
m_win
.
cmd_msg_clean
()
button
=
s
.
press_event_buttons
button
=
s
.
press_event_buttons
try
:
try
:
if
button
==
Qt
.
MiddleButton
:
s
.
move
(
self
,
swap
=
True
)
else
:
s
.
move
(
self
,
s
.
move
(
self
,
expand
=
s
.
press_event_buttons
==
Qt
.
RightButton
,
expand
=
s
.
press_event_buttons
==
Qt
.
RightButton
,
**
[{
"
before
"
:
True
},
{
"
new_container
"
:
True
},
{}][
self
.
drop_place
]
**
[{
"
before
"
:
True
},
{
"
new_container
"
:
True
},
{}][
self
.
drop_place
]
...
@@ -311,6 +318,10 @@ def qt_main():
...
@@ -311,6 +318,10 @@ def qt_main():
self
.
drop_place
=
1
self
.
drop_place
=
1
s
=
event
.
source
()
s
=
event
.
source
()
if
s
is
not
None
and
isinstance
(
s
,
WorkspaceWidget
)
or
isinstance
(
s
,
I3NodeWidget
):
if
s
is
not
None
and
isinstance
(
s
,
WorkspaceWidget
)
or
isinstance
(
s
,
I3NodeWidget
):
button
=
s
.
press_event_buttons
if
button
==
Qt
.
MiddleButton
:
style
=
"
background-color: green;
"
else
:
style
=
[
"
border-top: 3px solid green;
"
,
"
background-color: green;
"
,
"
border:no; border-bottom: 3px solid green;
"
][
self
.
drop_place
]
style
=
[
"
border-top: 3px solid green;
"
,
"
background-color: green;
"
,
"
border:no; border-bottom: 3px solid green;
"
][
self
.
drop_place
]
self
.
setStyleSheet
(
f
"
#
{
id
(
self
)
}
{{
{
style
}
}}
"
);
self
.
setStyleSheet
(
f
"
#
{
id
(
self
)
}
{{
{
style
}
}}
"
);
...
@@ -632,11 +643,11 @@ def qt_main():
...
@@ -632,11 +643,11 @@ def qt_main():
def
move_to_otput
(
self
,
output
=
"
next
"
):
def
move_to_otput
(
self
,
output
=
"
next
"
):
shared
.
i3_cmd
(
f
"
move workspace to output
{
output
}
"
)
shared
.
i3_cmd
(
f
"
move workspace to output
{
output
}
"
)
def
move
(
self
,
target
,
before
=
False
,
expand
=
False
,
new_container
=
None
):
def
move
(
self
,
target
,
swap
=
False
,
before
=
False
,
expand
=
False
,
new_container
=
None
):
for
f
in
self
.
_tree
.
floating_nodes
:
for
f
in
self
.
_tree
.
floating_nodes
:
f
.
move_to_workspace
(
target
.
workspace_widget
.
master
,
target
.
workspace_widget
.
slave
)
f
.
move_to_workspace
(
target
.
workspace_widget
.
master
,
target
.
workspace_widget
.
slave
)
if
(
w
:
=
self
.
root_i3_tree_widget
())
is
not
None
:
if
(
w
:
=
self
.
root_i3_tree_widget
())
is
not
None
:
w
.
move
(
target
,
before
=
before
,
expand
=
expand
,
new_container
=
new_container
)
w
.
move
(
target
,
swap
=
swap
,
before
=
before
,
expand
=
expand
,
new_container
=
new_container
)
def
move_to_workspace
(
self
,
master
,
slave
,
expand
=
False
):
def
move_to_workspace
(
self
,
master
,
slave
,
expand
=
False
):
for
f
in
self
.
_tree
.
floating_nodes
:
for
f
in
self
.
_tree
.
floating_nodes
:
...
@@ -1094,6 +1105,8 @@ def qt_main():
...
@@ -1094,6 +1105,8 @@ def qt_main():
nd_from
.
move
(
nd_to
,
new_container
=
"
tabbed
"
,
before
=
mod
==
SHIFT
,
expand
=
True
)
nd_from
.
move
(
nd_to
,
new_container
=
"
tabbed
"
,
before
=
mod
==
SHIFT
,
expand
=
True
)
elif
mod
in
[
0
,
SHIFT
]
and
key
==
ord
(
'
D
'
):
elif
mod
in
[
0
,
SHIFT
]
and
key
==
ord
(
'
D
'
):
nd_from
.
move
(
nd_to
,
new_container
=
"
stacked
"
,
before
=
mod
==
SHIFT
,
expand
=
True
)
nd_from
.
move
(
nd_to
,
new_container
=
"
stacked
"
,
before
=
mod
==
SHIFT
,
expand
=
True
)
elif
mod
in
[
0
]
and
key
==
ord
(
'
C
'
):
nd_from
.
move
(
nd_to
,
swap
=
True
)
else
:
else
:
raise
NoSutchKey
(
key
,
mod
)
raise
NoSutchKey
(
key
,
mod
)
self
.
load_i3_tree
()
self
.
load_i3_tree
()
...
...
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