From 0635464873ae29142699f15b3ca10f7393bacfc7 Mon Sep 17 00:00:00 2001 From: Owais Jamil Date: Wed, 17 Jun 2026 10:51:15 -0500 Subject: [PATCH] feat: startup sound with tray controls --- .changeset/heavy-regions-talk.md | 5 + src/lib/components/GnomeTray.svelte | 106 +++++++- src/lib/sounds.svelte.ts | 104 ++++++++ src/routes/+layout.svelte | 2 + .../humanity/status/audio-volume-muted.svg | 248 ++++++++++++++++++ static/sounds/login.ogg | Bin 0 -> 104421 bytes 6 files changed, 461 insertions(+), 4 deletions(-) create mode 100644 .changeset/heavy-regions-talk.md create mode 100644 src/lib/sounds.svelte.ts create mode 100644 static/icons/humanity/status/audio-volume-muted.svg create mode 100644 static/sounds/login.ogg diff --git a/.changeset/heavy-regions-talk.md b/.changeset/heavy-regions-talk.md new file mode 100644 index 0000000..03e2ea6 --- /dev/null +++ b/.changeset/heavy-regions-talk.md @@ -0,0 +1,5 @@ +--- +'intrepid-ibex': minor +--- + +add localStorage backed startup sound from ubuntu diff --git a/src/lib/components/GnomeTray.svelte b/src/lib/components/GnomeTray.svelte index 0d8753f..e0841d2 100644 --- a/src/lib/components/GnomeTray.svelte +++ b/src/lib/components/GnomeTray.svelte @@ -2,8 +2,10 @@ import { onMount } from 'svelte'; import { accountSetup } from '$lib/atproto/setup.svelte'; import { desktopSession } from '$lib/desktop-session.svelte'; + import { startupSound } from '$lib/sounds.svelte'; let now = $state(new Date()); + let isSoundMenuOpen = $state(false); const panelTime = $derived( now.toLocaleString([], { @@ -18,12 +20,33 @@ ); onMount(() => { + startupSound.initialize(); + const interval = window.setInterval(() => { now = new Date(); }, 1000); return () => window.clearInterval(interval); }); + + function replayStartupSound() { + isSoundMenuOpen = false; + void startupSound.replay(); + } + + function syncSoundMenuState(event: Event) { + const target = event.currentTarget; + if (!(target instanceof HTMLDetailsElement)) return; + + isSoundMenuOpen = target.open; + } + + function setStartupSoundMuted(event: Event) { + const target = event.currentTarget; + if (!(target instanceof HTMLInputElement)) return; + + startupSound.setMuted(target.checked); + }