Browse Source

Merge pull request #15 from vyachkonovalov/master

Make emojis insertion work in Firefox and Telegram

Solves #7 (hopefully)
tags/3.0.0
Fabian Winter 7 months ago
parent
commit
95013e3865
No account linked to committer's email address
1 changed files with 11 additions and 10 deletions
  1. 11
    10
      rofimoji.py

+ 11
- 10
rofimoji.py View File

@@ -1806,16 +1806,17 @@ else:
emojis += emoji

if rofi.returncode == 0:
Popen(
args=[
'xdotool',
'type',
'--clearmodifiers',
'--window',
active_window,
emojis
]
)
# HACK: using clipboard and Control+v to insert emojis in Firefox and Telegram
xsel = Popen(args=['xsel', '-ob'], stdout=PIPE)
clipboard = xsel.communicate()[0].decode("utf-8")

xsel = Popen(args=['xsel', '-ib'], stdin=PIPE)
xsel.communicate(input=emojis.encode('utf-8'))

Popen(args=['xdotool', 'key', '--clearmodifiers', '--window', active_window, 'Control+v']).wait()

xsel = Popen(args=['xsel', '-ib'], stdin=PIPE)
xsel.communicate(input=clipboard.encode('utf-8'))
elif rofi.returncode == 10:
xsel = Popen(
args=[

Loading…
Cancel
Save