File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 66# watch if clipboard buffer file has changed with last modified time
77# if changed, then copy the content to clipboard
88def start_clipboard_service ():
9- last_modified_time = os .path .getmtime (CLIPBOARD_BUFFER_FILE )
9+ buffer = os .popen (f"cat { CLIPBOARD_BUFFER_FILE } " ).read ().strip ()
10+
1011 # check is xclip installed
1112 _xclip = os .popen ("which xclip" ).read ().strip ()
1213 if _xclip is None :
@@ -16,9 +17,9 @@ def start_clipboard_service():
1617 while os .getenv ('DISPLAY' ) is not None :
1718 time .sleep (0.4 )
1819 if os .path .exists (CLIPBOARD_BUFFER_FILE ):
19- if os .path . getmtime ( CLIPBOARD_BUFFER_FILE ) != last_modified_time :
20+ if buffer != os .popen ( f"cat { CLIPBOARD_BUFFER_FILE } " ). read (). strip () :
2021 os .system (f"cat { CLIPBOARD_BUFFER_FILE } | xclip -selection clipboard" )
21- last_modified_time = os .path . getmtime ( CLIPBOARD_BUFFER_FILE )
22+ buffer = os .popen ( f"cat { CLIPBOARD_BUFFER_FILE } " ). read (). strip ( )
2223 else :
2324 print ("clipboard buffer file not found" )
2425 os .exit (1 )
You can’t perform that action at this time.
0 commit comments