• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

jaredks/rumps: Ridiculously Uncomplicated macOS Python Statusbar apps

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

jaredks/rumps

开源软件地址(OpenSource Url):

https://github.com/jaredks/rumps

开源编程语言(OpenSource Language):

Python 99.9%

开源软件介绍(OpenSource Introduction):

rumps

Ridiculously Uncomplicated macOS Python Statusbar apps.

https://raw.github.com/jaredks/rumps/master/examples/rumps_example.png

import rumps

class AwesomeStatusBarApp(rumps.App):
    @rumps.clicked("Preferences")
    def prefs(self, _):
        rumps.alert("jk! no preferences available!")

    @rumps.clicked("Silly button")
    def onoff(self, sender):
        sender.state = not sender.state

    @rumps.clicked("Say hi")
    def sayhi(self, _):
        rumps.notification("Awesome title", "amazing subtitle", "hi!!1")

if __name__ == "__main__":
    AwesomeStatusBarApp("Awesome App").run()

How fun!?

rumps can greatly shorten the code required to generate a working app. No PyObjC underscore syntax required!

Use case

rumps is for any console-based program that would benefit from a simple configuration toolbar or launch menu.

Good for:

  • Notification-center-based app
  • Controlling daemons / launching separate programs
  • Updating simple info from web APIs on a timer

Not good for:

  • Any app that is first and foremost a GUI application

Required

  • PyObjC
  • Python 2.6+

Mac OS X 10.6 was shipped with Python 2.6 as the default version and PyObjC has been included in the default Python since Mac OS X 10.5. If you're using Mac OS X 10.6+ and the default Python that came with it, then rumps should be good to go!

Recommended

  • py2app

For creating standalone apps, just make sure to include rumps in the packages list. Most simple statusbar-based apps are just "background" apps (no icon in the dock; inability to tab to the application) so it is likely that you would want to set 'LSUIElement' to True. A basic setup.py would look like,

from setuptools import setup

APP = ['example_class.py']
DATA_FILES = []
OPTIONS = {
    'argv_emulation': True,
    'plist': {
        'LSUIElement': True,
    },
    'packages': ['rumps'],
}

setup(
    app=APP,
    data_files=DATA_FILES,
    options={'py2app': OPTIONS},
    setup_requires=['py2app'],
)

With this you can then create a standalone,

python setup.py py2app

Installation

Using pip,

pip install rumps

Or from source,

python setup.py install

Both of which will require sudo if installing in a system-wide location.

Virtual Environments

There are issues with using virtualenv because of the way the Python executable is copied. Although rumps attempts to apply a fix (hack) during the install process, it is not suggested to use virtualenv.

To ensure proper functionality, either use venv (packaged with Python 3) or create a standalone app using py2app.

python3 -m venv env

Documentation

Documentation is available at http://rumps.readthedocs.org

License

"Modified BSD License". See LICENSE for details. Copyright Jared Suttles, 2020.

Works Made With rumps

20twenty20 - eohomegrownapps

42-CanITakeCoffee - avallete

air-quality-app - grtfou

Airplane - C-Codes

allbar - raphaelhuefner

allofthelights - kenkeiter

attendee-tool-mlh - Bucknalla

Auroratain - Matt-McConway

AutoSSP - viktyz

AutoVPN - shadyabhi

BackgroundsForReddit - karlaugsten

bink - e40

bitracker - JZChen

BluetoothEvent - lostman-github

break-timer - jjmojojjmojo

breaker - amloewi

bundle-checker - jeffgodwyll

c1t1 - e9t

CamAlert - MrBananaPants

camsketch - pdubroy

casita - david-kuehn

ChargeMon - RhetTbull

ComicStreamer - beville

commitwatch - chrisfosterelli

ComMute - cwverhey

computer-time - rbrich

crypto-ticker-macOS - mqulateen

cryptocoin-quotes - Sayan98

cuco - jjuanda

currency-converter - ahmedelgohary

dns.app - damln

Dokky - rogierkn

dolar_bitcoin - celis

duplicati - duplicati

dysonMacOS - fhenwood

earth - nickrobson

ForceNapClone - hroftgit

freelan-bar - privacee

g-assistant-mac - agucova

gapa - ozlerhakan

GitSyncApp - jachin

Gumpy - RobGraham

Habitus - kmundnic

HalfCaff - dougn

happymac - laffra

harmenubar - vekkt0r

hatarake - kfdm-archive

HipStatus - jamfit

hp-lorem - jamesrampton

hs100-status-bar - craig-davis

iBatteryStats - saket13

iBrew - Tristan79

idiot - snare

interlocking - jrauch

istat - Lingdu0

keynote_snap - sasn0

Keypad - jelmer04

keyringo - tokenizecx

kizkiz - TkTech

koinex-status-ticker - kirantambe

leaguefriend - pandarison

LifxController - mitchmcdee

lil_ip_toolbar - mchlrtkwski

mac-shrew - mejmo

MacFaceID - vkalia602

majo-v - r4lv

MBatteryApp - Elliot-Potts

McBing - bagabont

Memcode - aroraenterprise

memdam - joshalbrecht

MenuBarGmail - rcmdnk

MenuPing - Julien Bordet

midi2dmx - davidbistolas

monero-ticker - Cisplatin

MoodLight - kretash

MoonTicker - skxu

musicbar - russelg

narcissist - helmholtz

Noise-Line - Dnncha

nowplaying_statusbar - MataiulS

obmenka - vlakin

OnAir - henrik242

org-clock-dashboard - srid

osx-bamboo-plan-status - spalter

osx-myair - CameronEx

PennAppsX - yousufmsoliman

phd - ChrisCummins

pokemon-go-status - pboardman

polly - interrogator

pompy - camilopayan

project_screen_to_lifx - emiraga

PSPEWC-mac - jacquesCedric

py-Timey - asakasinsky

pymodoro - volflow

pySplash - Egregors

quick-grayscale - shubhamjain

quiet - hiroshi

Radio-Crowd - EliMendelson

RadioBar - wass3r

RadioBar (fork) - mdbraber

rescuetime_statusbar - MauriceZ

rideindegochecker - josepvalls

RitsWifi - fang2hou

safety-bar - pyupio

SAT-Vocab-Quizzer - Legoben

sb-translate - leandroltavares

sharfoo - furqan-shakoor

ShortyURLShortener - Naktrem

shotput - amussey

SingMenuData - ponyfleisch

slack-status-bar - ericwb

slackify - nikodraca

Snapgrid - VladUsatii

snippets - quillford

sonostus - sarkkine

Spaceapi-Desktop - UrLab

SpaceSwitcher - SankaitLaroiya

SpotifyLyrics - yask123

steemticker-osx - ZachC16

Timebar - devonkong

Timebox - visini

Telkom-ADSL-Data-Usage - parautenbach

Telton - Yywww

Textinator - RhetTbull

these-days - hahayes

time-tracking - willsgrigg

timerbar - uberalex

tracker - jtxx000

TrojanA - chrisxiao

umma - mankoff

upbrew - stchris

uptimeIndicator - paulaborde

urstatus - kysely

uStatus - kdungs

VagrantBar - kingsdigitallab

voiceplay - tb0hdan

volsbb - akigugale

Volumio_bar - volderette

votingpowerbar - therealwolf42

VPN Handler - tsarenkotxt

WakeTime App - dleicht

WallpDesk - L3rchal

webcronic - josselinauguste

Whale - amka

WhyFi - OzTamir

WordTime - Demonstrandum

work_time_percent_applet - Benhgift

WorkWise - 8ern4ard

xCodea - lowne

yaca - drproteus

Zero - beejhuff

Submit a pull request to add your own!

Contributing

If you've submitted a pull request and need it reviewed, please request a review from @daredoes (contributing in free time, so please be patient)




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
agarrharr/awesome-macos-screensavers: 发布时间:2022-08-18
下一篇:
timsutton/osx-vm-templates: macOS templates for Packer and VeeWee.发布时间:2022-08-18
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap