{"id":15719723,"url":"https://github.com/anaghsharma/ambar-xamarin","last_synced_at":"2025-05-06T21:00:25.552Z","repository":{"id":86128342,"uuid":"93418690","full_name":"AnaghSharma/Ambar-Xamarin","owner":"AnaghSharma","description":"A macOS Menu Bar app built with Xamarin and C#","archived":false,"fork":false,"pushed_at":"2021-05-21T18:23:39.000Z","size":533,"stargazers_count":65,"open_issues_count":0,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-31T02:51:12.622Z","etag":null,"topics":["macos","macos-app","macos-menubar","macosx","popover","popup","xamarin","xamarin-mac","xamarin-macos"],"latest_commit_sha":null,"homepage":"","language":"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/AnaghSharma.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-05T15:30:20.000Z","updated_at":"2025-01-08T08:40:20.000Z","dependencies_parsed_at":"2023-03-13T08:34:47.703Z","dependency_job_id":null,"html_url":"https://github.com/AnaghSharma/Ambar-Xamarin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnaghSharma%2FAmbar-Xamarin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnaghSharma%2FAmbar-Xamarin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnaghSharma%2FAmbar-Xamarin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnaghSharma%2FAmbar-Xamarin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AnaghSharma","download_url":"https://codeload.github.com/AnaghSharma/Ambar-Xamarin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252769396,"owners_count":21801375,"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":["macos","macos-app","macos-menubar","macosx","popover","popup","xamarin","xamarin-mac","xamarin-macos"],"created_at":"2024-10-03T21:56:37.617Z","updated_at":"2025-05-06T21:00:25.417Z","avatar_url":"https://github.com/AnaghSharma.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ambar-Xamarin\nAmbar is a macOS Menu Bar app developed with Xamarin and C#. This project aims to show developing a menu bar app for macOS in C#.\n\n\u003cimg src=\"https://qd31ya-sn3301.files.1drv.com/y4mv06yfcD8ljmfYDwNQfAbD0gepsrIIU51habSGhFbIYxFYW5Os7lZhuttsP9rErl6yKPCIAlCUMfwurc8lmw5WE4DxEtjo-QMxcxExjMU4B6VRUBTvVpjZX7hcHG7KmuyKD_nkvEZNWLJfaoHgIo5YplkmGPMjRR330D656Hr7lfOsRs_8BzlzPEwYojnnGbkL7dtyu58O4cc_cUvvPi1NQ?width=778\u0026height=688\u0026cropmode=none\" width=\"425\" height=\"376\" /\u003e    \u003cimg src=\"https://pz3sya-sn3301.files.1drv.com/y4mT5cC-Z4h5vCKVvQZ81wOHZPtIfK8ptpzeuYLkGUMBZ-sjthSpnm1eleUUvaKOacmsU9oXD9laGswzsRYKcd0msIn6QQIzuZeHj71nUevzDAKg6APY3cWwa_PswMXD7WDAmtPJBYs87yywL60WusIdAvM0p0enEkEiM4aR_aZSah51PFbqFZ_8I2mJ3e3OP-3yCkYcvsUhwF-yt-Jf8Dnig?width=768\u0026height=690\u0026cropmode=none\" width=\"425\" height=\"376\" /\u003e\n\n\n### Update\nUsing Ambar as the base, I was able to build [Carol - a minimal and beautiful lyrics app for macOS](https://github.com/AnaghSharma/Carol-Xamarin). Check it out.\n\n## Why\nIt is for the folks wanting to start developing for macOS/iOS/tvOS/watchOS but do not want to delve into Swift/Obj-C and are already comfortable with C# and .Net technologies. \n\n\n## Tools Required\n1. Visual Studio for Mac\n2. Xcode\n\n\n## Steps\nHere is how you can do it - \n1. In Xcode, delete Window Controller Scene from `Main.storyboard` and provide Storyboard ID to View Controller.\n2. Add new entry in info.plist - `Application is agent (UIElement)` with its value set to `Yes` to make the app behave as a ghost.\n3. Create a Menu Bar status item using `CreateStatusItem()` method of `NSStatusBar`.\n4. Handle status bar icon for dark and light theme using `Template` property of `NSImage`.\n5. Handle event handling of status item using `Selector` class of `ObjCRuntime`.\n6. Show a popover using `NSPopover` and its `Show()` method.\n7. Make popover show on demand and hide when user moves on using `NSEvent` and a custom class.\n8. In Xcode, add a button to View Controller and create an action `QuitApplication` by `control + drag`. In VS, call `Terminate` method of `NSApplication`.\n\nUnless stated otherwise, everything is done in Visual Studio for Mac.\n\n\n## To-do\n- [x] Add a Contextual Menu to show options.\n- [x] Add a **Launch at Login** setting.\n- [x] Add a **About** window.\n\n\n## Contribute\nIf you think this project can be improved to show more of what can be done using Xamarin and C#, you are welcome to contribute. If you build something epic using it, just let me [know](https://twitter.com/AnaghSharma).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanaghsharma%2Fambar-xamarin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanaghsharma%2Fambar-xamarin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanaghsharma%2Fambar-xamarin/lists"}