Browse Source

use primary selection and middle mouse button to insert emojis

tags/3.0.0
Vyacheslav Konovalov 4 months ago
parent
commit
33bc7f735f
1 changed files with 12 additions and 10 deletions
  1. 12
    10
      rofimoji.py

+ 12
- 10
rofimoji.py View File

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

if rofi.returncode == 0:
Popen(
args=[
'xdotool',
'type',
'--clearmodifiers',
'--window',
active_window,
emojis
]
)
# HACK: using primary selection and middle mouse button
# to make emojis insertion work in Firefox and Telegram
xsel = Popen(args=['xsel', '-op'], stdout=PIPE)
primary_selection = xsel.communicate()[0].decode("utf-8")

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

Popen(args=['xdotool', 'click', '--window', active_window, '2']).wait()

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

Loading…
Cancel
Save