khal icon indicating copy to clipboard operation
khal copied to clipboard

Exclude calendars from highlighting

Open mirabilos opened this issue 4 months ago • 2 comments

I’d like a calendar (containing employees’ vacations) to have a colour, for the list view, but not cause a day to be highlighted or switch to multiple on account of that calendar.

I suggest to use priority = -1 for this feature.

This could look like: (diff against the installed Debian trixie package)

--- calendar_display.py~	2025-08-12 16:44:54.712407531 +0200
+++ calendar_display.py	2025-08-12 16:50:15.464103934 +0200
@@ -70,8 +70,10 @@
             get_calendar_color(x, default_color, collection),
             collection._calendars[x]["priority"],
         )
-        for x in calendars
+        for x in calendars if collection._calendars[x]["priority"] > -1
     ]
+    if len(dcolors) < 1:
+        return ['']
 
     dcolors.sort(key=lambda x: x[1], reverse=True)
 

Mildly tested, so it’s not PR material, but perhaps make one of it.

(btw, hi geier ;)

mirabilos avatar Aug 12 '25 14:08 mirabilos

Hi @mirabilos , long time no see! As you are a big open source hero of mine, I'm really happy to see you use a tool I started. Unfortunately, I haven't had too much time for khal in the past few years, thankfully @WhyNotHugo has been holding down the fort.

geier avatar Sep 09 '25 22:09 geier

We’re all standing on the shoulders of giants.

I’ll have to see when I can invest some more (work) time into this, but so far it’s working well, thanks for writing it.

mirabilos avatar Sep 09 '25 22:09 mirabilos