diff --git a/public/node_modules/clipboard-event/platform/clipboard-event-handler-linux b/public/node_modules/clipboard-event/platform/clipboard-event-handler-linux deleted file mode 100755 index 0f6d129..0000000 Binary files a/public/node_modules/clipboard-event/platform/clipboard-event-handler-linux and /dev/null differ diff --git a/public/node_modules/clipboard-event/platform/clipboard-event-handler-linux.c b/public/node_modules/clipboard-event/platform/clipboard-event-handler-linux.c deleted file mode 100644 index 5ef0b66..0000000 --- a/public/node_modules/clipboard-event/platform/clipboard-event-handler-linux.c +++ /dev/null @@ -1,38 +0,0 @@ -// https://stackoverflow.com/a/44992967 -// gcc -o xclipwatch xclipwatch.c -lX11 -lXfixes - -#include -#include -#include - -void WatchSelection(Display *display, Window window, const char *bufname) -{ - int event_base, error_base; - XEvent event; - Atom bufid = XInternAtom(display, bufname, False); - - assert( XFixesQueryExtension(display, &event_base, &error_base) ); - XFixesSelectSelectionInput(display, DefaultRootWindow(display), bufid, XFixesSetSelectionOwnerNotifyMask); - - while (True) - { - XNextEvent(display, &event); - - if (event.type == event_base + XFixesSelectionNotify && - ((XFixesSelectionNotifyEvent*)&event)->selection == bufid) - { - printf("CLIPBOARD_CHANGE\n"); - fflush(stdout); - } - } -} - -int main(){ - Display *display = XOpenDisplay(NULL); - Window window = DefaultRootWindow(display); - // WatchSelection(display,window,"PRIMARY"); - WatchSelection(display,window,"CLIPBOARD"); - XDestroyWindow(display, window); - XCloseDisplay(display); - return 0; -} diff --git a/public/node_modules/clipboard-event/platform/clipboard-event-handler-mac.swift b/public/node_modules/clipboard-event/platform/clipboard-event-handler-mac.swift deleted file mode 100644 index e9a8a35..0000000 --- a/public/node_modules/clipboard-event/platform/clipboard-event-handler-mac.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// main.swift -// clipboard-event -// -// Created by Joonhee Lee on 2021/01/30. -// - -import Foundation -import Cocoa - -let pasteboard: NSPasteboard = NSPasteboard.general -var count: Int = pasteboard.changeCount -var saved: String = pasteboard.string(forType: .string) ?? "null" - -repeat{ - usleep(500000) - if(count < pasteboard.changeCount && saved != pasteboard.string(forType: .string)){ - usleep(100000) - count = pasteboard.changeCount - saved = pasteboard.string(forType: .string) ?? "null" - print("CLIPBOARD_CHANGE") - fflush(stdout) - } -}while true diff --git a/public/node_modules/clipboard-event/platform/clipboard-event-handler-win32.cs b/public/node_modules/clipboard-event/platform/clipboard-event-handler-win32.cs deleted file mode 100644 index fa00f86..0000000 --- a/public/node_modules/clipboard-event/platform/clipboard-event-handler-win32.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using System.Windows.Forms; -using System.Runtime.InteropServices; - -namespace clipboard_event_handler_win32 { - internal static class NativeMethods { - //Reference https://docs.microsoft.com/en-us/windows/desktop/dataxchg/wm-clipboardupdate - public const int WM_CLIPBOARDUPDATE = 0x031D; - //Reference https://www.pinvoke.net/default.aspx/Constants.HWND - public static IntPtr HWND_MESSAGE = new IntPtr(-3); - //Reference https://www.pinvoke.net/default.aspx/user32/AddClipboardFormatListener.html - [DllImport("user32.dll", SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool AddClipboardFormatListener(IntPtr hwnd); - //Reference https://www.pinvoke.net/default.aspx/user32.setparent - [DllImport("user32.dll", SetLastError = true)] - public static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent); - } - - public sealed class ClipboardNotification { - private class NotificationForm : Form { - public NotificationForm() { - //Turn the child window into a message-only window (refer to Microsoft docs) - NativeMethods.SetParent(Handle, NativeMethods.HWND_MESSAGE); - //Place window in the system-maintained clipboard format listener list - NativeMethods.AddClipboardFormatListener(Handle); - } - - protected override void WndProc(ref Message m) { - //Listen for operating system messages - if (m.Msg == NativeMethods.WM_CLIPBOARDUPDATE) - { - Console.WriteLine("CLIPBOARD_CHANGE"); - } - //Called for any unhandled messages - base.WndProc(ref m); - } - } - - private static void Main(string[] args) { - Application.Run(new NotificationForm()); - } - } -} \ No newline at end of file diff --git a/src/data/notify.json b/src/data/notify.json index 2234074..41ca309 100644 --- a/src/data/notify.json +++ b/src/data/notify.json @@ -1,5 +1,5 @@ { "title": "重要版本更新提示", - "content": "1. 如果你是第一次使用此插件, 请务必设置跟随主程序启动选项, 否则可能导致剪贴板记录丢失
2. 插件内的收藏栏将在最近一个版本中移除, 届时点击收藏按钮将跳转到备忘快贴, 请尽快将已有数据保存, 使用备忘快贴代替
3. 插件使用过程中遇到任何问题, 请到论坛发布页回帖或加入QQ群反馈", - "version": 1 + "content": "1. 如果你是第一次使用此插件, 请务必设置跟随主程序启动选项, 否则可能导致剪贴板记录丢失
2. v1.4.0及以上版本 Linux用户需手动安装clipboard-event-handler-linux至usr/bin目录 详见插件官网指南
3. 插件使用过程中遇到任何问题, 请到论坛发布页回帖或加入QQ群反馈", + "version": 2 }