Automaticé toda mi mañana con un banderín y nunca volveré antes.

#!/usr/bin/env python3

import subprocess
import time
import os
from datetime import datetime
import webbrowser

CONFIG = {
"chrome_profile": "Profile 1",
"urls": {
"current_doc": "https://docs.google.com/document/d/YOUR_DOC_ID",
"task_manager": "https://app.asana.com/0/home",
"research_tool": "https://notebooklm.google.com",
"email": "https://mail.google.com",
},
"apps": {
"notes": "Notes",
"calendar": "Calendar",
"slack": "Slack",
},
"docker_services": (),
"delays": {
"email": 300,
"slack": 600,
},
}

def run_command(cmd, shell=False):
try:
result = subprocess.run(cmd, shell=shell, capture_output=True, text=True, check=False)
return result.stdout.strip()
except Exception as e:
print(f"Error: {e}")
return ""

def open_app(app_name):
subprocess.Popen(("open", "-a", app_name))

def open_url(url, profile=None):
if profile:
chrome_path = "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
subprocess.Popen((chrome_path, f"--profile-directory={profile}", url))
else:
webbrowser.open(url)

def notify(title, message):
script = f'display notification "{message}" with title "{title}"'
subprocess.run(("osascript", "-e", script))

def start_docker():
for service in CONFIG("docker_services"):
if service.endswith("docker-compose.yml"):
service_dir = os.path.dirname(os.path.expanduser(service))
subprocess.Popen(("docker-compose", "up", "-d"), cwd=service_dir)
else:
subprocess.Popen(("docker", "start", service))

def get_calendar_mode():
now = datetime.now()
hour = now.hour
is_friday = now.weekday() == 4

# check if early meeting (before 10am)
# in efectivo version: pull from gcal api
has_early_meeting = False # placeholder

if is_friday:
return "friday"
elif has_early_meeting:
return "meeting"
elif hour return "deep_work"
else:
return "standard"

def meeting_mode():
open_app(CONFIG("apps")("calendar"))
time.sleep(2)
run_command("""
osascript -e 'tell application "Calendar"
activate
tell application "System Events"
keystroke "f" using {command down, control down}
end tell
end tell
""", shell=True)
open_url(CONFIG("urls")("current_doc"), CONFIG("chrome_profile"))

def deep_work_mode():
open_app(CONFIG("apps")("notes"))
open_url(CONFIG("urls")("task_manager"), CONFIG("chrome_profile"))

def friday_mode():
# point these at presente urls
reporting_doc = "https://docs.google.com/document/d/YOUR_REPORTING_DOC"
analytics = "https://your-analytics-dashboard.com"
open_url(reporting_doc, CONFIG("chrome_profile"))
open_url(analytics, CONFIG("chrome_profile"))

def standard_mode():
open_app(CONFIG("apps")("calendar"))
open_app(CONFIG("apps")("notes"))
open_url(CONFIG("urls")("current_doc"), CONFIG("chrome_profile"))
time.sleep(1)
open_url(CONFIG("urls")("task_manager"), CONFIG("chrome_profile"))
time.sleep(1)
open_url(CONFIG("urls")("research_tool"), CONFIG("chrome_profile"))

def show_briefing():
now = datetime.now()
briefing = f"""Good morning - {now.strftime('%A, %B %d')}

Meetings today:
- (pull from calendar api)

Top priorities:
1.
2.
3.

Reminder: (your thing)
"""
print(briefing)
notify("Morning", "Briefing ready")

def main():
start_docker()
show_briefing()

mode = get_calendar_mode()

if mode == "meeting":
meeting_mode()
elif mode == "deep_work":
deep_work_mode()
elif mode == "friday":
friday_mode()
else:
standard_mode()

# delayed opens
subprocess.Popen((
"python3", "-c",
f"import time; time.sleep({CONFIG('delays')('email')}); "
f"import subprocess; subprocess.run(('open', '{CONFIG('urls')('email')}'))"
))

subprocess.Popen((
"python3", "-c",
f"import time; time.sleep({CONFIG('delays')('slack')}); "
f"import subprocess; subprocess.run(('open', '-a', '{CONFIG('apps')('slack')}'))"
))

if __name__ == "__main__":
main()

Related Posts

La startup de inteligencia sintético Ringtime recauda 1,8 millones de euros para agentes de voz

Los reclutadores pasan horas al día llamando, dejando mensajes de voz y haciendo las mismas preguntas. Ringtime lo automatiza todo y ya ha contrario un segundo hogar en el sector…

Cómo convertir tu antiguo teléfono Android en un dilatador de Wi-Fi y solucionar los puntos muertos en casa

¿Esto mejorará la velocidad de Wi-Fi de mi hogar? No. Amplía la cobertura Wi-Fi de tu hogar, no la velocidad. Es posible que su conexión sea incluso un poco más…

You Missed

La startup de inteligencia sintético Ringtime recauda 1,8 millones de euros para agentes de voz

La startup de inteligencia sintético Ringtime recauda 1,8 millones de euros para agentes de voz

La ocupación ilegal y el mal estado complican caminar en aceras SDE

La ocupación ilegal y el mal estado complican caminar en aceras SDE

Irán amenaza con atacar infraestructura energética de aliados

Irán amenaza con atacar infraestructura energética de aliados

Irán amenaza con destruir el sector energético del Vagabundo

Irán amenaza con destruir el sector energético del Vagabundo

Premios Soberano 2026, una oscuridad que celebró el talento dominicano

Premios Soberano 2026, una oscuridad que celebró el talento dominicano

Cómo convertir tu antiguo teléfono Android en un dilatador de Wi-Fi y solucionar los puntos muertos en casa

Cómo convertir tu antiguo teléfono Android en un dilatador de Wi-Fi y solucionar los puntos muertos en casa