本文整理汇总了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()
示例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();
示例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()
示例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()
示例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()