make export clipboard to X inital working

This commit is contained in:
chrys 2017-09-12 00:50:10 +02:00
parent 014e5032ac
commit 3b91bb5a72

View File

@ -46,12 +46,14 @@ class command():
print('4') print('4')
return return
print('doit') 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() stdout, stderr = p.communicate()
self.env['runtime']['outputManager'].interruptOutput() self.env['runtime']['outputManager'].interruptOutput()
screenEncoding = self.env['runtime']['settingsManager'].getSetting('screen', 'encoding') #screenEncoding = self.env['runtime']['settingsManager'].getSetting('screen', 'encoding')
stderr = stderr.decode(screenEncoding, "replace").encode('utf-8').decode('utf-8') stderr = stderr.decode('utf-8')
stdout = stdout.decode(screenEncoding, "replace").encode('utf-8').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) print('test:',stderr,stdout)
if stderr != '': if stderr != '':
self.env['runtime']['outputManager'].presentText(stdout , soundIcon='', interrupt=False) self.env['runtime']['outputManager'].presentText(stdout , soundIcon='', interrupt=False)