Attempt to fix import/export GUI clipboard for some distros.
This commit is contained in:
parent
6edb743c23
commit
bbfd2790a9
@ -6,6 +6,7 @@
|
||||
|
||||
from fenrirscreenreader.core import debug
|
||||
import os
|
||||
import importlib
|
||||
import _thread
|
||||
import pyperclip
|
||||
|
||||
@ -42,6 +43,7 @@ class command():
|
||||
# Set display environment variable
|
||||
os.environ['DISPLAY'] = display
|
||||
# Attempt to set clipboard content
|
||||
importlib.reload(pyperclip) # Weird workaround for some distros
|
||||
pyperclip.copy(clipboard)
|
||||
# If we get here without exception, we found a working display
|
||||
success = True
|
||||
|
@ -5,6 +5,7 @@
|
||||
# By Chrys, Storm Dragon, and contributers.
|
||||
|
||||
from fenrirscreenreader.core import debug
|
||||
import importlib
|
||||
import _thread
|
||||
import pyperclip
|
||||
import os
|
||||
@ -34,6 +35,7 @@ class command():
|
||||
# Set display environment variable
|
||||
os.environ['DISPLAY'] = display
|
||||
# Attempt to get clipboard content
|
||||
importlib.reload(pyperclip) # Weird workaround for some distros
|
||||
clipboardContent = pyperclip.paste()
|
||||
# If we get here without exception, we found a working display
|
||||
if clipboardContent:
|
||||
|
Loading…
x
Reference in New Issue
Block a user