CopyQ icon indicating copy to clipboard operation
CopyQ copied to clipboard

Shortcut for changing tab by (fuzzy-)search

Open sl5net opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe.

solution i like

best

idea 1:

usa a tab called tabs that include all tab-names.

idea 2:

could change tabs by using a search-window.

default search value should the title of the window its coming from.

already working use arrow keys (left/right):

if i call copyQ with a shortcut for tab choosing

from a Tilix Terminal emulater Tilix: xy@xy: ~/symfony

value in the copyQ Tab-Search should be

Tilix: xy@xy: ~/symfony

then i manually cut off Tilix: xy@xy: ~/ and find my

symfony - Tab. helps me to enter symfony console commands.

how i was easy to understand :) ty for this great powerful tool ! BTW this solution remembers my to my git-repo github.com/sl5net/global-IntelliSense-everywhere

easiest

already working very good left/right keys

sl5net avatar Jul 16 '21 10:07 sl5net

idea for workaround:

doku:

  1. copyq tab > tabs.txt
  2. https://stackoverflow.com/questions/68411792/insert-sting-before-and-behind-using-sed

prototype:

$ > ./tabs.sh ; copyq tab > tabs.sh ; sed -i 's/.*/copyq tab pana3 add "&"/' tabs.sh ; ./tabs.sh

problem of this protoype. it's produce lots double items

sl5net avatar Jul 16 '21 15:07 sl5net

Good idea. Fuzzy-searching tabs would be nice.

I like the idea 1 with a slight modification: the tab list would open in a separate CopyQ session/app-instance.

Here is a command that opens the tab list with a shortcut (here is how to add the command to CopyQ):

[Command]
Command="
    copyq:
    function tabsSession() {
        execute(
            'copyq', '-s', 'tabs', '--start-server',
            'tab', 'Tabs', ...arguments
        )
    }

    var cmd = `
        config(
            'check_clipboard', false,
            'check_selection', false,
            'copy_clipboard', false,
            'copy_selection', false,
            'disable_tray', true,
            'hide_tabs', true,
            'hide_toolbar', true,
            'hide_main_window', true,
        );
        removeTab('Tabs')
        setCommands([{
            name: 'Show Tab',
            inMenu: true,
            hideWindow: true,
            shortcuts: ['Enter', 'Return'],
            cmd: 'copyq -s \"%SESSION%\" show %1'
        }]);
    `;
    var session = str(env('COPYQ_SESSION_NAME'));
    cmd = cmd.replace('%SESSION%', session);
    tabsSession(cmd);
    tabsSession('add', ...tab().reverse())
    tabsSession('show', 'Tabs')"
Icon=\xf022
InMenu=true
Name=Tab Switcher
Shortcut=alt+f1

For the command to work properly, you will need most recent version of CopyQ (v4.1.0).

hluk avatar Jul 24 '21 08:07 hluk