Add photo frame idle mode and switch to Skylight-style theme
- After 5 min of no touch/motion, dashboard hides behind a fullscreen photo slideshow with centered time and date overlay - Photos loaded from PHOTOS_PATH env var (defaults to ~/Pictures/dashboard) via IPC + file:// URLs; traversal-guarded, recursive up to 2 levels - Motion or touch exits idle back to dashboard - Theme repainted warm cream / sage / stone ink with Nunito font and rounded cards; dark tokens kept so component classes still resolve - Adds PHOTO_FRAME.md with Samba cifs mount + systemd env instructions
This commit is contained in:
@@ -17,6 +17,9 @@ export interface ElectronAPI {
|
||||
startStream: (rtspUrl: string) => Promise<boolean>;
|
||||
stopStream: () => Promise<boolean>;
|
||||
};
|
||||
motion: {
|
||||
onDetected: (callback: () => void) => () => void;
|
||||
};
|
||||
app: {
|
||||
quit: () => void;
|
||||
toggleFullscreen: () => void;
|
||||
@@ -26,6 +29,11 @@ export interface ElectronAPI {
|
||||
getStoredToken: () => Promise<string | null>;
|
||||
getJellyfinApiKey: () => Promise<string | null>;
|
||||
};
|
||||
photos: {
|
||||
list: () => Promise<string[]>;
|
||||
getDir: () => Promise<string>;
|
||||
getUrl: (relative: string) => Promise<string | null>;
|
||||
};
|
||||
}
|
||||
|
||||
const electronAPI: ElectronAPI = {
|
||||
@@ -53,6 +61,13 @@ const electronAPI: ElectronAPI = {
|
||||
startStream: (rtspUrl: string) => ipcRenderer.invoke('frigate:startStream', rtspUrl),
|
||||
stopStream: () => ipcRenderer.invoke('frigate:stopStream'),
|
||||
},
|
||||
motion: {
|
||||
onDetected: (callback: () => void) => {
|
||||
const handler = (_event: IpcRendererEvent) => callback();
|
||||
ipcRenderer.on('motion:detected', handler);
|
||||
return () => ipcRenderer.removeListener('motion:detected', handler);
|
||||
},
|
||||
},
|
||||
app: {
|
||||
quit: () => ipcRenderer.invoke('app:quit'),
|
||||
toggleFullscreen: () => ipcRenderer.invoke('app:toggleFullscreen'),
|
||||
@@ -62,6 +77,11 @@ const electronAPI: ElectronAPI = {
|
||||
getStoredToken: () => ipcRenderer.invoke('config:getStoredToken'),
|
||||
getJellyfinApiKey: () => ipcRenderer.invoke('config:getJellyfinApiKey'),
|
||||
},
|
||||
photos: {
|
||||
list: () => ipcRenderer.invoke('photos:list'),
|
||||
getDir: () => ipcRenderer.invoke('photos:getDir'),
|
||||
getUrl: (relative: string) => ipcRenderer.invoke('photos:getUrl', relative),
|
||||
},
|
||||
};
|
||||
|
||||
contextBridge.exposeInMainWorld('electronAPI', electronAPI);
|
||||
|
||||
Reference in New Issue
Block a user