当前位置: 首页>>代码示例>>Python>>正文


Python Status.run方法代码示例

本文整理汇总了Python中i3pystatus.Status.run方法的典型用法代码示例。如果您正苦于以下问题:Python Status.run方法的具体用法?Python Status.run怎么用?Python Status.run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在i3pystatus.Status的用法示例。


在下文中一共展示了Status.run方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1:

# 需要导入模块: from i3pystatus import Status [as 别名]
# 或者: from i3pystatus.Status import run [as 别名]
# status.register('ping',
#    format_disabled='',
#    color='#61AEEE')

status.register("mpd",
                host='localhost',
                port='6600',
                format="{status}",
                on_leftclick="switch_playpause",
                on_rightclick=["mpd_command", "stop"],
                on_middleclick=["mpd_command", "shuffle"],
                on_upscroll=["mpd_command", "next_song"],
                on_downscroll=["mpd_command", "previous_song"],
                status={
                    "pause": " ",
                    "play": " ",
                    "stop": " ",
                },)

status.register("keyboard_locks",
                format='{caps} {num}',
                caps_on='Caps Lock',
                caps_off='',
                num_on='Num On',
                num_off='',
                color=base08,
                )

status.run()
开发者ID:reconmaster,项目名称:dotfiles,代码行数:31,代码来源:i3pystatus.py

示例2: Status

# 需要导入模块: from i3pystatus import Status [as 别名]
# 或者: from i3pystatus.Status import run [as 别名]
from i3pystatus import Status

status = Status()




status.register("clock",
            format="%a %-d %b %X KW%V",)


status.run();
开发者ID:Johannes-brahms,项目名称:backup,代码行数:14,代码来源:pystatus.py

示例3: Status

# 需要导入模块: from i3pystatus import Status [as 别名]
# 或者: from i3pystatus.Status import run [as 别名]
from i3pystatus import Status

bar = Status()



#status.register("alsa",on_upscroll = ["decrease_volume", 2],on_downscroll = ["increase_volume", 2])

bar.register("clock", format = "%a %-d, %X",on_leftclick =["exec zenity --calendar"])

bar.register("load")
#bar.register("temp", format = "{temp:.0f}°C")
#bar.register("weather")
#status.register('weather',format='{condition} {current_temp}{temp_unit}{icon}[ Hi: {high_temp}] Lo: {low_temp}'colorize=True, backend=weathercom.Weathercom(location_code='94107:4:US', units='imperial'))
bar.run()
开发者ID:georgegabrielli,项目名称:dotfiles,代码行数:17,代码来源:i3py.py

示例4:

# 需要导入模块: from i3pystatus import Status [as 别名]
# 或者: from i3pystatus.Status import run [as 别名]
    alert=False,
    alert_percentage=10,
    status={"DIS": u"()", "CHR": u"()", "FULL": u"(-)"},
)
stat.register(
    "battery",
    interval=13,
    battery_ident="BAT1",
    critical_color="#ff0000",
    format="{status} {percentage:02.0f}%" " {remaining:%E%h:%M}",
    alert=False,
    alert_percentage=10,
    status={"DIS": u"()", "CHR": u"()", "FULL": u"(-)"},
)

stat.register(
    "network",
    interval=7,
    interface="wlp3s0",
    color_up="#70F7AA",  # $sand in .i3 config
    color_down="#CCCCCC",
    format_up=" {essid}\[{v4}\]",
    format_down=" ",
)

stat.register("shell", command="~/.i3/status_scripts/update-stat.sh", interval=120)

stat.register("cpu_usage", format=" {usage:02}%")

stat.run()
开发者ID:steeef,项目名称:dotfiles,代码行数:32,代码来源:status.py

示例5: basiciw

# 需要导入模块: from i3pystatus import Status [as 别名]
# 或者: from i3pystatus.Status import run [as 别名]
    #format="{status} {consumption:.1f}W {percentage:.0f}% [{percentage_design:.0f}%] {remaining:%E%hh:%Mm}",
    format="{status} {consumption:4.1f}W {remaining:%E%h:%M} {percentage:.0f}%",
    alert=False, #TODO# Enable later. alert_percentage=5,
    status={"DIS": "↓", "CHR": "↑", "FULL": "⤒",}, #"FULL": "⥍ ⇞ ☢",}
#    status={"DIS": "⇂", "CHR": "↿", "FULL": "⥍",},
#    status={"DIS": "⇂", "CHR": "↿", "FULL": "⥮",},
)

try:
    st.register('backlight', backlight='intel_backlight', format='☀{percentage:3.0f}%') #TODO# make portable
except FileNotFoundError: # there is no intel_backlight
    pass

# Note: requires both netifaces and basiciw (for essid and quality)
wl = next((i for i in netifaces.interfaces() if i.startswith('wl')), None)
if wl:
    st.register("network", interface=wl,
        format_up="{essid} {quality:.0f}%")

st.register("disk", path="/media/data", format="data {avail:.0f}G",)

st.register("disk", path="/", format="root {avail:.0f}G",)

st.register('temp', format='{temp:.0f}°C')

st.register('load')

st.register('clock', format=('%Y-%m-%d %H:%M:%S UTC', 'UTC'))

st.run()
开发者ID:bluesquall,项目名称:ayellowsubmarine,代码行数:32,代码来源:status.py


注:本文中的i3pystatus.Status.run方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。