From 0f2606f19fd6d74c682a4d7c98291e5d8bb44af9 Mon Sep 17 00:00:00 2001 From: chrys Date: Tue, 12 Sep 2017 01:20:08 +0200 Subject: [PATCH] fix qutes --- src/fenrir/commands/commands/export_clipboard_to_x.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/fenrir/commands/commands/export_clipboard_to_x.py b/src/fenrir/commands/commands/export_clipboard_to_x.py index 51718d11..29318ada 100644 --- a/src/fenrir/commands/commands/export_clipboard_to_x.py +++ b/src/fenrir/commands/commands/export_clipboard_to_x.py @@ -39,14 +39,16 @@ class command(): self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True) return for display in range(10): - p = Popen('su ' + self.env['general']['currUser'] + ' -c "echo -n \"' + self.env['commandBuffer']['clipboard'][currClipboard] +'\" | xclip -d :' + str(display) + ' -selection c"' , stdout=PIPE, stderr=PIPE, shell=True) + p = Popen('su ' + self.env['general']['currUser'] + ' -c "echo -n \\\"' + self.env['commandBuffer']['clipboard'][currClipboard] +'\\\" | xclip -d :' + str(display) + ' -selection c"' , stdout=PIPE, stderr=PIPE, shell=True) stdout, stderr = p.communicate() self.env['runtime']['outputManager'].interruptOutput() #screenEncoding = self.env['runtime']['settingsManager'].getSetting('screen', 'encoding') stderr = stderr.decode('utf-8') stdout = stdout.decode('utf-8') if (stderr == ''): - break + break + else: + print(stderr) #stderr = stderr.decode(screenEncoding, "replace").encode('utf-8').decode('utf-8') #stdout = stdout.decode(screenEncoding, "replace").encode('utf-8').decode('utf-8') if stderr != '': @@ -54,7 +56,8 @@ class command(): else: self.env['runtime']['outputManager'].presentText('export clipboard', soundIcon='PasteClipboardOnScreen', interrupt=True) except Exception as e: - self.env['runtime']['outputManager'].presentText(e , soundIcon='', interrupt=False) + print(e) + self.env['runtime']['outputManager'].presentText(e , soundIcon='', interrupt=False) def setCallback(self, callback): pass