{"id":13394553,"url":"https://github.com/HackPlan/quark-shell-mac","last_synced_at":"2025-03-13T20:31:32.965Z","repository":{"id":15577321,"uuid":"18312828","full_name":"HackPlan/quark-shell-mac","owner":"HackPlan","description":"Quark Shell for Mac helps web developers to create native-like Mac menubar app using HTML and JavaScript without writing any native code.","archived":false,"fork":false,"pushed_at":"2020-04-15T07:38:54.000Z","size":3299,"stargazers_count":910,"open_issues_count":13,"forks_count":42,"subscribers_count":31,"default_branch":"master","last_synced_at":"2024-10-25T05:51:30.612Z","etag":null,"topics":["mac","menubar","webkit"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","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/HackPlan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-04-01T00:33:45.000Z","updated_at":"2024-09-15T08:27:55.000Z","dependencies_parsed_at":"2022-09-12T07:21:30.902Z","dependency_job_id":null,"html_url":"https://github.com/HackPlan/quark-shell-mac","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HackPlan%2Fquark-shell-mac","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HackPlan%2Fquark-shell-mac/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HackPlan%2Fquark-shell-mac/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HackPlan%2Fquark-shell-mac/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HackPlan","download_url":"https://codeload.github.com/HackPlan/quark-shell-mac/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243330325,"owners_count":20274039,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["mac","menubar","webkit"],"created_at":"2024-07-30T17:01:23.566Z","updated_at":"2025-03-13T20:31:32.941Z","avatar_url":"https://github.com/HackPlan.png","language":"Objective-C","readme":"# Quark Shell for Mac\n\n**Quark Shell** helps you create cross-platform (currently Mac-only, Windows version coming soon) menubar/tray app using HTML and JavaScript without writing any native code. Quark Shell exposes a JavaScript object called ``quark`` to provide system functions. **Quark Shell for Mac** is based on WebKit.\n\n\u003cimg alt=\"Screenshot\" width=\"728\" src=\"Assets/screenshot.png\"\u003e\n\n## Integrating Web App\n\n``app/index.html`` is the portal of your menubar app. ``app/preferences/[identifier].html`` are the preference pages (for example, ``app/preferences/general.html``).\n\nTo build your app:\n\n0. Delete the current ``app`` folder\n0. Put your files into ``app`` folder\n0. Open ``quark-shell.xcworkspace`` in Xcode\n0. Change bundle name and bundle identifier (see [Issue #50](https://github.com/HackPlan/quark-shell-mac/issues/50) for details)\n0. Build and have fun!\n\nRemember that Quark Shell is still a WIP. When the project is stable enough, the build process will be simplified.\n\n## API\n\nAPIs may change rapidly before 1.0.\n\n```js\nquark.platform // returns \"mac\" or \"windows\"\n\n// App info (configurable in Xcode)\nquark.appVersion\nquark.appBundleVersion\n\n// Enable/disable Web Inspector\nquark.debug = true\n\n// Manipulate the popup window\nquark.openPopup()\nquark.closePopup()\nquark.togglePopup()\nquark.resizePopup({width: 326, height: 623})\n\n// Quit application\nquark.quit()\n\n// Open URL in default browser\nquark.openURL(\"https://pomotodo.com/\")\n\n// Set menubar icon\nquark.setMenubarIcon(\"data:image/png;base64,iVBORw...SuQmCC\")\nquark.setMenubarHighlightedIcon(\"data:image/png;base64,iVBORw...SuQmCC\")\nquark.resetMenubarIcon()\n\n// Set menubar icon click action\nquark.setClickAction(function () { console.log(\"Don’t click me!\"); })\nquark.setSecondaryClickAction(function () { console.log(\"What did I say?\"); })\n\n// Set menubar label\nquark.setLabel(\"03:14 AM\")\n\n// Auto launch at login\n// You also need to change bundle identifier \"com.hackplan.quark-shell-helper\" to a proper one in quark-shell-helper.xcodeproj and QSHWebViewDelegate.m\nquark.setLaunchAtLogin(true)\n\n// Send system notification\nquark.notify({\n  title: \"Pomotodo\",\n  content: \"Break is over!\",\n  time: \"2038-01-19T03:14:07Z\", // (optional) delivery date for scheduled notification, in ISO 8601\n  popupOnClick: true // popup when clicking notification\n})\n\n// Remove all scheduled notifications\nquark.removeAllScheduledNotifications()\n\n// Remove all delivered notifications from notification center\nquark.removeAllDeliveredNotifications()\n\n// Open new window\n// \"url\" is relative to \"app\" folder\n// Notice: You can only open one window at the same time,\n// or the later window will replace the former window.\nquark.newWindow({\n  url: \"about.html\",\n  width: 600,\n  height: 400,\n\n  // optional options\n  x: 100, y: 100, // x and y should both be provided, \"center\" is also a valid value\n  border: true, // whether the window has a border, default is true\n  shadow: true, // whether the window has a shadow, default is true\n  alwaysOnTop: false, // whether the window should always on top, default is false\n  alpha: 1.0 // the alpha value of the window, between 0 and 1, default is 1.0\n})\n\n// Close new window\nquark.closeWindow()\n\n// Pin/unpin pop-up window (won’t close when click outside the window)\nquark.pin()\nquark.unpin()\n\n// Exchange messages between webviews\nquark.emit(\"MessageName\", \"payload\")\nquark.on(\"MessageName\", function(message) {\n\tconsole.log(message)\n})\n\n// Show a context menu\nquark.showMenu({\n  items: [\n    {label: \"Test\", click: function() { console.log(\"I am completely operational\") } },\n    {type: \"separator\"},\n    {label: \"Exit\", click: function() { console.log(\"LIFE FUNCTION TERMINATED\") } }\n  ],\n  x: 100,\n  y: 200\n])\n```\n\n### Global Shortcuts\n\n```js\n// Set global keyboard shortcut\nquark.addKeyboardShortcut({\n  keycode: 0x7A, // F1 key\n  modifierFlags: 0, // no modifier key\n  callback: function suchCallback() {\n    console.log(\"wow\")\n    quark.togglePopup()\n  }\n})\n\n// Clear global keyboard shortcut\nquark.clearKeyboardShortcut()\n```\n\nPlease follow [NSEvent Class Reference](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSEvent_Class/Reference/Reference.html#//apple_ref/doc/constant_group/Modifier_Flags) for documentation about modifier flags.\n\nAlso, Quark Shell for Mac allows you to record shortcuts via [native components in Preferences window](Docs/Preferences.md#native-components).\n\n### Preferences\n\n```js\nquark.setupPreferences([\n  {\"label\": \"General\",  \"identifier\": \"general\",  \"icon\": \"NSPreferencesGeneral\", \"height\": 192},\n  {\"label\": \"Account\",  \"identifier\": \"account\",  \"icon\": \"NSUserAccounts\",       \"height\": 102},\n  {\"label\": \"Shortcut\", \"identifier\": \"shortcut\", \"icon\": \"NSAdvanced\",           \"height\": 120}\n])\n\n// Must be called after quark.setupPreferences()\nquark.openPreferences()\nquark.closePreferences()\n```\n\nQuark Shell for Mac also provides some native components for preferences.\n\nMore detail: [Preferences.md](Docs/Preferences.md)\n\n### Auto Updating\n\n```js\n// Check for update\nquark.checkUpdate(\"https://rawgit.com/HackPlan/quark-shell-mac/master/updater/SampleAppcast.xml\")\nquark.checkUpdateInBackground(\"https://rawgit.com/HackPlan/quark-shell-mac/master/updater/SampleAppcast.xml\")\n```\n\nMore detail: [AutoUpdate.md](Docs/AutoUpdate.md)\n\n## FAQ\n* Can I use **local storage**? Yes.\n* Can I use **WebSQL**? Yes.\n* Can I use **IndexedDB**? No, because we are using NSWebView. A future Yosemite-only version using WKWebView will support IndexedDB.\n* Is Quark Shell compatible with Mac App Store? Absolutely yes.\n\n## Story\n\nQuark Shell was originally Menubar WebKit. It was created for [Pomotodo for Mac](https://pomotodo.com/apps). Later on, we decided to create a Windows version based on Atom Shell. The project was highly inspired by [Atom Shell (now Electron)](https://github.com/atom/electron), [node-webkit (now nw.js)](https://github.com/nwjs/nw.js), and [MacGap](https://github.com/MacGapProject/MacGap1). As a cross-platform project, Menubar WebKit is no longer an appropriate name, so we started to use Quark Shell.\n\n## Credits\n\n**Quark Shell for Mac** was created by **[LIU Dongyuan (@xhacker)](https://github.com/xhacker)** in the development of [Pomotodo for Mac](https://pomotodo.com).\n\nSome of the code are taken from:\n\n* [MacGap](https://github.com/maccman/macgap) by [@maccman](https://github.com/maccman)\n* [Bang](https://github.com/jesseXu/Bang) by [@jesseXu](https://github.com/jesseXu)\n* [Cordova OS X](https://github.com/apache/cordova-osx) by [Apache](http://www.apache.org)\n\nUsed third-party libraries:\n\n* [MASShortcut](https://github.com/shpakovski/MASShortcut) by [@shpakovski](https://github.com/shpakovski)\n* [RHPreferences](https://github.com/heardrwt/RHPreferences) by [@heardrwt](https://github.com/heardrwt)\n* [Sparkle](https://github.com/sparkle-project/Sparkle) by [contributors](https://github.com/sparkle-project/Sparkle/graphs/contributors)\n* [StartAtLoginController](https://github.com/alexzielenski/StartAtLoginController) by [@alexzielenski](https://github.com/alexzielenski)\n\n## Contribution\n\nPull requests are welcome! If you want to do something big, please open an issue first.\n\n## License\n\nMIT\n","funding_links":[],"categories":["Objective-C","GUI Frameworks"],"sub_categories":["Web"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHackPlan%2Fquark-shell-mac","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FHackPlan%2Fquark-shell-mac","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHackPlan%2Fquark-shell-mac/lists"}