def cmd_focus_previous_monitor(self): monitor = Monitor.current_monitor_from_list(self.monitors) previousMonitor = Utility.previous_item(self.monitors, monitor) if(previousMonitor and previousMonitor.tilers[self.group].has_windows()): window = previousMonitor.tilers[self.group].get_current_window() if(window != None): window.focus()
def cmd_focus_next_monitor(self): monitor = Monitor.current_monitor_from_list(self.monitors) nextMonitor = Utility.next_item(self.monitors, monitor) if(nextMonitor and nextMonitor.tilers[self.group].has_windows()): window = nextMonitor.tilers[self.group].get_current_window() if(window != None): window.focus()
def cmd_move_to_next_monitor(self): window = Window.focused_window(self.windows) # if(window.validate()): monitor = Monitor.monitor_from_window_in_list(self.monitors, window) nextMonitor = Utility.next_item(self.monitors, monitor) if(monitor != nextMonitor): tiler = monitor.tilers[self.group] nextTiler = nextMonitor.tilers[self.group] tiler.remove_window(window) nextTiler.add_window(window) window.focus()
def cmd_move_to_previous_monitor(self): window = Window.focused_window(self.windows) # if(window.validate()): monitor = Monitor.monitor_from_window_in_list(self.monitors, window) previousMonitor = Utility.previous_item(self.monitors, monitor) if(monitor != previousMonitor): tiler = monitor.tilers[self.group] previousTiler = previousMonitor.tilers[self.group] tiler.remove_window(window) previousTiler.add_window(window) window.focus()
def cmd_focus_previous_monitor(self): monitor = Monitor.current_monitor_from_list(self.monitors) previousMonitor = Utility.previous_item(self.monitors, monitor) if previousMonitor and previousMonitor.tilers[self.group].windows: window = previousMonitor.tilers[self.group].windows[0] if not window.focus(): previousMonitor.tilers[self.group].remove_window(window)
def cmd_focus_next_monitor(self): monitor = Monitor.current_monitor_from_list(self.monitors) nextMonitor = Utility.next_item(self.monitors, monitor) if nextMonitor and nextMonitor.tilers[self.group].windows: window = nextMonitor.tilers[self.group].windows[0] if not window.focus(): nextMonitor.tilers[self.group].remove_window(window)
def focus_next(self): """ Sets focus on the next window """ window = Utility.next_item(self.windows, Window.focused_window()) if window: if not window.focus(): self.remove_window(window) else: self.focus_primary()
def focus_previous(self): """ Sets focus on the previous window """ #get focused window window = Utility.previous_item(self.windows, Window.focused_window()) if window: if not window.focus(): self.remove_window(window) else: self.focus_primary()
def next_layout(self): """ Switch to the next layout """ nextLayout = Utility.next_item(self.layouts, self.currentLayout) if nextLayout: self.currentLayout = nextLayout self.masterarea = self.currentLayout.maxSize // 2 self.tile_windows() if not Window.focused_window().center_cursor(): self.remove_window(Window.focused_window())
def cmd_shift_to_previous_monitor(self): window = Window.focused_window() if window.validate(): monitor = Monitor.monitor_from_window_in_list(self.monitors, window) previousMonitor = Utility.previous_item(self.monitors, monitor) if previousMonitor: tiler = monitor.tilers[self.group] previousTiler = previousMonitor.tilers[self.group] if window in tiler.windows: tiler.remove_window(window) if window not in previousTiler.windows: previousTiler.add_window(window) window.focus()
def cmd_shift_to_next_monitor(self): window = Window.focused_window() if window.validate(): monitor = Monitor.monitor_from_window_in_list(self.monitors, window) nextMonitor = Utility.next_item(self.monitors, monitor) if nextMonitor: tiler = monitor.tilers[self.group] nextTiler = nextMonitor.tilers[self.group] if window in tiler.windows: tiler.remove_window(window) if window not in nextTiler.windows: nextTiler.add_window(window) window.focus()
def cmd_shift_to_next_monitor(self): window = Window.focused_window() if window.validate(): monitor = Monitor.monitor_from_window_in_list( self.monitors, window) nextMonitor = Utility.next_item(self.monitors, monitor) if nextMonitor: tiler = monitor.tilers[self.group] nextTiler = nextMonitor.tilers[self.group] if window in tiler.windows: tiler.remove_window(window) if window not in nextTiler.windows: nextTiler.add_window(window) window.focus()
def cmd_shift_to_previous_monitor(self): window = Window.focused_window() if window.validate(): monitor = Monitor.monitor_from_window_in_list( self.monitors, window) previousMonitor = Utility.previous_item(self.monitors, monitor) if previousMonitor: tiler = monitor.tilers[self.group] previousTiler = previousMonitor.tilers[self.group] if window in tiler.windows: tiler.remove_window(window) if window not in previousTiler.windows: previousTiler.add_window(window) window.focus()