Comments (3)
The command below uses a regular expression to figure out if the text is emoji (make sure you use latest version of the app - CopyQ 7.1.0):
[Command]
Automatic=true
Command="
copyq:
// https://stackoverflow.com/a/64007175/454171
const regex = /(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\u0023-\\u0039]\\ufe0f?\\u20e3|\\u3299|\\u3297|\\u303d|\\u3030|\\u24c2|\\ud83c[\\udd70-\\udd71]|\\ud83c[\\udd7e-\\udd7f]|\\ud83c\\udd8e|\\ud83c[\\udd91-\\udd9a]|\\ud83c[\\udde6-\\uddff]|\\ud83c[\\ude01-\\ude02]|\\ud83c\\ude1a|\\ud83c\\ude2f|\\ud83c[\\ude32-\\ude3a]|\\ud83c[\\ude50-\\ude51]|\\u203c|\\u2049|[\\u25aa-\\u25ab]|\\u25b6|\\u25c0|[\\u25fb-\\u25fe]|\\u00a9|\\u00ae|\\u2122|\\u2139|\\ud83c\\udc04|[\\u2600-\\u26FF]|\\u2b05|\\u2b06|\\u2b07|\\u2b1b|\\u2b1c|\\u2b50|\\u2b55|\\u231a|\\u231b|\\u2328|\\u23cf|[\\u23e9-\\u23f3]|[\\u23f8-\\u23fa]|\\ud83c\\udccf|\\u2934|\\u2935|[\\u2190-\\u21ff])/g;
function isEmoji(format) {
const text = str(data(format));
const m = text.match(regex);
return m && m[0].length === text.length;
}
if ( isEmoji(mimeText) || isEmoji(mimeTextUtf8) )
ignore();"
Icon=\xf05e
Name=Avoid Storing Emoji
from copyq.
The command below uses a regular expression to figure out if the text is emoji (make sure you use latest version of the app - CopyQ 7.1.0):
[Command] Automatic=true Command=" copyq: // https://stackoverflow.com/a/64007175/454171 const regex = /(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\u0023-\\u0039]\\ufe0f?\\u20e3|\\u3299|\\u3297|\\u303d|\\u3030|\\u24c2|\\ud83c[\\udd70-\\udd71]|\\ud83c[\\udd7e-\\udd7f]|\\ud83c\\udd8e|\\ud83c[\\udd91-\\udd9a]|\\ud83c[\\udde6-\\uddff]|\\ud83c[\\ude01-\\ude02]|\\ud83c\\ude1a|\\ud83c\\ude2f|\\ud83c[\\ude32-\\ude3a]|\\ud83c[\\ude50-\\ude51]|\\u203c|\\u2049|[\\u25aa-\\u25ab]|\\u25b6|\\u25c0|[\\u25fb-\\u25fe]|\\u00a9|\\u00ae|\\u2122|\\u2139|\\ud83c\\udc04|[\\u2600-\\u26FF]|\\u2b05|\\u2b06|\\u2b07|\\u2b1b|\\u2b1c|\\u2b50|\\u2b55|\\u231a|\\u231b|\\u2328|\\u23cf|[\\u23e9-\\u23f3]|[\\u23f8-\\u23fa]|\\ud83c\\udccf|\\u2934|\\u2935|[\\u2190-\\u21ff])/g; function isEmoji(format) { const text = str(data(format)); const m = text.match(regex); return m && m[0].length === text.length; } if ( isEmoji(mimeText) || isEmoji(mimeTextUtf8) ) ignore();" Icon=\xf05e Name=Avoid Storing Emoji
Your command successfully detects "single emoji" entries, but it doesn't remove them properly. Instead, it results in whatever was in index 1 moving to 0 and the emoji being behind. I can watch it delete the entry through copyq where it deletes the entry but it is then replaced. Maybe add a delay before the command runs as I think the error is coming from the raycast extension I am using.
from copyq.
The command above only avoids new "emoji" items to be added from the system clipboard. It will not remove existing items from CopyQ.
from copyq.
Related Issues (20)
- Ability/setting to scale preview pane images?
- qt6 builds still look for x11extras (failure on linux) HOT 1
- How to keep the window name of CopyQ unchanged? HOT 1
- Performance hit when using Encryption plugin HOT 1
- J S O N style format for configuration file HOT 3
- CopyQ : weird process? HOT 1
- Causes abnormal playback of videos on web pages HOT 2
- Global object gets corrupted after some time in Display command runner process
- CopyQ application on Fedora Cinnamon shows controls but no text HOT 6
- CopyQ : Warning before deleting more than x items or all HOT 1
- CopyQ : Colors when editing?
- External Scripting Issue / Request to Create Script in JavaScript HOT 2
- Mention that Winget can be used to install on Windows
- CopyQ window hidden at the right side of the monitor after computer standby mode
- paste to current window not working on Windows 11 HOT 3
- Paste not working with Hyprland (wayland support script enabled) HOT 9
- Feature request: Add QR-code generator HOT 3
- Shift + V get's remembered as shortcut, even after re-installs. HOT 1
- Broken image preview in clipboard on certain websites HOT 1
- Wayland Support script not working
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from copyq.