aboutsummaryrefslogtreecommitdiffstats
path: root/i3/bar.py
blob: 2ce35153a0384a094d23835f870f5b056414fd22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# -*- coding: utf-8 -*-

import socket

from i3pystatus import Status

hostname = socket.gethostname()
status = Status(standalone=True)

status.register("clock",
                format="%y-%m-%d %H:%M:%S%z",)

status.register("battery",
                format="⚡:{percentage:.2f}% {remaining:%E%hh:%Mm}{status}",
                alert=True,
                alert_percentage=5,
                status={
                    "DIS": "↓",
                    "CHR": "↑",
                    "FULL": "=",
                },
                battery_ident="BAT0",)


status.register("temp",
                format="{temp:.0f}°C",)

status.register("pulseaudio",
                format="♪:{volume}%",)

if hostname == "tirxu.kyriasis.com":
    status.register("network",
                    interface="wlp4s0",
                    format_up="{essid:.10s}: {v4cidr} {quality:3.0f}%",)

    status.register("network",
                    interface="enp0s20u3u1u3",
                    format_up="{interface}: {v4cidr}")

status.register("disk",
                path="/boot",
                divisor=1024**2,
                format="/boot: {avail}M",)

status.register("disk",
                path="/",
                format="/: {avail}G",)


status.run()