Browse Source

i3pystatus: some ice-status improvements

main
Franzi 1 week ago
parent
commit
2c60a28c16
Signed by: kunsi GPG Key ID: 12E3D2136B818350
  1. 2
      .config/i3pystatus/config.py
  2. 8
      .config/i3pystatus/ice-status.py

2
.config/i3pystatus/config.py

@ -98,7 +98,9 @@ status.register("shell",
status.register("shell",
format="{output}",
hints = {"markup": "pango"},
command="/home/kunsi/.config/i3pystatus/ice-status.py",
ignore_empty_stdout=True,
interval=2)
status.register("network",

8
.config/i3pystatus/ice-status.py

@ -7,7 +7,7 @@ from sys import exit
# bundlewrap.utils.text.format_duration, but trimmed down
def format_time(seconds, with_seconds=True):
def format_time(seconds):
components = []
if seconds >= 3600:
hours = int(seconds / 3600)
@ -17,8 +17,8 @@ def format_time(seconds, with_seconds=True):
minutes = int(seconds / 60)
seconds -= minutes * 60
components.append('{}m'.format(minutes))
if (seconds > 0 and with_seconds) or not components:
components.append('{}s'.format(seconds))
if not components:
components.append('now')
return " ".join(components)
@ -56,7 +56,7 @@ try:
stop['station']['name'],
stop['track']['actual'],
arrival.strftime('%H:%M'),
format_time(arrival_in.total_seconds(), False),
format_time(arrival_in.total_seconds()),
delay
)
break

Loading…
Cancel
Save