feat: add clipboard text writing functionality and update config
This commit is contained in:
2
cinny
2
cinny
Submodule cinny updated: f5ba778e46...42cc081d49
@@ -11,7 +11,7 @@
|
||||
"allowCustomHomeservers": true,
|
||||
|
||||
"calling": {
|
||||
"livekitServiceUrl": ""
|
||||
"livekitServiceUrl": "https://b.ruv.wtf/matrix-rtc/livekit/jwt"
|
||||
},
|
||||
|
||||
"featuredCommunities": {
|
||||
|
||||
@@ -567,6 +567,16 @@ ipcMain.handle('read-clipboard-image', async () => {
|
||||
}
|
||||
});
|
||||
|
||||
// Write text to clipboard
|
||||
ipcMain.handle('write-clipboard-text', async (event, text) => {
|
||||
try {
|
||||
clipboard.writeText(text);
|
||||
return { success: true };
|
||||
} catch (error) {
|
||||
return { success: false, error: error.message };
|
||||
}
|
||||
});
|
||||
|
||||
// Get YouTube stream using yt-dlp
|
||||
ipcMain.handle('get-youtube-stream', async (event, url) => {
|
||||
try {
|
||||
|
||||
@@ -9,6 +9,7 @@ const commandMap = {
|
||||
'window_is_maximized': 'window:is-maximized',
|
||||
'window_start_drag': 'window:start-drag',
|
||||
'read_clipboard_image': 'read-clipboard-image',
|
||||
'write_clipboard_text': 'write-clipboard-text',
|
||||
'open_external_url': 'open-external-url',
|
||||
'get_youtube_stream': 'get-youtube-stream',
|
||||
'start_background_sync': 'start-background-sync',
|
||||
@@ -97,7 +98,8 @@ contextBridge.exposeInMainWorld('electron', {
|
||||
|
||||
// Clipboard
|
||||
clipboard: {
|
||||
readImage: () => ipcRenderer.invoke('read-clipboard-image')
|
||||
readImage: () => ipcRenderer.invoke('read-clipboard-image'),
|
||||
writeText: (text) => ipcRenderer.invoke('write-clipboard-text', text)
|
||||
},
|
||||
|
||||
// External URLs
|
||||
|
||||
Reference in New Issue
Block a user