cal: attempt to fix "jump into video call" link

master
Yorick van Pelt 2023-08-28 10:52:47 +02:00
parent bdfa5d1777
commit 0ac58b8dbc
Signed by: yorick
GPG Key ID: D8D3CC6D951384DE
3 changed files with 10 additions and 4 deletions

View File

@ -50,6 +50,9 @@ def tooltip(evt):
{evt["s"].strftime("%b %d %H:%M")} - {evt["e"].strftime("%H:%M")}
"""
def openURI(uri):
subprocess.call(["systemd-run", "--user", "chromium", uri])
def click(evt):
# todo: only on certain time before
if 'hangoutLink' in evt:
@ -57,12 +60,12 @@ def click(evt):
url = evt["hangoutLink"] + "?authuser=" + str(authuser(evt))
subprocess.call(["playerctl", "pause"])
i3.command("focus output 'DVI-D-1', workspace --no-auto-back-and-forth 9")
subprocess.call(["chromium", url])
openURI(url)
else:
subprocess.call(["xdg-open", evt["htmlLink"]])
openURI(evt["htmlLink"])
def rightclick(evt):
subprocess.call(["xdg-open", "https://calendar.google.com"])
openURI("https://calendar.google.com")
events = [e for e in events if not gcal._DeclinedEvent(e)]
if opt == "dump":

View File

@ -22,7 +22,7 @@ in {
onChange = "systemctl --user restart waybar";
};
systemd.user.services.waybar.Service.Environment = [
"PATH=${lib.makeBinPath (with pkgs; [ pavucontrol xdg-utils bin.y-cal-widget playerctl bluez gnugrep bash ])}"
"PATH=${lib.makeBinPath (with pkgs; [ pavucontrol xdg-utils bin.y-cal-widget playerctl bluez gnugrep bash systemd chromium ])}"
];
programs.waybar = {
enable = true;

View File

@ -106,6 +106,9 @@ window#waybar {
#custom-cal.user-1 {
background: #f67755;
}
#custom-cal.user-2 {
background: #33b679;
}
#tray {
background-color: #2980b9;