Skip to content

polybar: add clickable calendar widget with PWA support - #18

Merged
krishna-bala merged 1 commit into
mainfrom
claude/polybar-calendar-icon-cdge55
Aug 14, 2026
Merged

krishna-bala merged 1 commit into
mainfrom
claude/polybar-calendar-icon-cdge55

Conversation

@krishna-bala

Copy link
Copy Markdown
Owner

Make the polybar date/time display clickable to open Google Calendar, with intelligent fallback to the web version.

Summary

Adds a new calendar.sh script that intelligently launches Google Calendar, preferring the installed PWA (if available) over the web version. Wraps the polybar date display in a click action to invoke this script.

Changes

  • New script: desktop-environment/polybar/shades/scripts/calendar.sh

    • Searches for an installed Google Calendar PWA by matching the Name= field in desktop entries (since PWA filenames are non-deterministic)
    • Attempts launch via gtk-launch or gio launch if available
    • Falls back to xdg-open https://calendar.google.com/ if no PWA is found or launch commands unavailable
  • Updated: desktop-environment/polybar/shades/modules.ini

    • Wraps the date/time format string in a polybar click action (%{A1:...%{A})
    • Left-click now invokes the calendar script
    • Added inline comment explaining the click behavior and %% escaping for strftime

Implementation notes

The script uses grep -lis to search desktop entry files for the PWA by its display name rather than filename, since browsers install PWAs with non-deterministic filenames like chromium-<app-id>-<profile>.desktop. This makes the solution robust across different browser and profile configurations.

https://claude.ai/code/session_01NSrjNbSF3Pt7SDZkoh6DiH

Wrap the date module's time string in a %{A1} action tag pointing at a
new calendar.sh, which launches the Google Calendar PWA when a browser
has installed one and falls back to calendar.google.com otherwise. PWA
desktop entries are found by Name= rather than filename, since browsers
name them <browser>-<app-id>-<profile>.desktop.
@krishna-bala
krishna-bala merged commit 7451e9d into main Aug 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants