Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

omarchy-make-plugin

БесплатноБез исполняемых скриптовНе проверен

Make a new plugin for the Omarchy shell: a bar widget, a popup card, or a keyboard-driven panel, written in QML in…

omacomот omacom★ 47 921 звезда на GitHub

Об этом скилле

Making an Omarchy Shell Plugin

The bar, notification daemon, settings panel, and assorted overlays all run inside a single long-running Quickshell process (omarchy-shell). A plugin is a folder of QML under ~/.config/omarchy/plugins/<plugin-id>/ that runs inside it. Saving any file under the plugin folder reloads it, and omarchy-shell shell reloadPlugins forces a reload if a change somehow fails to apply. The built-in plugins in $OMARCHY_PATH/shell/plugins/ are the reference for anything bigger than the examples here.

A Bar Widget

A bar plugin is a folder ~/.config/omarchy/plugins/<username>.<name>/ (its id, e.g. alice.counter) with a manifest, the widget, and its strings:

{
  "schemaVersion": 1,
  "id": "alice.counter",
  "name": "Counter",
  "version": "1.0.0",
  "author": "alice",
  "description": "Counts clicks in the bar",
  "kinds": ["bar-widget"],
  "entryPoints": { "barWidget": "BarWidget.qml" },
  "barWidget": { "displayName": "Counter", "description": "Counts clicks in the bar", "category": "Tools", "allowMultiple": false, "defaultSection": "right" }
}

BarWidget.qml extends BarWidget and draws itself with WidgetButton, which gives it the bar's font, colors, hover, tooltip, and press feedback. Its text is the label (an icon-font glyph or words), active: true draws it in the urgent color, and onPressed gets the mouse button:

import QtQuick
import qs.Commons
import qs.Ui

BarWidget {
  id: root
  moduleName: "alice.counter"
  implicitWidth: button.implicitWidth
  implicitHeight: button.implicitHeight

  property int count: 0

  Translations { id: strings; directory: Qt.resolvedUrl("i18n") }

  WidgetButton {
    id: button
    anchors.fill: parent
    bar: root.bar
    text: String(root.count)
    tooltipText: strings.t("tooltip")
    onPressed: function(mouseButton) {
      if (mouseButton === Qt.RightButton) { root.count = 0 } else { root.count++ }
    }
  }
}
  • Keep state in QML properties and drive time with a Timer that runs only while something is counting; an idle widget starts no timers or processes. Don't name a property after one every item already has (state, visible, enabled, width, opacity): property int state collides with the item's own state, and assigning to it fails.

  • Run commands with root.bar.run("omarchy-notification-send 'Counter' 'Reached 100'").

  • Icons are Nerd Font glyphs written straight into the label text, as the built-in widgets do (text: "󰐊"). Find one by name in Nerd Fonts' table rather than by drawing the font, preferring the md- (Material Design) set the bar uses, then look at the widget to check it:

    curl -s https://raw.githubusercontent.com/ryanoasis/nerd-fonts/master/glyphnames.json \
      | jq -r 'to_entries[] | select(.key | test("^md-.*timer")) | "\(.key) \(.value.char)"'
    

    Copy the character it prints into the QML as it is. The md- glyphs lie past U+FFFF, so an escape needs braces, "\u{F051F}": "f" is the glyph U+F051 followed by the letter f.

  • A card that opens on click, for details that don't fit the bar, is a PopupCard in the widget, the way the media widget shows the playing track. It grows from the widget and fades, closes when the user clicks anywhere else (by calling the widget's close()), and mirrors for right-to-left languages. In the counter above, left click opens it and right click resets:

    property bool popupOpen: false
    function close() { popupOpen = false }
    
    WidgetButton {
      // ...as above, with:
      onPressed: function(mouseButton) {
        if (mouseButton === Qt.RightButton) { root.count = 0 } else { root.popupOpen = !root.popupOpen }
      }
    }
    
    PopupCard {
      id: popup
      anchorItem: root
      bar: root.bar
      owner: root
      open: root.popupOpen
      contentWidth: popup.fittedContentWidth(Style.space(280))
      contentHeight: popup.fittedContentHeight(column.implicitHeight)
    
      Column {
        id: column
        width: parent.width
        spacing: Style.space(6)
    
        Text {
          textFormat: Text.PlainText
          text: strings.t("title")
          color: Commons.Color.popups.text
          font.family: Style.font.family
          font.pixelSize: Style.font.subtitle
          font.bold: true
        }
        Text {
          textFormat: Text.PlainText
          text: Commons.I18n.formatNumber(root.count)
          color: Commons.Color.popups.text
          font.family: Style.font.family
          font.pixelSize: Style.font.body
        }
      }
    }
    

    This needs import qs.Commons as Commons beside import qs.Commons. A keyboard-driven panel that a hotkey summons is more: $OMARCHY_PATH/shell/plugins/panels/clock/ is the reference for that, for settings from shell.json, and for IPC.

Then check it, look at it, and put it on the bar. omarchy agent look plugin <dir> renders the widget on a strip of bar with the current theme, without touching the running bar, and lists the QML errors it logged; open the image it prints and fix

Полный SKILL.md на GitHub

Установить omarchy-make-plugin в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

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

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл omarchy-make-plugin?

Make a new plugin for the Omarchy shell: a bar widget, a popup card, or a keyboard-driven panel, written in QML in ~/.config/omarchy/plugins/<username>.<name>/, following the theme, the language and the shell's motion, checked with omarchy agent look plugin, and put on the bar. Also for writing QML in a cloned built-in plugin. Use when asked to make, build, or write a plugin, widget, bar indicator, or panel. Moving, adding, or removing existing widgets on the bar, and idle or lock settings, belong to the omarchy skill. Triggers: make a plugin, new widget, bar widget, show X in the bar, Quickshell, QML plugin, popup, panel.

Как установить скилл omarchy-make-plugin?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл omarchy-make-plugin запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить omarchy-make-plugin с