Debian Codegraph @

shared/plugins/example.js

raw
1 // This is example plugin script for CopyQ.
2 // Plugin scripts should be copied to plugins directory
3 // (usually ~/.config/copyq/plugins/).
4
5 // Override popup()
6 popup = function(title, message, time)
7 {
8 if (!time)
9 time = 1000
10 if (!message)
11 message = ""
12 execute("notify-send", "--expire-time=" + time, title, message)
13 }
14
15 function copyq_script() {
16 popup("Script loaded!")
17 return {
18 name: "Test Script",
19 author: function() { return "[email protected]" },
20 description: function() { return "A script for testing" },
21 formatsToSave: ["test1", "test2"],
22
23 copyItem: function(data) {
24 data['copy'] = "copied"
25 return data
26 },
27
28 transformItemData: function(data) {
29 data[mimeText] = "TEST: " + str(data[mimeText])
30 return data;
31 },
32 }
33 }