Exemple #1
0
class Bar:
    def __init__(self, conf_file, layout):
        self.conf = Config(conf_file, layout)
        self.entities = []
        self.bar = Status(standalone=True)

        for e in self.conf.entities:
            self.entities.append(ModFacade(e, self.conf.config))

    def run(self):
        for ent in self.entities:
            [ m.register(self.bar) for m in ent.get_mods() ]
        self.bar.run()
Exemple #2
0
def main():
    # Register from right to left.
    status = Status()
    status.register('clock', format=('🌍 %H:%M', 'Europe/Dublin'))
    status.register('clock',
                    format=(' / %H:%M', 'America/New_York'),
                    hints={'separator': False})
    status.register('clock',
                    format=('🌎 %H:%M', 'America/Los_Angeles'),
                    hints={
                        'separator': False,
                        'separator_block_width': 0
                    })
    status.register('clock',
                    format=('🌏 %H:%M', 'Asia/Hong_Kong'),
                    hints={'separator': False})
    status.register('shell',
                    command='~/.config/i3/i3status/today.py',
                    hints={'separator': False})
    status.register('shell', command='~/.config/i3/i3status/weather.sh')

    status.register('battery',
                    format='{status} {percentage:.1f}%',
                    charging_color='#F8F8F8',
                    full_color='#F8F8F8',
                    status={
                        'CHR': '🔌',
                        'DIS': '🔋',
                        'DPL': 'DPL',
                        'FULL': '⚡',
                    })
    status.register('pulseaudio',
                    format='🔉 {volume}%',
                    format_muted='🔇 Muted',
                    color_muted='#AB4642',
                    hints={'separator': False},
                    on_leftclick='switch_mute')
    status.run()
Exemple #3
0
#status.register("network",
#    interface="wlan0",
#    format_up="{essid} {quality:03.0f}%",)

# Shows disk usage of /
# Format:
# 42/128G [86G]
status.register(
    "disk",
    path="/",
    format="{used}/{total}G [{avail}G]",
)

# Shows pulseaudio default sink volume
#
# Note: requires libpulseaudio from PyPI
status.register("pulseaudio",
                format="[AUDIO]%{volume}",
                color_unmuted="#3399ff")

status.register("backlight")

status.register("bitcoin")
status.register("coin", coin="ethereum")
status.register("coin", coin="litecoin")
status.register("coin", coin="siacoin", decimal=4)

status.register("cpu_usage_graph")
status.run()
i
Exemple #4
0
# 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()
Exemple #5
0
from i3pystatus import Status

status = Status()




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


status.run();
Exemple #6
0
    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()
Exemple #7
0
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()
    #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()
Exemple #9
0
    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()
Exemple #10
0
STATUS = Status(standalone=True)

# Displays clock like this:
# Tue 30 Jul 11:59:46 PM KW31
#                          ^-- calendar week
STATUS.register(
    "clock",
    format="%F W%V %X",
)

# Shows pulseaudio default sink volume
#
# Note: requires libpulseaudio from PyPI
# status.register("pulseaudio",
#        format="VOL {volume}%",)

STATUS.register("mem", format="MEM {used_mem:5.0f} MiB", divisor=1048576)

STATUS.register("cpu_usage", format="CPU {usage:3.0f}%")

for interface in netifaces.interfaces():
    STATUS.register("network",
                    interface=interface,
                    divisor=125000,
                    format_up=("{interface}: {essid} {quality:3.0f}% "
                               "↑{bytes_sent}Mbps / ↓{bytes_recv}Mbps"),
                    color_down='#444444')

STATUS.run()