Remove calendar widget

This commit is contained in:
Jakob Lechner 2025-03-13 04:10:47 +01:00
parent a4c4b3ef32
commit 3fd75c4991

View file

@ -49,7 +49,6 @@ in
"temperature"
"battery"
"clock"
"custom/calendar"
];
"sway/workspaces" = {
@ -178,44 +177,6 @@ in
format-alt = "{:%Y-%m-%d (%a)}";
tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
};
"custom/calendar" = {
interval = 300;
exec = pkgs.writeScript "calendar" /* python */ ''
#!${pkgs.python3}/bin/python3
import json
import subprocess
def khal(args):
completed = subprocess.run(["${pkgs.khal}/bin/khal"] + args, capture_output=True)
assert completed.returncode == 0
return completed.stdout.decode("utf-8")
events_today = khal(["list", "today", "today", "-df", "", "-f", "{title}"]).rstrip().split("\n")
events_2d = khal(["list", "today", "tomorrow", "-df", "<b>{name}, {date}</b>"]).rstrip()
if len(events_today) == 1 and events_today[0] == "No events":
events_today = []
if len(events_today) == 0:
text = "󰃮 "
else:
text = f"{len(events_today)} 󰃶 "
print(
json.dumps(
{
"class": "active" if len(events_today) > 0 else "",
"text": text,
"tooltip": events_2d,
}
)
)
'';
return-type = "json";
format = "{}";
};
};
xdg.configFile."waybar/theme-light.css".text = solarizedColors {
@ -399,11 +360,6 @@ in
animation-iteration-count: infinite;
animation-direction: alternate;
}
#custom-calendar.active {
background-color: @base07;
color: @base03;
}
'';
systemd.user.services.waybar = {