Browse Source

Merge pull request #4 from carnager/master

Allow to print multiple emojis
tags/2.0.0
fdw 1 year ago
parent
commit
ed5d18ffee
No account linked to committer's email address
2 changed files with 25 additions and 21 deletions
  1. 3
    1
      readme.md
  2. 22
    20
      rofimoji.py

+ 3
- 1
readme.md View File

@@ -8,10 +8,12 @@ Inserts the selected emoji directly, or copies it to the clipboard.

1. Run `rofimoji.py`
2. Search for the emoji you want
3. - Hit enter to insert the emoji directly
3. - Hit enter to insert the emoji directly*
- Hit `Alt+c` to copy it to the clipboard
4. 🎠

* You can select multiple emojis with Shift+enter.

## How does it look?

![Screenshot of rofimoji](screenshot.png?raw=true)

+ 22
- 20
rofimoji.py View File

@@ -7841,6 +7841,7 @@ rofi = Popen(
'rofi',
'-dmenu',
'-i',
'-multi-select',
'-p',
' 😀 ',
'-kb-custom-1',
@@ -7854,23 +7855,24 @@ rofi = Popen(
if rofi.returncode == 1:
exit()
else:
emoji = stdout.split()[0]
if rofi.returncode == 0:
Popen(
args=[
'xdotool',
'type',
'--clearmodifiers',
emoji.decode('utf-8')
]
)
elif rofi.returncode == 10:
xsel = Popen(
args=[
'xsel',
'-i',
'-b'
],
stdin=PIPE
)
xsel.communicate(input=emoji)
for line in stdout.splitlines():
emoji = line.split()[0]
if rofi.returncode == 0:
Popen(
args=[
'xdotool',
'type',
'--clearmodifiers',
emoji.decode('utf-8')
]
)
elif rofi.returncode == 10:
xsel = Popen(
args=[
'xsel',
'-i',
'-b'
],
stdin=PIPE
)
xsel.communicate(input=emoji)

Loading…
Cancel
Save