从github、stack overflow等编程网站获取桌面通知:)
toasts的Python项目详细描述
敬酒
Toasts是一个应用程序,它显示来自Github等不同网站的桌面通知, StackExchange、Bitbucket等。它只是在后台运行并显示 当有一个来自您已启用的站点时,您将收到通知。身份验证 您在特定网站上的用户帐户是通过个人访问令牌或 非统组织。
请注意,此项目仍在进行中,即使它有效。
支持的站点
- Github
如果您希望支持一个新站点,请打开一个问题,让我们看看 我们能做的:)
开始
要求
祝酒词是用python3编写的,这个包可以在pypi上找到。
截至目前,该应用程序仅在Linux上测试过。在Mac电脑上应该没问题,但是 Windows目前不受支持(我正在处理)。
安装
打开终端并:
$ pip install --user toasts
用于更新应用程序:
$ pip install --user -U toasts
使用量
在运行应用程序之前,我们应该首先在
config file。
Linux上的用户配置文件是~/.config/toasts/config.yaml
,并且
~/Library/Application Support/toasts/config.yaml
在Mac上。
目前只实现了github,因此您可以在如下配置文件中启用它:
# Config file for toastsgeneral:# List of sites to enable; comma seperated list# Default: []clients:[github]...
toasts使用个人访问令牌获取github通知。去
Developer Settings然后创建一个
有权访问您的通知。
然后将环境变量GH_UNAME
设置为github用户名,并将GH_TOKEN
设置为
刚刚创建的访问令牌(可以使用github进行身份验证
密码;只需将GH_TOKEN
设置为您的密码)。
你们都准备好了!
打开终端并运行toasts
命令:
$ toasts
如果您有来自 启用的站点。
我现在很高兴:)
配置文件
文件采用YAML格式:
# Config file for toastsgeneral:# List of sites to enable; comma seperated list# Default: []clients:[]# Connection timeout, in seconds# Default: 7 ; Minimum value: 1conn_timeout:7# Check for notifications every ___ minutes# Default: 3 ; Minimum value: 2check_every:3# Show notification for ___ seconds# Default: 7 ; Minimum value: 2notif_timeout:7# Maximum number of notifications to show at a time, of individual clients.# Default: 2# Note: Value of -1 will show all notifications; it may clutter your workspace.notif_max_show:2sites:github:# *Environment variable* which holds your github username# Default: GH_UNAMEusername:GH_UNAME# *Environment variable* which holds a personal access token for authentication# Default: GH_TOKENtoken:GH_TOKEN