I asked the question how to run the clipboard cleanup command from python , and I got a good answer for this :
subprocess.run("xclip",stdin=subprocess.DEVNULL)
subprocess.run(["xclip","-selection","clipboard"],input="")
This seems to work in python, but there is a problem and the process remains open. In fact, it opens 2 processes, one xclip
and one with parameters xclip -selection clipboard
.
And it seems that they are zombie processes, they remain there indefinitely, until you copy-paste something again. After that, they both disappear.
So, I ran the script from the directory of the USB drive, and it does not allow you to remove the USB drive, it says "USB drive busy" until the processes are closed.
So either I copy something new to the clipboard, otherwise the process remains there indefinitely, like zombies.
Is it possible to just close the process after the python script has finished ? Since there is no reason for this process to remain open after running the python script.
source
share