-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathUser_to_KB_mentions_with_checkbox.command.ini
37 lines (35 loc) · 1.26 KB
/
User_to_KB_mentions_with_checkbox.command.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
[Command]
Command="
copyq:
// Copy without changing Linux mouse selection (on Windows you can use \"copy\" instead).
// By https://copyq.readthedocs.io/en/latest/command-examples.html#replace-all-occurrences-in-selected-text
function copy2() {
try {
var x = config('copy_clipboard')
config('copy_clipboard', false)
try {
copy.apply(this, arguments)
} finally {
config('copy_clipboard', x)
}
} catch(e) {
copy.apply(this, arguments)
}
}
copy2()
var text = str(clipboard()).trim()
if (text) {
// text = '[~' + text.replace(/\\s+/g, '_') + ']'
text = '[~' + text.replace(/\\s+/g, '_')
copy2(text)
execute('xte', 'key BackSpace', 'key 0x5b', 'key 0x5d')
paste()
execute('xte', 'usleep 1000000', 'key 0x5d') // Just paste() does not trigger confluence update!
execute('mpv', '/usr/share/sounds/KDE-Im-Cant-Connect.ogg')
copy2('') // Forget temp clipboard
}
"
GlobalShortcut=meta+c
Icon=\xf15b
IsGlobalShortcut=true
Name=User to KB mentions with checkbox (Pavel Alexeev -> [] [~Pavel_Alexeev])