Skip to content

Instantly share code, notes, and snippets.

Lukas Holecek hluk

Block or report user

Report or block hluk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@hluk
hluk / show_clipboard_owner.ini
Created Aug 3, 2019
CopyQ Command: Show clipboard owner in notification
View show_clipboard_owner.ini
[Command]
Command="
function showOwner() {
popup(
isClipboard() ? 'Clipboard Owner' : 'Selection Owner',
data(mimeWindowTitle)
)
}
var onClipboardChanged_ = onClipboardChanged
@hluk
hluk / replace_selected_with_script.ini
Created Jun 3, 2019
CopyQ Command: Replace selected text with a script
View replace_selected_with_script.ini
[Command]
Command="
copyq:
// path to python script
// (always use forward slash as path separator)
script = 'c:/scripts/modify_text.py'
// get old text from clipboard
var oldText = str(clipboard())
@hluk
hluk / add_blank_line.ini
Last active Jun 2, 2019
CopyQ Command: Add blank line when copied
View add_blank_line.ini
[Command]
Automatic=true
Command="
copyq:
var text = str(data(mimeText))
if (!text)
abort()
text += '\\n\\n'
setData(mimeText, text)
@hluk
hluk / paste_separated.ini
Last active Jun 1, 2019
CopyQ Command: Paste multiple items separated by a blank line
View paste_separated.ini
[Command]
Command="
copyq:
hide()
var items = selectedItemsData()
var text = ''
for (var i in items) {
var itemText = str(items[i][mimeText]).trim()
text += itemText + '\\n\\n'
@hluk
hluk / CopyQ - URLs.ini
Last active Mar 25, 2019
CopyQ - Tab for URLs with Title and Icon
View CopyQ - URLs.ini
[Command]
Automatic=true
Command="
copyq:
var tabName = '&url'
function lower(data) {
return str(data).toLowerCase()
}
@hluk
hluk / move_cursor_to_active_win.py
Created Aug 21, 2018
Move Mouse Cursor to Active Window
View move_cursor_to_active_win.py
#!/usr/bin/env python3
import pyatspi
def on_object_focused(event):
if not event.source.getState().contains(pyatspi.STATE_FOCUSED):
return
print(event)
extents = event.source.get_extents(pyatspi.DESKTOP_COORDS)
@hluk
hluk / CopyQ - Frequent Items.ini
Last active Mar 11, 2018
CopyQ 2.3.0 user commands to add frequent items to special tab and to show frequent items
View CopyQ - Frequent Items.ini
[Commands]
1\Name=Activate and Add to Frequent
1\Command="
copyq:
tab_name = \"Frequent\"
source = selectedtab()
tab(source)
items = selecteditems()
p = \"application/x-copyq-\"
@hluk
hluk / CopyQ - Search All Tabs.ini
Created Nov 19, 2015
CopyQ - Search All Tabs
View CopyQ - Search All Tabs.ini
[Command]
Name=Search All Tabs
Command="
copyq:
// Name for tab for storing matching items.
var search_tab_name = \"Search\"
// Returns true iff item at index matches regex.
function item_matches(item_index, re)
{
View pdc_client.py
class PDCClientWrapper(object):
def __init__(self, client, page_size):
self.client = client
self.page_size = page_size
def __call__(self, *args, **kwargs):
if 'page_size' not in kwargs:
kwargs['page_size'] = self.page_size
return self.client(*args, **kwargs)
@hluk
hluk / CopyQ - Snippets.ini
Last active Mar 24, 2017
CopyQ - Dialog for Pasting Snippets
View CopyQ - Snippets.ini
[Command]
Command="
copyq:
var snippetsTabName = 'Snippets'
function newVarRe(content) {
return new RegExp('\\\\${' + content + '}', 'g')
}
function getText(item) {
You can’t perform that action at this time.