dotfiles/config/lemonbar/bar.py

65 lines
2.1 KiB
Python
Raw Normal View History

2018-08-21 18:10:57 +02:00
#!/usr/bin/env python3
2018-09-05 09:07:37 +02:00
from providers import *
2018-09-06 07:38:22 +02:00
# TODO If multiple screen, expand the sections and share them
2018-09-06 12:17:03 +02:00
# TODO Graceful exit
2018-09-06 07:38:22 +02:00
2018-09-05 09:07:37 +02:00
if __name__ == "__main__":
Bar.init()
Updater.init()
2018-09-06 07:38:22 +02:00
WORKSPACE_THEME = 0
FOCUS_THEME = 3
URGENT_THEME = 1
2021-06-13 11:49:21 +02:00
CUSTOM_SUFFIXES = "▲■"
2018-09-06 22:07:32 +02:00
customNames = dict()
for i in range(len(CUSTOM_SUFFIXES)):
2021-06-13 11:49:21 +02:00
short = str(i + 1)
full = short + " " + CUSTOM_SUFFIXES[i]
2018-09-06 22:07:32 +02:00
customNames[short] = full
2021-06-13 11:49:21 +02:00
Bar.addSectionAll(
I3WorkspacesProvider(
theme=WORKSPACE_THEME,
themeFocus=FOCUS_THEME,
themeUrgent=URGENT_THEME,
themeMode=URGENT_THEME,
customNames=customNames,
),
BarGroupType.LEFT,
)
2018-09-06 07:38:22 +02:00
# TODO Middle
Bar.addSectionAll(MpdProvider(theme=7), BarGroupType.LEFT)
# Bar.addSectionAll(I3WindowTitleProvider(), BarGroupType.LEFT)
2018-09-05 09:07:37 +02:00
2018-10-06 10:27:36 +02:00
# TODO Computer modes
2018-09-06 07:38:22 +02:00
SYSTEM_THEME = 2
DANGER_THEME = FOCUS_THEME
CRITICAL_THEME = URGENT_THEME
Bar.addSectionAll(CpuProvider(), BarGroupType.RIGHT)
Bar.addSectionAll(RamProvider(), BarGroupType.RIGHT)
Bar.addSectionAll(TemperatureProvider(), BarGroupType.RIGHT)
Bar.addSectionAll(BatteryProvider(), BarGroupType.RIGHT)
2018-09-06 07:38:22 +02:00
# Peripherals
PERIPHERAL_THEME = 5
NETWORK_THEME = 4
2018-09-05 09:07:37 +02:00
# TODO Disk space provider
# TODO Screen (connected, autorandr configuration, bbswitch) provider
2018-09-06 07:38:22 +02:00
Bar.addSectionAll(PulseaudioProvider(theme=PERIPHERAL_THEME), BarGroupType.RIGHT)
2018-10-06 10:27:36 +02:00
Bar.addSectionAll(RfkillProvider(theme=PERIPHERAL_THEME), BarGroupType.RIGHT)
2018-09-06 07:38:22 +02:00
Bar.addSectionAll(NetworkProvider(theme=NETWORK_THEME), BarGroupType.RIGHT)
# Personal
PERSONAL_THEME = 0
# Bar.addSectionAll(KeystoreProvider(theme=PERSONAL_THEME), BarGroupType.RIGHT)
2020-01-06 16:23:50 +01:00
# Bar.addSectionAll(NotmuchUnreadProvider(dir='~/.mail/', theme=PERSONAL_THEME), BarGroupType.RIGHT)
2018-10-18 21:14:11 +02:00
# Bar.addSectionAll(TodoProvider(dir='~/.vdirsyncer/currentCalendars/', theme=PERSONAL_THEME), BarGroupType.RIGHT)
2018-09-06 07:38:22 +02:00
TIME_THEME = 6
Bar.addSectionAll(TimeProvider(theme=TIME_THEME), BarGroupType.RIGHT)
2018-10-06 10:27:36 +02:00
# Bar.run()