Как создать псевдоним, чтобы при входе & ldquo; kt & rdquo; он выполняет & ldquo; killall gnome-terminal & rdquo ;?

Вот пример создания элемента быстрого списка «Тип окна»:

    # Create toggle-able menu item for urgency
    urgent_menu_item = Dbusmenu.Menuitem.new ()

    # Set the tab's name as the menu item's name
    urgent_menu_item.property_set (Dbusmenu.MENUITEM_PROP_LABEL, _('Urgent'))

    # Make the menu item toggle-able
    urgent_menu_item.property_set(Dbusmenu.MENUITEM_PROP_TOGGLE_TYPE, Dbusmenu.MENUITEM_TOGGLE_CHECK)
    urgent_menu_item.property_set_int(Dbusmenu.MENUITEM_PROP_TOGGLE_STATE, Dbusmenu.MENUITEM_TOGGLE_STATE_UNCHECKED)
    urgent_menu_item.connect('item_activated', self.urgent_menu_item_activated)

    # Make the menu item visible
    urgent_menu_item.property_set_bool (Dbusmenu.MENUITEM_PROP_VISIBLE, True)

    # Add the section's menu item to the Quicklist menu
    quicklist.child_append(urgent_menu_item)

И вот один из пунктов меню Quicklist Quicklist:

        # Create a new item for this section
        section_menu_item = Dbusmenu.Menuitem.new ()

        # Set the tab's name as the menu item's name
        section_menu_item.property_set (Dbusmenu.MENUITEM_PROP_LABEL, tab_name)

        # Make the menu item toggle-able
        section_menu_item.property_set(Dbusmenu.MENUITEM_PROP_TOGGLE_TYPE, Dbusmenu.MENUITEM_TOGGLE_RADIO)

        # Make the menu item visible
        section_menu_item.property_set_bool (Dbusmenu.MENUITEM_PROP_VISIBLE, True)

        # When the menu item is clicked, make it call menu_item_activated
        # with the tab id, which is used to make that the active tab
        section_menu_item.connect('item_activated', self.section_menu_item_activated, tab_id)

        # Add the section's menu item to the Quicklist menu
        quicklist.child_append(section_menu_item)
1
задан 23 February 2014 в 19:47

1 ответ

Просто введите alias kt="killall gnome-terminal" в командной строке (я предполагаю, что вы пользователь bash).

Чтобы сделать это постоянным, вы можете поместить эту строку в свой .bashrc, например. Выполнить echo 'alias kt="killall gnome-terminal"' >> ~/.bashrc (не забудьте повторно применить изменения, используя . ~/.bashrc)

Используйте простую команду alias, чтобы просмотреть список псевдонимов в действии.

Приветствия [ ! d3]

update: BTW, вы также можете найти это полезным: проблема с созданием постоянного псевдонима

1
ответ дан 25 May 2018 в 23:49

Другие вопросы по тегам:

Похожие вопросы: