All Projects → HackPlan → Quark Shell Mac

HackPlan / Quark Shell Mac

Licence: mit
Quark Shell for Mac helps web developers to create native-like Mac menubar app using HTML and JavaScript without writing any native code.

Projects that are alternatives of or similar to Quark Shell Mac

Security Growler
📡 A Mac menubar app that notifies you whenever SSH, VNC, sudo, or other auth events occur.
Stars: ✭ 829 (-9.6%)
Mutual labels:  mac, menubar
Xbar
Put the output from any script or program into your macOS Menu Bar (the BitBar reboot)
Stars: ✭ 15,693 (+1611.34%)
Mutual labels:  mac, menubar
Adium
Official mirror of hg.adium.im
Stars: ✭ 146 (-84.08%)
Mutual labels:  mac, webkit
Macsvg
macSVG - An open-source macOS app for designing HTML5 SVG (Scalable Vector Graphics) art and animation with a WebKit web view ➤➤➤
Stars: ✭ 789 (-13.96%)
Mutual labels:  mac, webkit
For 0416
당신의 컴퓨터에 노란리본을 달아드립니다. For_0416 & Remember 0416
Stars: ✭ 70 (-92.37%)
Mutual labels:  menubar, mac
Hot
Hot is macOS menu bar application that displays the CPU speed limit due to thermal issues.
Stars: ✭ 131 (-85.71%)
Mutual labels:  mac, menubar
Nocturnal
A Dimness and Night Shift menu bar app for macOS 🌙
Stars: ✭ 199 (-78.3%)
Mutual labels:  mac, menubar
Menutube
Catch YouTube into your macOS menu bar! 🦄
Stars: ✭ 102 (-88.88%)
Mutual labels:  mac, menubar
macOS-PiholeShortcuts
Manage and monitor your Pi-hole® instance through your status bar
Stars: ✭ 43 (-95.31%)
Mutual labels:  menubar, mac
Quickeys
A mac menu bar app that provides note taking functionality though a quick dropdown menu.
Stars: ✭ 54 (-94.11%)
Mutual labels:  menubar, mac
Air
Mac menu bar app to track Air Quality
Stars: ✭ 63 (-93.13%)
Mutual labels:  mac, menubar
Mater
🍅 A simple and purty menubar Pomodoro app written in Electron
Stars: ✭ 433 (-52.78%)
Mutual labels:  mac, menubar
Chinese Lunar Calendar For Mac
Chinese Lunar Calendar for Mac
Stars: ✭ 150 (-83.64%)
Mutual labels:  mac, menubar
gifbar
🦄 Find Awesome Gif's right in your Menu Bar
Stars: ✭ 37 (-95.97%)
Mutual labels:  menubar, mac
Macdriver
Native Mac APIs for Go
Stars: ✭ 3,582 (+290.62%)
Mutual labels:  mac, webkit
Temps
Simple menubar application based on Electron with actual weather information and forecast.
Stars: ✭ 553 (-39.69%)
Mutual labels:  mac, menubar
Gifcapture
🏇 Gif capture app for macOS
Stars: ✭ 754 (-17.78%)
Mutual labels:  mac
Macapps
个人收集的一些mac使用的不易找到的app,不断更新中。
Stars: ✭ 726 (-20.83%)
Mutual labels:  mac
Rome
Carthage cache for S3, Minio, Ceph, Google Storage, Artifactory and many others
Stars: ✭ 724 (-21.05%)
Mutual labels:  mac
Mac Setup
Installing Development environment on macOS
Stars: ✭ 6,510 (+609.92%)
Mutual labels:  mac

Quark Shell for Mac

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.

Screenshot

Integrating Web App

app/index.html is the portal of your menubar app. app/preferences/[identifier].html are the preference pages (for example, app/preferences/general.html).

To build your app:

  1. Delete the current app folder
  2. Put your files into app folder
  3. Open quark-shell.xcworkspace in Xcode
  4. Change bundle name and bundle identifier (see Issue #50 for details)
  5. Build and have fun!

Remember that Quark Shell is still a WIP. When the project is stable enough, the build process will be simplified.

API

APIs may change rapidly before 1.0.

quark.platform // returns "mac" or "windows"

// App info (configurable in Xcode)
quark.appVersion
quark.appBundleVersion

// Enable/disable Web Inspector
quark.debug = true

// Manipulate the popup window
quark.openPopup()
quark.closePopup()
quark.togglePopup()
quark.resizePopup({width: 326, height: 623})

// Quit application
quark.quit()

// Open URL in default browser
quark.openURL("https://pomotodo.com/")

// Set menubar icon
quark.setMenubarIcon("data:image/png;base64,iVBORw...SuQmCC")
quark.setMenubarHighlightedIcon("data:image/png;base64,iVBORw...SuQmCC")
quark.resetMenubarIcon()

// Set menubar icon click action
quark.setClickAction(function () { console.log("Don’t click me!"); })
quark.setSecondaryClickAction(function () { console.log("What did I say?"); })

// Set menubar label
quark.setLabel("03:14 AM")

// Auto launch at login
// You also need to change bundle identifier "com.hackplan.quark-shell-helper" to a proper one in quark-shell-helper.xcodeproj and QSHWebViewDelegate.m
quark.setLaunchAtLogin(true)

// Send system notification
quark.notify({
  title: "Pomotodo",
  content: "Break is over!",
  time: "2038-01-19T03:14:07Z", // (optional) delivery date for scheduled notification, in ISO 8601
  popupOnClick: true // popup when clicking notification
})

// Remove all scheduled notifications
quark.removeAllScheduledNotifications()

// Remove all delivered notifications from notification center
quark.removeAllDeliveredNotifications()

// Open new window
// "url" is relative to "app" folder
// Notice: You can only open one window at the same time,
// or the later window will replace the former window.
quark.newWindow({
  url: "about.html",
  width: 600,
  height: 400,

  // optional options
  x: 100, y: 100, // x and y should both be provided, "center" is also a valid value
  border: true, // whether the window has a border, default is true
  shadow: true, // whether the window has a shadow, default is true
  alwaysOnTop: false, // whether the window should always on top, default is false
  alpha: 1.0 // the alpha value of the window, between 0 and 1, default is 1.0
})

// Close new window
quark.closeWindow()

// Pin/unpin pop-up window (won’t close when click outside the window)
quark.pin()
quark.unpin()

// Exchange messages between webviews
quark.emit("MessageName", "payload")
quark.on("MessageName", function(message) {
	console.log(message)
})

// Show a context menu
quark.showMenu({
  items: [
    {label: "Test", click: function() { console.log("I am completely operational") } },
    {type: "separator"},
    {label: "Exit", click: function() { console.log("LIFE FUNCTION TERMINATED") } }
  ],
  x: 100,
  y: 200
])

Global Shortcuts

// Set global keyboard shortcut
quark.addKeyboardShortcut({
  keycode: 0x7A, // F1 key
  modifierFlags: 0, // no modifier key
  callback: function suchCallback() {
    console.log("wow")
    quark.togglePopup()
  }
})

// Clear global keyboard shortcut
quark.clearKeyboardShortcut()

Please follow NSEvent Class Reference for documentation about modifier flags.

Also, Quark Shell for Mac allows you to record shortcuts via native components in Preferences window.

Preferences

quark.setupPreferences([
  {"label": "General",  "identifier": "general",  "icon": "NSPreferencesGeneral", "height": 192},
  {"label": "Account",  "identifier": "account",  "icon": "NSUserAccounts",       "height": 102},
  {"label": "Shortcut", "identifier": "shortcut", "icon": "NSAdvanced",           "height": 120}
])

// Must be called after quark.setupPreferences()
quark.openPreferences()
quark.closePreferences()

Quark Shell for Mac also provides some native components for preferences.

More detail: Preferences.md

Auto Updating

// Check for update
quark.checkUpdate("https://rawgit.com/HackPlan/quark-shell-mac/master/updater/SampleAppcast.xml")
quark.checkUpdateInBackground("https://rawgit.com/HackPlan/quark-shell-mac/master/updater/SampleAppcast.xml")

More detail: AutoUpdate.md

FAQ

  • Can I use local storage? Yes.
  • Can I use WebSQL? Yes.
  • Can I use IndexedDB? No, because we are using NSWebView. A future Yosemite-only version using WKWebView will support IndexedDB.
  • Is Quark Shell compatible with Mac App Store? Absolutely yes.

Story

Quark Shell was originally Menubar WebKit. It was created for Pomotodo for Mac. Later on, we decided to create a Windows version based on Atom Shell. The project was highly inspired by Atom Shell (now Electron), node-webkit (now nw.js), and MacGap. As a cross-platform project, Menubar WebKit is no longer an appropriate name, so we started to use Quark Shell.

Credits

Quark Shell for Mac was created by LIU Dongyuan (@xhacker) in the development of Pomotodo for Mac.

Some of the code are taken from:

Used third-party libraries:

Contribution

Pull requests are welcome! If you want to do something big, please open an issue first.

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].