time_alert.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:dotfiles 作者: nfischer 项目源码 文件源码
def notify(summary, body='', app_name='', app_icon='',
           timeout=5000, actions=[], hints=[], replaces_id=0):
    """Send a system notification"""
    _bus_name = 'org.freedesktop.Notifications'
    _object_path = '/org/freedesktop/Notifications'
    _interface_name = _bus_name

    session_bus = dbus.SessionBus()
    obj = session_bus.get_object(_bus_name, _object_path)
    interface = dbus.Interface(obj, _interface_name)
    interface.Notify(app_name, replaces_id, app_icon,
                     summary, body, actions, hints, timeout)


## Main ##

# Call battery_check shell script to get info

# TODO(nate): parse text more cleanly
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号