Update i3pystatus to be prettier.
This commit is contained in:
parent
8a728e75ca
commit
fb4fd434e8
@ -1,67 +1,82 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import os.path
|
||||||
|
import multiprocessing
|
||||||
|
|
||||||
|
|
||||||
from i3pystatus import Status
|
from i3pystatus import Status
|
||||||
|
|
||||||
status = Status(standalone=True)
|
status = Status(standalone=True)
|
||||||
|
|
||||||
# Displays clock like this:
|
COLORS = {
|
||||||
# Tue 30 Jul 11:59:46 PM KW31
|
'Black': '#252525',
|
||||||
# ^-- calendar week
|
'DarkRed': '#f92672',
|
||||||
|
'DarkGreen': '#a6e22e',
|
||||||
|
'DarkYellow': '#f4bf75',
|
||||||
|
'DarkBlue': '#66d9ef',
|
||||||
|
'DarkMagenta': '#ae81ff',
|
||||||
|
'DarkCyan': '#a1efe4',
|
||||||
|
'LightGrey': '#f8f8f2',
|
||||||
|
'DarkGrey': '#75715e',
|
||||||
|
'Red': '#f92672',
|
||||||
|
'Green': '#a6e22e',
|
||||||
|
'Yellow': '#f4bf75',
|
||||||
|
'Blue': '#66d9ef',
|
||||||
|
'Magenta': '#ae81ff',
|
||||||
|
'Cyan': '#a1efe4',
|
||||||
|
'White': '#f9f8f5',
|
||||||
|
}
|
||||||
|
|
||||||
status.register("clock",
|
status.register("clock",
|
||||||
format="%a %Y-%m-%d %H:%M:%S",)
|
format="%a %Y-%m-%d %H:%M:%S",
|
||||||
|
color=COLORS['Magenta'])
|
||||||
|
|
||||||
# Shows the average load of the last minute and the last 5 minutes
|
status.register("load",
|
||||||
# (the default value for format is used)
|
critical_limit=multiprocessing.cpu_count(),
|
||||||
status.register("load", critical_limit=4)
|
critical_color=COLORS['Red'])
|
||||||
|
|
||||||
# # Shows your CPU temperature, if you have a Intel CPU
|
status.register("disk",
|
||||||
# status.register("temp",
|
path="/",
|
||||||
# format="{temp:.0f}°C",)
|
format="{avail}G",
|
||||||
|
display_limit=15,
|
||||||
|
critical_limit=10,
|
||||||
|
critical_color=COLORS['Red'])
|
||||||
|
|
||||||
# The battery monitor has many formatting options, see README for details
|
status.register("pulseaudio",
|
||||||
|
format="♪{volume}%{muted}",
|
||||||
|
muted="M")
|
||||||
|
|
||||||
# This would look like this, when discharging (or charging)
|
if os.path.exists("/sys/class/power_supply/BAT1"):
|
||||||
# ↓14.22W 56.15% [77.81%] 2h:41m
|
status.register("battery",
|
||||||
# And like this if full:
|
|
||||||
# =14.22W 100.0% [91.21%]
|
|
||||||
#
|
|
||||||
# This would also display a desktop notification (via dbus) if the percentage
|
|
||||||
# goes below 5 percent while discharging. The block will also color RED.
|
|
||||||
status.register("battery",
|
|
||||||
battery_ident="BAT1",
|
battery_ident="BAT1",
|
||||||
format="{status}/{consumption:.2f}W {percentage:.2f}% [{percentage_design:.2f}%] {remaining:%E%h:%M}",
|
format="{consumption:.1f}W {percentage_design:.1f}%{status} {remaining:%E%h:%M}",
|
||||||
alert=True,
|
alert=True,
|
||||||
alert_percentage=5,
|
alert_percentage=20,
|
||||||
|
charging_color=COLORS['Yellow'],
|
||||||
|
full_color=COLORS['Green'],
|
||||||
|
critical_color=COLORS['Red'],
|
||||||
status={
|
status={
|
||||||
"DIS": "↓",
|
"DIS": "↓",
|
||||||
"CHR": "↑",
|
"CHR": "↑",
|
||||||
"FULL": "=",
|
"FULL": "=",
|
||||||
},)
|
})
|
||||||
|
|
||||||
# Has all the options of the normal network and adds some wireless specific things
|
if os.path.exists("/sys/class/net/wlp0s29u1u7i2"):
|
||||||
# like quality and network names.
|
status.register("wireless",
|
||||||
#
|
|
||||||
# Note: requires both netifaces and basiciw
|
|
||||||
status.register("wireless",
|
|
||||||
interface="wlp0s29u1u7i2",
|
interface="wlp0s29u1u7i2",
|
||||||
format_up="{essid} {quality:03.0f}%",)
|
format_up="{essid} {quality:.0f}%",
|
||||||
|
color_up=COLORS['Green'],
|
||||||
|
color_down=COLORS['Red'])
|
||||||
|
|
||||||
# Shows disk usage of /
|
if os.path.exists("/sys/class/net/eth0"):
|
||||||
# Format:
|
status.register("network",
|
||||||
# 42/128G [86G]
|
interface="eth0",
|
||||||
status.register("disk",
|
color_up=COLORS['Green'],
|
||||||
path="/",
|
color_down=COLORS['Red'])
|
||||||
format="{avail}G",)
|
|
||||||
|
|
||||||
status.register("mem")
|
status.register("mem",
|
||||||
|
color=COLORS['Green'])
|
||||||
# Shows pulseaudio default sink volume
|
|
||||||
#
|
|
||||||
# Note: requires libpulseaudio from PyPI
|
|
||||||
status.register("pulseaudio",
|
|
||||||
format="♪{volume}%",)
|
|
||||||
|
|
||||||
status.run()
|
status.run()
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user