{"id":32118929,"url":"https://github.com/theogainey/deno-xbar","last_synced_at":"2026-02-18T20:32:07.092Z","repository":{"id":41999053,"uuid":"477709626","full_name":"theogainey/deno-xbar","owner":"theogainey","description":"Write xbar app plugins using TypeScript/JavaScript and Deno","archived":false,"fork":false,"pushed_at":"2024-03-26T13:22:51.000Z","size":352,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-22T20:43:33.184Z","etag":null,"topics":["deno","typescript","xbar","xbar-plugins"],"latest_commit_sha":null,"homepage":"https://deno.land/x/xbar","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/theogainey.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-04T13:18:26.000Z","updated_at":"2024-02-26T11:55:18.000Z","dependencies_parsed_at":"2024-11-17T14:11:45.218Z","dependency_job_id":"355ebb30-f84e-49d0-b0eb-949167734639","html_url":"https://github.com/theogainey/deno-xbar","commit_stats":{"total_commits":34,"total_committers":2,"mean_commits":17.0,"dds":0.02941176470588236,"last_synced_commit":"7b977940dfb225c7588f738f2a2ef91679e7214f"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/theogainey/deno-xbar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theogainey%2Fdeno-xbar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theogainey%2Fdeno-xbar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theogainey%2Fdeno-xbar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theogainey%2Fdeno-xbar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theogainey","download_url":"https://codeload.github.com/theogainey/deno-xbar/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theogainey%2Fdeno-xbar/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29594259,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T18:54:29.675Z","status":"ssl_error","status_checked_at":"2026-02-18T18:50:50.517Z","response_time":162,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deno","typescript","xbar","xbar-plugins"],"created_at":"2025-10-20T17:47:55.463Z","updated_at":"2026-02-18T20:32:07.083Z","avatar_url":"https://github.com/theogainey.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deno xbar\n\nWrite xbar app plugins using JavaScript and Deno\n\n## Installation\n\n### Deno\n\n[Deno](https://github.com/denoland/deno) is a simple, modern and secure runtime\nfor JavaScript and TypeScript that uses V8 and is built in Rust.\n\nShell (Mac, Linux):\n\n```sh\ncurl -fsSL https://deno.land/x/install/install.sh | sh\n```\n\n[Homebrew](https://formulae.brew.sh/formula/deno) (Mac):\n\n```sh\nbrew install deno\n```\n\nSee\n[deno_install](https://github.com/denoland/deno_install/blob/master/README.md)\nand [releases](https://github.com/denoland/deno/releases) for other options.\n\n### xbar\n\n[xbar](https://github.com/matryer/xbar) lets you put the output from any\nscript/program in your macOS menu bar.\n\n[Download the latest release of xbar](https://github.com/matryer/xbar/releases).\n\n## Usage\n\nIn the xbar plugins directory create a file named with the following format:\n\n`{name}.{refreshTime}.js`\n\nOn the first line of that file include a shebang in the following format:\n\n`#!/usr/bin/env -S -P/${HOME}/.deno/bin:/opt/homebrew/bin deno run \u003cpermissions\u003e`\n\nThis module can be imported to the plugin with the following code:\n\n`import { xbar, separator, isDarkMode } from \"https://deno.land/x/xbar@LATEST_VERSION/mod.ts\";`\n\nDeno is secure by default. Therefore, unless you specifically enable it, a\nprogram run with Deno has no file, network, or environment access. Replace\n`\u003cpermissions\u003e` with the permissions required for the plugin. See\n[Deno Manual](https://deno.land/manual/getting_started/permissions) for more.\n\nEnsure that the file is executable by using the command `chmod +x filename.js`.\n[Read more.](https://github.com/matryer/xbar#installing-plugins)\n\n### Example\n\n```\n#!/usr/bin/env -S -P/${HOME}/.deno/bin:/opt/homebrew/bin deno run --allow-env\n\nimport { xbar, separator, isDarkMode } from \"https://deno.land/x/xbar@LATEST_VERSION/mod.ts\";\n\nconst darkMode = await isDarkMode(); \n\nxbar([\n\t{\n\t\ttext: 'plugin text on the menu bar',\n\t\tcolor: darkMode ? 'white' : 'red',\n\t},\n\tseparator,\n\t{\n\t\ttext: 'plugin text below the menu bar',\n\t\tcolor: '#85b56d',\n\t\tsubmenu: [\n\t\t\t{\n\t\t\t\ttext: 'plugin text in a submenu menu that is long and is word wrapped',\n\t\t\t\twordWrap: 40\n\t\t\t},\n\t\t]\n\t},\n]);\n```\n\nSee [examples](/examples) for more.\n\n## API\n\n### xbar\n\nPrints output to xbar and returns printed output as an array of strings\n\nType: `(Array\u003cMenuItem\u003e) =\u003e string[]`\n\nTakes an array of MenuItem objects, that represent xbar menu items, as input.\n\n#### MenuItem\n\nType: `object`\n\nMenuItem can contain any of the following fields:\n\n```\n{\n  text: string;\n  submenu: Array\u003cMenuItem\u003e;\n  ...options\n}\n```\n\n#### submenu\n\nType: `Array\u003cMenuItem\u003e`\n\nIt will add a submenu to the current menu item. A submenu is composed of an\narray of menu items. Submenus can contain nested submenus.\n\n#### options\n\nType: `option: any`\n\nYou can use any of the xbar\n[supported options](https://github.com/matryer/xbar-plugins/blob/main/CONTRIBUTING.md#plugin-api).\nAdditionally this module enables an additional `wordWrap` option.\n\n`wordWrap`\n\nEnabling the wordWrap option will result in the improved readability of long\ntext by outputting the text as multiple lines with out breaking any apart words.\n\nExample:\n\n```\n{\n  text: 'Douglas Crockford',\n  submenu: [\n    {\n      text: 'In JavaScript, there is a beautiful, elegant, highly expressive language that is buried under a steaming pile of good intentions and blunders.',\n      wordWrap: 40,\n    }\n  ]\n}\n```\n\n![' '](https://github.com/theogainey/deno-xbar/blob/main/wordWrapExample.png)\n\n### separator\n\nThe menu items below `separator` will appear in the plugin's drop down, but will\nnot appear in the menu bar itself.\n\n### isDarkMode\n\nAsync function to query if dark mode is enabled.\n\nType: `async () =\u003e Promise\u003cboolean\u003e`\n\nWill always return `false` if environment permission has not previously been\ngranted `--allow-env`\n\n```\n#!/usr/bin/env -S -P/${HOME}/.deno/bin:/opt/homebrew/bin deno run --allow-env\nimport { isDarkMode } from \"https://deno.land/x/xbar@LATEST_VERSION/mod.ts\";\n\nconst darkMode = await isDarkMode();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheogainey%2Fdeno-xbar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheogainey%2Fdeno-xbar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheogainey%2Fdeno-xbar/lists"}