Is there a way to show time remaining until next calendar event? Preferably in the menu menu bar if possible? Maybe some other way to get something similar?
4 Answers
Here's a way to show the time remaining until the next calendar event in the menu bar.
- Install icalBuddy in
/usr/local/bin
(the easiest way is with Homebrew:brew install ical-buddy
) - Download and launch BitBar
- Put the following script in the plugin folder you selected (as
event.sh
, for example):
#!/bin/bash
osascript <<'END'
set theEventInfo to do shell script "/usr/local/bin/icalBuddy -n -li 1 -uid -ec 'Birthdays' -ps '/|/' eventsToday+10 | sed 's/^.*(\\(.*\\)).*uid: \\(.*\\)$/\\1|\\2/'"
set prevDelimiter to AppleScript's text item delimiters
set AppleScript's text item delimiters to {"|"}
set theEventInfos to every text item of theEventInfo
set AppleScript's text item delimiters to prevDelimiter
set theEventCalendar to first item of theEventInfos
set theEventUID to second item of theEventInfos
tell application "Calendar"
tell calendar theEventCalendar
set theEvent to first event whose uid is theEventUID
set duration to (start date of theEvent) - (current date)
return "next event in " & duration div hours & ":" & text -2 thru -1 of ("0" & (duration div minutes - (duration div hours * 60))) & return & "---" & return & summary of theEvent & return & start date of theEvent
end tell
end tell
END
A few notes:
- There's room for improvements, but the basics are there.
- It excludes the Birthdays calendar. It also can easily exclude all-day events by adding
-ea
in icalBuddy's parameters list
-
I have some Week #'s, and some other calendars, that are messing with this script. I can see in the code that you excluded
'Birthdays'
, I tried excluding'Week #s'
, along with a range of other calendars, with more-ec
’s, but couldn't get it to work (again). Is there a way to inverse the process such that I only select myMain
calendar and exclude everything else? Commented Oct 26, 2016 at 12:24
I use the App Store app Countdown Widget. It's 99 cents. It does just what you want. You set the date and time of an event and it displays a small rectangle on your screen with days and time until event. The display is shown below.
You can have the rectangle just on your desktop or have it float so its always on top. You can also have it countdown in days only or days and time like the one shown here. You can also set the colors to use for text and background.
There is a free app called "How Long Left" in the app store. does exactly this.
-
Why does is need to be more than one line if one line is the perfect answer? there is nothing to explain about it, no one in the world that is interested in this kind of app wouldn't need even one more word to understand it. Commented Jan 1, 2019 at 15:01