aboutsummaryrefslogtreecommitdiffstats
path: root/i3/bar.py
blob: c3368d04f08ffa2c73f44da9d1148b2a7c3beb51 (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# -*- 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 == "zorg.kyriasis.com":
    status.register("network",
                    interface="wlp4s0",
                    format_up="{essid:.10s}: {v4cidr} {quality:3.0f}%",)

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


elif 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()