Beispiel #1
0
    async def on_select(self, meta):
        """
        This should preferably play the selected track in context
        if a context can be found, if not, it should play the track 
        without context. If a device cannot be found, it should display
        a choice of devices.
        """
        if spotify.device.current_device:
            # This could be in the context of a playlist, album, etc
            if self.parent_menu.context:
                await spotify.playback.play_content(
                    device_id=spotify.device.current_device['id'],
                    context_uri=self.parent_menu.context,
                    offset={"position": self.offset})
            # Otherwise we just assume that only the selected track should be played
            elif self.track:
                await spotify.playback.play_content(
                    device_id=spotify.device.current_device['id'],
                    uris=[self.track['uri']],
                )
            return await super().on_select(meta)
        else:
            # Make sure there is no active device
            device = spotify.device.get_active_device()

            if device is not None:
                spotify.device.current_device = device
                return await self.on_select(meta)
            else:
                return rofi_menu.Operation(OP_REFRESH_MENU)
Beispiel #2
0
    async def on_user_input(self, meta):

        await hotkeys.handle_user_input()
        return rofi_menu.Operation(rofi_menu.constants.OP_REFRESH_MENU)
Beispiel #3
0
 async def on_user_input(self, meta):
     i3_move_too_workspace(meta.user_input)
     return rofi_menu.Operation(rofi_menu.OP_EXIT)
Beispiel #4
0
 async def on_user_input(self, meta):
     i3.command(f"rename workspace to {meta.user_input}")
     return rofi_menu.Operation(rofi_menu.OP_EXIT)
Beispiel #5
0
 async def on_user_input(self, meta):
     """
     Check ROFI_RETV to see if one of the mapped hotkeys has been pressed
     """
     await hotkeys.handle_user_input()
     return rofi_menu.Operation(rofi_menu.OP_REFRESH_MENU)