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

QT: Move workspace to output

Closes #2
parent 2d07a2b3
No related branches found
No related tags found
No related merge requests found
......@@ -47,6 +47,7 @@ Window information (I3 container tree) is loaded on each jump to GUI (by `i3-wom
or on key `T` press.
When you click on a workspace, you will be moved to it.
On right-click on a workspaces, workspaces will be moved to next output.
When you click on a container or a window, it will be focused.
On left-click on a container, layout will be changed.
On middle-click on a container, floating will be toggled.
......@@ -81,6 +82,7 @@ Shift + <RIGHT> / <LEFT>
or L / H - Focus next / previous slave will be active
<ENTER> - Go to the active workspace
<ESC> - Go to the previous used workspace
o - Move workspace to next output
w / e - Increase / decrease screenshot size
`, 1-9, 0, -, = - Active the corresponding slave
F1-F12 - Active the corresponding master
......
......@@ -629,6 +629,9 @@ def qt_main():
def focus(self):
shared.i3_cmd(f'workspace {workspace(self.master, self.slave)}')
def move_to_otput(self, output="next"):
shared.i3_cmd(f"move workspace to output {output}")
def move(self, target, before=False, expand=False, new_container=None):
for f in self._tree.floating_nodes:
f.move_to_workspace(target.workspace_widget.master, target.workspace_widget.slave)
......@@ -648,6 +651,13 @@ def qt_main():
self._tree.root_node.quit_windows(*arg, **kvarg)
def clicked(self, pos, buttons):
if buttons == Qt.RightButton:
try:
self.move_to_otput()
except I3CmdException as e:
m_win.cmd_msg(e.error, QColor(255, 100, 100))
traceback.print_exc()
else:
self.focus()
def root_i3_tree_widget(self):
......@@ -1150,6 +1160,8 @@ def qt_main():
elif mod == 0 and key == ord('T'):
m_win.end_get_continuing_key()
self.load_i3_tree()
elif mod == 0 and key == ord('O'):
self.focused_widget.move_to_otput()
elif mod == 0 and key == ord('W'):
try:
self.set_screenshot_size([x for x in SCREENSHOTS_SIZES if x > self.screenshot_size][0])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment