From 00c6530485399634c62a2fb93bf24c7b17a3ec6c Mon Sep 17 00:00:00 2001 From: Anthony Debucquoy Date: Wed, 3 Jan 2024 11:04:20 +0100 Subject: [PATCH] Lot of small changes --- bin/.bin/sshtmux | 2 +- bspwm/.config/bspwm/bspwmrc | 91 ++++++++++++------------ picom/.config/picom/picom.conf | 4 ++ stowed.list | 1 + sxhkd/.config/sxhkd/sxhkdrc | 17 +++-- vim/.vim/UltiSnips/make.snippets | 31 ++++++++ vim/.vim/UltiSnips/markdown_tex.snippets | 35 +++++++++ vim/.vim/UltiSnips/openapi.snippets | 18 +++++ vim/.vimrc | 50 +++++-------- 9 files changed, 166 insertions(+), 83 deletions(-) create mode 100644 vim/.vim/UltiSnips/make.snippets create mode 100644 vim/.vim/UltiSnips/openapi.snippets diff --git a/bin/.bin/sshtmux b/bin/.bin/sshtmux index 47cad92..ae1aa96 100755 --- a/bin/.bin/sshtmux +++ b/bin/.bin/sshtmux @@ -4,7 +4,7 @@ session_name="$(whoami)_sess" if [ ! -z $1 ]; then - ssh -t "$1" "tmux attach -t $session_name || tmux new -s $session_name" + ssh -t "$1" "tmux attach -t $session_name || DISPLAY=:0 tmux new -s $session_name" else echo "Usage: sshtmux HOSTNAME" echo "You must specify a hostname" diff --git a/bspwm/.config/bspwm/bspwmrc b/bspwm/.config/bspwm/bspwmrc index b23b2bd..377b0cd 100755 --- a/bspwm/.config/bspwm/bspwmrc +++ b/bspwm/.config/bspwm/bspwmrc @@ -25,6 +25,8 @@ bspc config remove_unplugged_monitors true ## Honor size hints: do not make windows smaller than they wish to be #bspc config honor_size_hints true +bspc config ignore_ewmh_focus true + ##Color settings bspc config focused_border_color "#1ABB9B" bspc config normal_border_color "#2D2D2D" @@ -49,52 +51,53 @@ bspc config split_ratio 0.52 workspaces_multimonitor & bspc rule -a screenkey --unmanage -bspc rule -a gcolor2 state=floating center=true -bspc rule -a lxappearance state=floating center=true -bspc rule -a gmrun state=floating center=true -bspc rule -a lxterminal state=floating center=true sticky=true -#bspc rule -a urxvt state=floating center=true -bspc rule -a viewnior state=floating center=true -bspc rule -a file-roller state=floating center=true -bspc rule -a floaterm state=floating center=true -bspc rule -a spotify state=pseudo_tiled -#bspc rule -a nautilus state=pseudo_tiled -#bspc rule -a skype state=pseudo_tiled -bspc rule -a file-roller state=pseudo_tiled -bspc rule -a transmission-gtk state=pseudo_tiled -bspc rule -a conky sticky=on manage=off lower=on -bspc rule -a astime sticky=on -bspc rule -a yad state=floating -bspc rule -a Docky layer=above border=off manage=on -bspc rule -a Plank layer=above border=off manage=on -bspc rule -a wbar layer=above -bspc rule -a dockbarx layer=above -bspc rule -a google-chrome-unstable private=on -bspc rule -a google-chrome-stable private=on -bspc rule -a chromium private=on -bspc rule -a firefox private=on -bspc rule -a midori private=on -bspc rule -a gnome-pie border=off manage=off -bspc rule -a wpa_gui state=pseudo_tiled -bspc rule -a libreoffice state=tiled -bspc rule -a '*:libreofficedev' state=tiled -bspc rule -a '*:soffice' state=tiled -#bspc rule -a firefox desktop=I -#bspc rule -a calibre desktop=II -#bspc rule -a geany desktop=II -#bspc rule -a deluge desktop=III -bspc rule -a 9menu border=off manage=off -bspc rule -a tint2 border=off manage=off -#bspc desktop I --layout monocle -#bspc desktop II --layout monocle -bspc rule -a Godot state=pseudo_tiled -bspc rule -a arduino state=pseudo_tiled -bspc rule -a Tk state=pseudo_tiled -bspc rule -a mcedit.py state=floating -bspc rule -a yakuake manage=off layer=above +#bspc rule -a gcolor2 state=floating center=true +#bspc rule -a lxappearance state=floating center=true +#bspc rule -a gmrun state=floating center=true +#bspc rule -a lxterminal state=floating center=true sticky=true +##bspc rule -a urxvt state=floating center=true +#bspc rule -a viewnior state=floating center=true +#bspc rule -a file-roller state=floating center=true +#bspc rule -a floaterm state=floating center=true +#bspc rule -a spotify state=pseudo_tiled +##bspc rule -a nautilus state=pseudo_tiled +##bspc rule -a skype state=pseudo_tiled +#bspc rule -a file-roller state=pseudo_tiled +#bspc rule -a transmission-gtk state=pseudo_tiled +#bspc rule -a conky sticky=on manage=off lower=on +#bspc rule -a astime sticky=on +#bspc rule -a yad state=floating +#bspc rule -a Docky layer=above border=off manage=on +#bspc rule -a Plank layer=above border=off manage=on +#bspc rule -a wbar layer=above +#bspc rule -a dockbarx layer=above +#bspc rule -a google-chrome-unstable private=on +#bspc rule -a google-chrome-stable private=on +#bspc rule -a chromium private=on +#bspc rule -a firefox private=on fullscreen=on +#bspc rule -a midori private=on +#bspc rule -a gnome-pie border=off manage=off +#bspc rule -a wpa_gui state=pseudo_tiled +#bspc rule -a libreoffice state=tiled +#bspc rule -a '*:libreofficedev' state=tiled +#bspc rule -a '*:soffice' state=tiled +##bspc rule -a firefox desktop=I +##bspc rule -a calibre desktop=II +##bspc rule -a geany desktop=II +##bspc rule -a deluge desktop=III +#bspc rule -a 9menu border=off manage=off +#bspc rule -a tint2 border=off manage=off +##bspc desktop I --layout monocle +##bspc desktop II --layout monocle +#bspc rule -a Godot state=pseudo_tiled +#bspc rule -a Tk state=pseudo_tiled +#bspc rule -a mcedit.py state=floating +#bspc rule -a yakuake manage=off layer=above bspc rule -a xsane manage=off layer=above bspc rule -a Zathura state=tiled - +bspc rule -a arduino state=pseudo_tiled +bspc rule -a Spotify desktop=VII follow=off focus=off +bspc rule -a discord desktop=VII follow=off focus=off ## Autogap adjusts windowgap automatically according to the number of ## windows on the desktop. Using it disables negative window gap. diff --git a/picom/.config/picom/picom.conf b/picom/.config/picom/picom.conf index ba70806..fa24dc5 100644 --- a/picom/.config/picom/picom.conf +++ b/picom/.config/picom/picom.conf @@ -1,3 +1,7 @@ active-opacity = 1.0; inactive-opacity = 0.9; +opacity-rule = [ + "100:name ~?= 'YouTube — Mozilla Firefox'", + "100:name ~?= 'Twitch — Mozilla Firefox'" +] diff --git a/stowed.list b/stowed.list index 4337f02..e416c20 100644 --- a/stowed.list +++ b/stowed.list @@ -2,6 +2,7 @@ bin bspwm dmenu feh +git picom polybar sxhkd diff --git a/sxhkd/.config/sxhkd/sxhkdrc b/sxhkd/.config/sxhkd/sxhkdrc index b79d835..d595996 100755 --- a/sxhkd/.config/sxhkd/sxhkdrc +++ b/sxhkd/.config/sxhkd/sxhkdrc @@ -72,16 +72,19 @@ super + ctrl + Return # bspc node -p \~{west,south,north,east} # Presel the desktop for splitting in certain direction -alt + shift + {q,s,z,d} - bspc node @/ -p \~{west,south,north,east} +# tonitch: I don't use that and it's more combersome when it happen +# alt + shift + {q,s,z,d} +# bspc node @/ -p \~{west,south,north,east} -alt + shift + {h,j,k,l} - bspc node @/ -p \~{west,south,north,east} +# alt + shift + {h,j,k,l} +# bspc node @/ -p \~{west,south,north,east} + +# alt + shift + {Left,Down,Up,Right} +# bspc node @/ -p \~{west,south,north,east} -alt + shift + {Left,Down,Up,Right} - bspc node @/ -p \~{west,south,north,east} # Set splitting ratio of windows -alt + ctrl + {1-9} +# alt + ctrl + {1-9} "to work with azerty" +alt + ctrl + {ampersand,eacute,quotedbl,apostrophe,parenleft,minus,egrave,underscore,ccedilla} bspc node -o 0.{1-9} # Move current window to largest space or preselected area if there is one. diff --git a/vim/.vim/UltiSnips/make.snippets b/vim/.vim/UltiSnips/make.snippets new file mode 100644 index 0000000..3474bb2 --- /dev/null +++ b/vim/.vim/UltiSnips/make.snippets @@ -0,0 +1,31 @@ +snippet base "tonitch's makefile base" b + +.PHONY: all clean run +VERSION = 0.0.1 + +LIBS = +CMACRO = -DVERSION=\"$(VERSION)\" + +CC = gcc +CFLAGS = -g -Wall -Wextra -pedantic $(shell pkg-config $(LIBS) --cflags) $(CMACRO) +LDFLAGS = $(shell pkg-config $(LIBS) --libs) + +all: main + +main: main.o + $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) + +%.o: %.c + $(CC) $(CFLAGS) -c -o $@ $< + +clean: + rm -f *.o + rm -f main + +bear: clean + bear -- make + +run: main + ./$< + +endsnippet diff --git a/vim/.vim/UltiSnips/markdown_tex.snippets b/vim/.vim/UltiSnips/markdown_tex.snippets index b1cb475..5ae1854 100644 --- a/vim/.vim/UltiSnips/markdown_tex.snippets +++ b/vim/.vim/UltiSnips/markdown_tex.snippets @@ -62,3 +62,38 @@ priority -1 snippet "(\w+)" "latex default" r \\`!p snip.rv = match.group(1)` $1 endsnippet + +snippet task "Create a task list item" +- [ ] ${1:${VISUAL:item}} +endsnippet + +snippet rest "add a restAPI endpoint" b +#### ${1:${VISUAL:Title}} + +
+ ${2:${VISUAL:GET}} /${3:${VISUAL:Endpoint}} ${4:${VISUAL:Description}} + +##### Parameters + +> | name | type | data type | description | +> |-----------|-----------|-------------------------|-----------------------------------------------------------------------| +> | None | required | object (JSON or YAML) | N/A | + + +##### Responses + +> | http code | content-type | response | +> |---------------|-----------------------------------|---------------------------------------------------------------------| +> | \`200\` | \`text/plain;charset=UTF-8\` | \`Configuration created successfully\` | +> | \`400\` | \`application/json\` | \`{"code":"400","message":"Bad Request"}\` | + +##### Example cURL + +> \`\`\`javascript +> curl -X $2 -H "Content-Type: application/json" http://localhost:8889/$3 +> \`\`\` + +
+ +--------------------------------------------------------------------------------------- +endsnippet diff --git a/vim/.vim/UltiSnips/openapi.snippets b/vim/.vim/UltiSnips/openapi.snippets new file mode 100644 index 0000000..5d2f5c1 --- /dev/null +++ b/vim/.vim/UltiSnips/openapi.snippets @@ -0,0 +1,18 @@ +snippet base "Base" b +openapi: 3.0.0 +info: + title: ${1:${VISUAL:Title}} + description: ${2:${VISUAL:Title}} + version: 0.0.1 + +servers: + - url: ${3:${VISUAL:https://example.com/api}} + description: ${4:${VISUAL:default api point for the service}} + +$0 +endsnippet + +snippet desc "Description" b +description: ${1:${VISUAL:Description}} +endsnippet + diff --git a/vim/.vimrc b/vim/.vimrc index bb31edc..d4622d8 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -1,8 +1,3 @@ -autocmd Filetype python noremap :vert term python -i % -autocmd Filetype python noremap :vert term python % - -autocmd Filetype tex noremap :silent !pdflatex % && mupdf %:r.pdf& - autocmd FileType asm noremap :execute 'silent !qtspim' expand('%::p') nnoremap :GFiles @@ -18,6 +13,8 @@ let g:pymode_python = 'python3' let g:pymode_options_max_line_length = 120 " let g:ctrlp_cmd = 'CtrlPTag' let g:htmljinja_disable_detection = 1 + +let g:vimtex_view_method = 'zathura' let g:vimtex_grammar_vlty = {'lt_command': 'languagetool'} let g:vimtex_grammar_textidote = {'jar': '/usr/share/java/textidote.jar'} @@ -26,10 +23,6 @@ let g:vimtex_view_method = 'zathura' " nnoremap (YCMFindSymbolInDirectory) " nnoremap (YCMFindSymbolInWorkspace) -function ManPage(expr) - execute 'silent vert term' &keywordprg a:expr -endfunction - nnoremap gd :YcmCompleter GoToDefinition nnoremap gr :YcmCompleter GoToReferences nnoremap K :YcmCompleter GetDoc @@ -40,11 +33,9 @@ nnoremap :Make nnoremap :Make run "Documentation -"nnoremap K :execute 'Man' expand('') nnoremap K :execute 'vert term' &keywordprg '' command Curl :execute 'vert term lynx -dump' escape(@+, '#') command OpenLink :silent w !urlscan -command -nargs=? Man call fzf#run(fzf#wrap({'source': 'whatis ' . shellescape() . '| sed -r "s/(^\w*)\s\((.*)\).*/\2 \1/"', 'sink': function('ManPage') , 'options': ['--preview', 'MANPAGER=cat MANWIDTH='. (&columns/2-4) .' man {1} {2}']})) " AgIn: Start ag in the specified directory " @@ -85,27 +76,28 @@ let g:ycm_language_server = [ nnoremap za syntax on -set nu -set rnu -set hls -set tabstop=4 -set shiftwidth=4 -set encoding=utf-8 -set nocompatible -set ignorecase -set nowrap -set splitbelow splitright -set spelllang+=fr -set foldmethod=syntax -set foldlevel=99 -set incsearch set autochdir -" set foldcolumn=1 set clipboard^=unnamed,unnamedplus -set listchars=eol:$,tab:>-,trail:~,extends:>,precedes:<,space:· set concealcursor= set conceallevel=2 +set encoding=utf-8 +" set foldcolumn=1 +set foldlevel=99 +set foldmethod=syntax +set hls +set ignorecase +set incsearch +set listchars=eol:$,tab:>-,trail:~,extends:>,precedes:<,space:· set mouse=a +set nocompatible +set nowrap +set nu +set rnu +set shiftwidth=4 +set showcmd +set spelllang+=fr +set splitbelow splitright +set tabstop=4 color desert hi Normal ctermfg=None ctermbg=None @@ -182,10 +174,6 @@ Plugin 'tikhomirov/vim-glsl' "c sharp " Plugin 'OmniSharp/omnisharp-vim' -"java - -Plugin 'hdiniz/vim-gradle' - "latex Plugin 'lervag/vimtex'