Example #1
0
 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()
Example #2
0
 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()
Example #3
0
    def send_window_to_tiler(self, window, i):
        "sends window to tiler i"

        currentMonitor = Monitor.monitor_from_window_in_list(self.monitors, window)
        currentTiler = currentMonitor.tilers[self.group] 
        targetTiler = currentMonitor.tilers[i] 

        #hide the window
        if window.validate():

            window.hide()

            #Remove window if it's in the tiler
            if window in currentTiler.windows:

                currentTiler.windows.remove(window)
                currentTiler.tile_windows()

            #Add window if it's not already in the target tiler
            if window not in targetTiler.windows:

                targetTiler.windows.append(window)
Example #4
0
    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()
Example #5
0
    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 send_window_to_tiler(self, window, i):
        "sends window to tiler i"

        currentMonitor = Monitor.monitor_from_window_in_list(
            self.monitors, window)
        currentTiler = currentMonitor.tilers[self.group]
        targetTiler = currentMonitor.tilers[i]

        #hide the window
        if window.validate():

            window.hide()

            #Remove window if it's in the tiler
            if window in currentTiler.windows:

                currentTiler.windows.remove(window)
                currentTiler.tile_windows()

            #Add window if it's not already in the target tiler
            if window not in targetTiler.windows:

                targetTiler.windows.append(window)
Example #7
0
    def send_window_to_tiler(self, window, i):
        '''
        sends window to tiler i
        '''
        currentMonitor = Monitor.monitor_from_window_in_list(self.monitors, window)
        currentTiler = window.container.container.container
        targetTiler = currentMonitor.tilers[i]
        if(targetTiler != currentTiler):
            currentTiler.remove_window(window)
            if(targetTiler.currentLayout.has_window(window)):
                logging.error('Window "%s" already in destination tiler', window.get_name())
            else:
                targetTiler.currentLayout.add_window(window)
            window.hide()   # hide the window from current tiler
            currentTiler.tile_windows()

            curr_window = currentTiler.get_current_window()
            if(curr_window != None):
                curr_window.focus()
            else:
                # other windows should lose focus
                # self.notifyicon.focus()
                self.taskbar.taskbar.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()
    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()