Browse Source

Fix copying multiple emojis

You can't just overwrite the selection every time and expect it to work.

Issue: #6
tags/2.0.1
Fabian Winter 1 year ago
parent
commit
2caf4479a0
1 changed files with 23 additions and 20 deletions
  1. 23
    20
      rofimoji.py

+ 23
- 20
rofimoji.py View File

@@ -1719,29 +1719,32 @@ rofi = Popen(
if rofi.returncode == 1:
exit()
else:
emojis = ""
for line in stdout.splitlines():
emoji = line.split()[0].decode('utf-8')

if emoji in skin_tone_selectable_emojis:
emoji = select_skin_tone(emoji)

if rofi.returncode == 0:
time.sleep(0.1)
Popen(
args=[
'xdotool',
'type',
'--clearmodifiers',
emoji
]
)
elif rofi.returncode == 10:
xsel = Popen(
args=[
'xsel',
'-i',
'-b'
],
stdin=PIPE
)
xsel.communicate(input=emoji.encode('utf-8'))
emojis += emoji

if rofi.returncode == 0:
time.sleep(0.1)
Popen(
args=[
'xdotool',
'type',
'--clearmodifiers',
emojis
]
)
elif rofi.returncode == 10:
xsel = Popen(
args=[
'xsel',
'-i',
'-b'
],
stdin=PIPE
)
xsel.communicate(input=emojis.encode('utf-8'))

Loading…
Cancel
Save