From 3b91bb5a724c91ee02b55e4431c283d9c21f2970 Mon Sep 17 00:00:00 2001 From: chrys Date: Tue, 12 Sep 2017 00:50:10 +0200 Subject: [PATCH] make export clipboard to X inital working --- src/fenrir/commands/commands/export_clipboard_to_x.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/fenrir/commands/commands/export_clipboard_to_x.py b/src/fenrir/commands/commands/export_clipboard_to_x.py index 0497199f..d137ab7b 100644 --- a/src/fenrir/commands/commands/export_clipboard_to_x.py +++ b/src/fenrir/commands/commands/export_clipboard_to_x.py @@ -46,12 +46,14 @@ class command(): print('4') return print('doit') - p = Popen('su -c "echo -n \"' + self.env['commandBuffer']['clipboard'][currClipboard] +'\" | xclip -d :0 -selection c' + self.env['general']['currUser'] , stdout=PIPE, stderr=PIPE, shell=True) + p = Popen('su ' + self.env['general']['currUser'] + ' -c "echo -n \"' + self.env['commandBuffer']['clipboard'][currClipboard] +'\" | xclip -d :0 -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(screenEncoding, "replace").encode('utf-8').decode('utf-8') - stdout = stdout.decode(screenEncoding, "replace").encode('utf-8').decode('utf-8') + #screenEncoding = self.env['runtime']['settingsManager'].getSetting('screen', 'encoding') + stderr = stderr.decode('utf-8') + stdout = stdout.decode('utf-8') + #stderr = stderr.decode(screenEncoding, "replace").encode('utf-8').decode('utf-8') + #stdout = stdout.decode(screenEncoding, "replace").encode('utf-8').decode('utf-8') print('test:',stderr,stdout) if stderr != '': self.env['runtime']['outputManager'].presentText(stdout , soundIcon='', interrupt=False)