Remove calendar widget
This commit is contained in:
parent
a4c4b3ef32
commit
3fd75c4991
1 changed files with 0 additions and 44 deletions
|
|
@ -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 = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue