Skip to content

Instantly share code, notes, and snippets.

@hluk
hluk / CopyQ - URLs.ini
Last active August 20, 2019 05:33
CopyQ - Tab for URLs with Title and Icon
[Command]
Automatic=true
Command="
copyq:
var tabName = '&url'
function lower(data) {
return str(data).toLowerCase()
}
@hluk
hluk / CopyQ - Snippets.ini
Last active August 16, 2023 10:20
CopyQ - Dialog for Pasting Snippets
[Command]
Command="
copyq:
var snippetsTabName = 'Snippets'
function newVarRe(content) {
return new RegExp('\\\\${' + content + '}', 'g')
}
function getText(item) {
@hluk
hluk / CopyQ - Save As.ini
Last active March 18, 2022 14:53
CopyQ - Save Item/Clipboard To a File
[Command]
Command="
copyq:
var suffices = {
'image/svg': 'svg',
'image/png': 'png',
'image/jpeg': 'jpg',
'image/jpg': 'jpg',
'image/bmp': 'bmp',
'text/html': 'html',
@hluk
hluk / CopyQ - Store Copy Time.ini
Last active March 24, 2017 14:34
CopyQ - Store Copy Time
[Command]
Automatic=true
Command="
copyq:
var item = unpack(input())
item['application/x-copyq-time'] = dateString('yyyyMMddhhmmss')
write(0, \"application/x-copyq-item\", pack(item))"
Icon=\xf017
Input=application/x-copyq-item
Name=Store Copy Time
@hluk
hluk / CopyQ - Save Texts on Disk.ini
Last active March 24, 2017 14:34
CopyQ - Save Texts on Disk
[Command]
Name=Save Texts from Tab
Command="
copyq:
function encodeFileName(name)
{
return name.replace(/\\s/g, '_').replace(/\\W/g, '')
}
function addFileNamePart(fileName, item, mime)
@hluk
hluk / CopyQ - Undoable Move to Trash.ini
Last active July 14, 2022 18:01
CopyQ 2.3.0 user commands to move items to trash and undo the removal
[Commands]
1\Name=Move to Trash (Undoable)
1\Command="
copyq:
trash_tab = \"(trash)\"
tab_mime = \"application/x-copyq-user-tab\"
index_mime = \"application/x-copyq-user-index\"
time_mime = \"application/x-copyq-user-time\"
@hluk
hluk / CopyQ - Move Items to Other Tab.ini
Last active August 29, 2015 14:02
CopyQ 2.3.0 user commands to move selected items to next or previous tab
[Commands]
1\Name=Move To Next Tab
1\Command="
copyq:
how = +1
source = selectedtab()
tabs = tab()
i = tabs.indexOf(source)
j = (i + tabs.length + how) % tabs.length
@hluk
hluk / CopyQ - Frequent Items.ini
Last active March 11, 2018 23:48
CopyQ 2.3.0 user commands to add frequent items to special tab and to show frequent items
[Commands]
1\Name=Activate and Add to Frequent
1\Command="
copyq:
tab_name = \"Frequent\"
source = selectedtab()
tab(source)
items = selecteditems()
p = \"application/x-copyq-\"