Esempio n. 1
0
 def _params(self):
     params = []
     params.append(
         Param(u'target',
               WindowsMenu(u'target', prompt=_(u'Select window')),
               default_fnc=lambda e: e.value.focused))
     return params
Esempio n. 2
0
 def _params(self):
     params = []
     params.append(Param(
         u'value',
         Menu(u'value', prompt=_(u'Value')),
     ))
     return params
Esempio n. 3
0
 def entries(self):
     res = []
     if self.parent:
         res.append(
             MenuEntry(**{
                 'label': _(u'<go back>'),
                 'value': self.parent
             }))
     if self.root:
         res.append(MenuEntry(**{'label': _(u'<exit>'), 'value': None}))
     # idx = self.start_idx
     for e in self._entries:
         # label = u'{idx}: {label}'.format(idx=idx, label=e.label)
         # res.append(MenuEntry(**{u'label': label, u'value': e.value}))
         # idx += 1
         res.append(e)
     return res
Esempio n. 4
0
 def _params(self):
     params = []
     params.append(
         Param(
             u'output',
             OutputsMenu(u'output', prompt=_(u'Select output')),
         ))
     return params
Esempio n. 5
0
 def _params(self):
     params = []
     params.append(
         Param(
             u'ws',
             WorkspacesMenu(u'ws', prompt=_(u'Select workspace')),
         ))
     return params
Esempio n. 6
0
 def _params(self):
     params = []
     params.append(
         Param(u'action',
               ActionsMenu(u'action',
                           prompt=_(u'Select action'),
                           actions=self.actions),
               default='toggle' in self._actions and u'toggle' or None))
     return params
Esempio n. 7
0
def menu_tree():

    window_entries_menu = Menu(
        u'window_actions', prompt=_(u'Window Actions'))
    window_entries_menu.add_command(
        label=_(u'Move window to workspace'),
        command=cmds.MoveWindowToWorkspaceCmd)
    window_entries_menu.add_command(
        label=_(u'Border style'), command=cmds.BorderCmd)
    window_entries_menu.add_command(
        label=_(u'Split'), command=cmds.SplitCmd)
    window_entries_menu.add_command(
        label=_(u'Floating (toggle)'), command=cmds.FloatingCmd)
    window_entries_menu.add_command(
        label=_(u'Fullscreen (toggle)'), command=cmds.FullscreenCmd)
    window_entries_menu.add_command(
        label=_(u'Sticky'), command=cmds.StickyCmd)
    window_entries_menu.add_command(
        label=_(u'Move to Scratchpad'),
        command=cmds.MoveWindowToScratchpadCmd)
    window_entries_menu.add_command(
        label=_(u'Kill'), command=cmds.KillCmd)

    workspace_entries_menu = Menu(
        u'workspace_actions', prompt=_(u'Workspace Actions'))
    workspace_entries_menu.add_command(
        label=_(u'Rename'),
        command=cmds.RenameWorkspaceCmd)
    workspace_entries_menu.add_command(
        label=_(u'Layout'),
        command=cmds.LayoutCmd)
    workspace_entries_menu.add_command(
        label=_(u'Move workspace to output'),
        command=cmds.MoveWorkspaceToOutputCmd)

    global_entries_menu = Menu(
        u'global_actions', prompt=_(u'Global actions'))
    global_entries_menu.add_command(
        label=_(u'Debug log'), command=cmds.DebuglogCmd)
    global_entries_menu.add_command(
        label=_(u'Shared memory log'), command=cmds.ShmlogCmd)
    global_entries_menu.add_command(
        label=_(u'Restart i3'), command=cmds.RestartCmd)
    global_entries_menu.add_command(
        label=_(u'Reload i3'), command=cmds.ReloadCmd)
    global_entries_menu.add_command(
        label=_(u'Exit i3'), command=cmds.ExitCmd)

    goto_entries_menu = Menu(u'goto_actions', prompt=_(u'Goto actions'))
    goto_entries_menu.add_command(
        label=_(u'Go to workspace'), command=cmds.GotoWorkspaceCmd)
    bar_entries_menu = Menu('bar_actions', prompt=_(u'Bar actions'))
    scratchpad_entries_menu = Menu(
        u'scratchpad_actions', prompt=_(u'Scratchpad actions'))

    root_menu = Menu('root', prompt=_(u'Root'), root=True)
    root_menu.add_cascade(
        label=goto_entries_menu.prompt, menu=goto_entries_menu)
    root_menu.add_cascade(
        label=window_entries_menu.prompt, menu=window_entries_menu)
    root_menu.add_cascade(
        label=workspace_entries_menu.prompt, menu=workspace_entries_menu)
    root_menu.add_cascade(
        label=bar_entries_menu.prompt, menu=bar_entries_menu)
    root_menu.add_cascade(
        label=scratchpad_entries_menu.prompt, menu=scratchpad_entries_menu)
    root_menu.add_cascade(
        label=global_entries_menu.prompt, menu=global_entries_menu)
    return root_menu
Esempio n. 8
0
# -*- coding: utf-8 -*-
from i3menu import _

SUBMENU_SIGN = u' ⇲'
MENUENTRY_SIGN = u' @'
PROMPT_PREFIX = u'(i3menu)'
DEFAULT_TITLE = _(u'Select:')
LABEL_GENERIC = u'{idx}: {entry}'
# LABEL_WINDOW = u'{idx}: {window_class}\t{name}'
LABEL_WINDOW = u'{window.window_class}\t{window.name}'
LABEL_OUTPUT = u'{name}{current}'
LABEL_WORKSPACE = u'{name}{current}'

DEFAULTS = {
    'prompt_prefix': PROMPT_PREFIX,
    'prompt': DEFAULT_TITLE,
    'label_generic': LABEL_GENERIC,
    'label_window': LABEL_WINDOW,
    'label_output': LABEL_OUTPUT,
    'label_workspace': LABEL_WORKSPACE
}

XRANDR_DIRECTION_LEFT = {'name': u'left'}
XRANDR_DIRECTION_RIGHT = {'name': u'right'}
XRANDR_DIRECTION_UP = {'name': u'up'}
XRANDR_DIRECTION_DOWN = {'name': u'down'}

XRANDR_DIRECTIONS = [
    XRANDR_DIRECTION_LEFT, XRANDR_DIRECTION_RIGHT, XRANDR_DIRECTION_UP,
    XRANDR_DIRECTION_DOWN
]