Showing posts with label configs. Show all posts
Showing posts with label configs. Show all posts

Sunday, December 17, 2023

How I like to setup Copyq

settings

theres a lot of things you need to change to make this clipboard manager decent. a majorly annoying thing is when an item is selected in the list IT DOESNT ADD IT TO YOUR CLIPBOARD. the terminal you have to say copyq next, copyq previous (prev doesnt work!) grossly verbose.

enable vi motions (obviously)


enable autostart


disable closed when unfocused (default on is annoying)


preferences: appearances: enable darktheme


in history: set editor to gvim -f %1


max number of items in history i set to 10


layout: disable hide toolbar labels (default is off)


just use rofi

its kind of annoying in 3 ways.

  • you need to type out and remember long terminal commands
  • gui keeps dissapearing
  • even though you select it it doesnt copy

setting up rofi to deal with it instead is wayyyy better.


I have it set to pop up with ctrl period


            
#!/usr/bin/env python3

# https://github.com/albertlauncher/python/blob/master/CopyQ.py

import json
import subprocess as sp

copyq_script_getAll = r"""
var result=[];
for ( var i = 0; i < size(); ++i ) {
    var obj = {};
    obj.row = i;
    obj.mimetypes = str(read("?", i)).split("\n");
    obj.mimetypes.pop();
    obj.text = str(read(i));
    result.push(obj);
}
JSON.stringify(result);
"""


if __name__ == '__main__':
    p = sp.run('copyq -'.split(), input=copyq_script_getAll,
               encoding='utf-8', stdout=sp.PIPE, stderr=sp.PIPE)
    json_arr = json.loads(p.stdout)

    items = []
    for json_obj in json_arr:
        text = json_obj['text']
        text = " ".join(filter(None, text.replace("\n", " ").split(" ")))
        items.append(text)

    title = 'rofi-copyq'
    rofi = f'rofi -dmenu -i -p {title} -format i'.split()
    rofi_input = '\n'.join(x for x in items)

    p = sp.run(rofi, input=rofi_input, encoding='utf-8', stdout=sp.PIPE, stderr=sp.PIPE)
    if p.returncode == 0:
        num = p.stdout.strip()
        sp.run(f'copyq select({num});'.split(),
               encoding='utf-8', stdout=sp.PIPE, stderr=sp.PIPE)
            
        

I put that text in a text file called roficlipq.py


startmenu: settings: keyboard: application shortcuts: python3 pathto roficopyq.py


qr code generation

this is a pretty cool feature


you enable by going to


preferences: shortcuts: application: create qr code from url (requires qrencode)

sudo apt install qrencode

i find this very handy

Tuesday, September 26, 2023

schism tracker bash rc alias

alias schism='schismtracker --video-size=640x480'

Friday, June 23, 2023

primes nvim key-remaps

primagen’s nvim key-maps

Harpoon key-maps

<leader> + a = add
ctrl + e = menu
ctrl + h = 1
ctrl + t = 2
ctrl + n = 3
ctrl + s = 4

Telescope Key-maps

<leader> + pf fuzzy find files
ctrl + p fuzzy find git
<leader> + p s grep search

Vim Fugative Remap

<leader> + gs git status

lsp

ctrl P/ ctrl n next/ prev
ctrl + y accepts
ctrl space starts completion

relative line numbers i dont get them.

  • investigate Join command in vim.
  • ctrl d and u are in the middle in this setup
  • <leader> + p paste delete over selected into “void register”
  • <leader> + y = plus register ( yank to system clipboard)
  • <leader> d in norm/ vis mode delete to void register
  • ctrl + F = tmux switch
  • quick fix list??
  • <leader> + s = replace word your on
  • <leader> + x = chmod +x without having to leave vim