sync
This commit is contained in:
parent
3892fecf4b
commit
d47d9fd7bc
@ -110,6 +110,6 @@ KEY_FENRIR,KEY_C=copy_marked_to_clipboard
|
|||||||
KEY_FENRIR,KEY_V=paste_clipboard
|
KEY_FENRIR,KEY_V=paste_clipboard
|
||||||
|
|
||||||
# linux specific
|
# linux specific
|
||||||
#=export_clipboard_to_x
|
KEY_FENRIR,KEY_SHIFT,KEY_R=export_clipboard_to_x
|
||||||
KEY_FENRIR,KEY_CTRL,KEY_UP=inc_alsa_volume
|
KEY_FENRIR,KEY_CTRL,KEY_UP=inc_alsa_volume
|
||||||
KEY_FENRIR,KEY_CTRL,KEY_DOWN=dec_alsa_volume
|
KEY_FENRIR,KEY_CTRL,KEY_DOWN=dec_alsa_volume
|
||||||
|
@ -20,30 +20,39 @@ class command():
|
|||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('export the current fenrir clipboard to X clipboard')
|
return _('export the current fenrir clipboard to X clipboard')
|
||||||
def run(self):
|
def run(self):
|
||||||
_thread.start_new_thread(self._threadRun , ())
|
print('drin')
|
||||||
|
_thread.start_new_thread(self._threadRun , ())
|
||||||
|
|
||||||
def _threadRun(self):
|
def _threadRun(self):
|
||||||
|
print('jo')
|
||||||
try:
|
try:
|
||||||
currClipboard = self.env['commandBuffer']['currClipboard']
|
currClipboard = self.env['commandBuffer']['currClipboard']
|
||||||
|
print(currClipboard)
|
||||||
|
|
||||||
if currClipboard < 0:
|
if currClipboard < 0:
|
||||||
self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True)
|
||||||
|
print('1')
|
||||||
return
|
return
|
||||||
if not self.env['commandBuffer']['clipboard']:
|
if not self.env['commandBuffer']['clipboard']:
|
||||||
self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True)
|
||||||
|
print('2')
|
||||||
return
|
return
|
||||||
if not self.env['commandBuffer']['clipboard'][currClipboard]:
|
if not self.env['commandBuffer']['clipboard'][currClipboard]:
|
||||||
self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True)
|
||||||
|
print('3')
|
||||||
return
|
return
|
||||||
if self.env['commandBuffer']['clipboard'][currClipboard] == '':
|
if self.env['commandBuffer']['clipboard'][currClipboard] == '':
|
||||||
self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True)
|
||||||
|
print('4')
|
||||||
return
|
return
|
||||||
|
print('doit')
|
||||||
p = Popen('su -c "echo -n \"' + self.env['commandBuffer']['clipboard'][currClipboard] +'\" | xclip -selection c' + self.env['generalInformation']['currUser'] , stdout=PIPE, stderr=PIPE, shell=True)
|
p = Popen('su -c "echo -n \"' + self.env['commandBuffer']['clipboard'][currClipboard] +'\" | xclip -d :0 -selection c' + self.env['generalInformation']['currUser'] , 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(screenEncoding, "replace").encode('utf-8').decode('utf-8')
|
||||||
stdout = stdout.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 != '':
|
if stderr != '':
|
||||||
self.env['runtime']['outputManager'].presentText(stdout , soundIcon='', interrupt=False)
|
self.env['runtime']['outputManager'].presentText(stdout , soundIcon='', interrupt=False)
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user