dgy
/
hexagons
Archived
1
0
Fork 0

Hice un re quilombo parte 2

Modularize zsh basado en un config que vi por ahi y me gusto. Sigue
siendo todo lo mismo pero organizado diferente. Lo bueno es que funciona
igual que antes. Pude integrar de manera satisfactoria el script de
creacion de sesiones de tmux asi que eso me ayudo a reducir un par de
scripts y shortcuts de teclado.\
De paso estoy probando un prompt distinto a ver si me gusta como
funciona.

Hablando de cosas que estoy probando a ver si me gustan, cambie de wm y
voy a tratar de usarlo un par de semanas a ver que onda.

Sigo afilando el hacha en neovim. Mas que nada lo que hice fue retocar
algunas de las configs nuevas.

Rehice los scripts de multimonitor, y un par de cambios menores aqui y
alla en otras configs.

Ah, y ahora hay un readme para la carpeta de scripts.
This commit is contained in:
DeadGit 2020-09-25 14:25:56 -03:00
parent 6bbc6d0d9d
commit e8cb8f17f7
No known key found for this signature in database
GPG Key ID: 9EAFB27F820FF83C
42 changed files with 610 additions and 309 deletions

View File

@ -1,12 +1,23 @@
#!/bin/sh
dpi &
setxkbmap -option caps:escape
xsetroot -cursor_name left_ptr &
xcompmgr &
equiset &
xcompmgr &
monis &
dpi &
mpd &
randbg &
xss-lock -l -- exeflock4 &
case ${1} in
(k)
nhkd &
katriawm
;;
(*)
sxhkd &
bspwm
;;
esac
exec runsvdir -P ~/.local/service.x 'log: ...........................................................................................................................................................................................................................................................................................................................................................................................................'

View File

@ -4,10 +4,10 @@ window:
lines: 25
padding:
x: 20
y: 10
x: 15
y: 6
decorations: none
# decorations: none
dynamic_title: true

View File

@ -2,19 +2,19 @@
bspc rule -r "*"
monis &
bspmonis &
bspc config border_width 1
bspc config border_width 1
bspc config window_gap 6
bspc config top_padding 0
bspc config top_padding 10
bspc config left_padding 0
bspc config right_padding 0
bspc config bottom_padding 0
bspc config split_ratio 0.50
bspc config bottom_padding 10
bspc config split_ratio 0.5
# Opciones
bspc config gapless_monocle true
bspc config single_monocle true
bspc config single_monocle false
bspc config ignore_ewmh_focus true
bspc config pointer_follows_focus true
bspc config removal_adjustment true
@ -46,14 +46,7 @@ bspc config presel_feedback_color "$(get_xrdb color6)"
bspc rule -a Catia state=floating
bspc rule -a Cadence state=floating
bspc rule -a mpv state=floating
bspc rule -a Alacritty:flota state=floating
bspc rule -a Sxiv:fontpreview state=floating
bspc rule -a Toplevel state=floating
bspc rule -a Firefox state=floating
bspc rule -a Display state=floating
# Otros
bspc rule -a Alacritty:flota state=floating
bspc rule -a Sxiv:fontpreview state=floating
bspc rule -a Zathura state=tiled
bspc rule -a Alacritty:multi desktop='^1'
stx &
bspc rule -a Alacritty:multi desktop='^1'

View File

@ -22,6 +22,13 @@
<family>Noto Color Emoji</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>NotoSansMono Nerd Font</family>
<family>Noto Color Emoji</family>
</prefer>
</alias>
<!-- smaller than 9px -->
<match target="font">

View File

@ -271,7 +271,7 @@ map D %mv -i $fs .
map za $apack "$f".zip $f
map zu $file-roller "$f"
map zx $atool --each --extract "$f"
map zg $hx add "$f"
map zg $hx add $fs
map zn newfold
map i push A<c-a> # at the very beginning
@ -291,6 +291,8 @@ map gE cd /etc
map gU cd /usr
map ge cd ~/etc
map g. cd ~/.config
map gn cd ~/.config/nvim
map gz cd ~/.config/zsh
map gl cd ~/.local/share
map gM cd /media
map gm cd ~/snd/Albums

View File

@ -3,6 +3,9 @@ setlocal signcolumn=no textwidth=80 wrap sw=2
setlocal tabstop=2 expandtab softtabstop=2 linebreak
setlocal autoindent noruler colorcolumn=80 synmaxcol=0
setlocal spell spelllang=es,en_us,cjk
setlocal formatoptions&
setlocal formatoptions+=tqn
setlocal formatlistpat=^\\s*\\(\\d\\+\\\|[a-z]\\)[\\].)]\\s*
set complete+=kspell
" Spellcheck

View File

@ -1,10 +1,10 @@
setlocal shiftwidth=4 tabstop=4 softtabstop=4 expandtab
setlocal shiftwidth=2 tabstop=2 softtabstop=2 expandtab
if !exists("b:sh_indent_options")
let b:sh_indent_options = {}
endif
let b:sh_indent_options['continuation-line'] = 4
let b:sh_indent_options['continuation-line'] = 2
let b:ale_linters = ['shellcheck']
let b:ale_fixers = ['shfmt']

View File

@ -31,11 +31,11 @@ endfunction
function! dead#colores#Barra() abort
highlight User1 ctermfg=251 ctermbg=NONE guibg=NONE guifg=#666666 cterm=none
highlight User2 ctermfg=234 ctermbg=NONE guibg=NONE guifg=#f74782 cterm=none
highlight User3 ctermfg=234 ctermbg=4 guibg=NONE guifg=#008bb4 cterm=none
highlight User4 ctermfg=234 ctermbg=251 guibg=NONE guifg=#c6c6c6 cterm=none
highlight User5 ctermfg=234 ctermbg=4 guibg=NONE guifg=#e64eff cterm=none
highlight User6 ctermfg=234 ctermbg=9 guibg=NONE guifg=#fbad34 cterm=none
highlight User7 ctermfg=234 ctermbg=251 guibg=NONE guifg=#407e4a cterm=none
highlight User2 ctermfg=234 ctermbg=NONE guibg=NONE guifg=#f74782 cterm=none gui=bold
highlight User3 ctermfg=234 ctermbg=4 guibg=NONE guifg=#008bb4 cterm=none gui=bold
highlight User4 ctermfg=234 ctermbg=251 guibg=NONE guifg=#c6c6c6 cterm=none gui=bold
highlight User5 ctermfg=234 ctermbg=4 guibg=NONE guifg=#e64eff cterm=none gui=bold
highlight User6 ctermfg=234 ctermbg=9 guibg=NONE guifg=#fbad34 cterm=none gui=bold
highlight User7 ctermfg=234 ctermbg=251 guibg=NONE guifg=#407e4a cterm=none gui=bold
highlight User8 ctermfg=NONE ctermbg=NONE guibg=NONE guifg=NONE cterm=NONE
endfunction

View File

@ -13,9 +13,7 @@ function! dead#statusline#StatusLine() abort
let l:statusline.='%#User1#'
let l:statusline.=dead#statusline#LinePasteMode()
let l:statusline.='%= '
let l:statusline.=dead#statusline#GitStatus()
let l:statusline.='%#User7#'
let l:statusline.=' %l:%c '
let l:statusline.=' %p%% %l:%c '
let l:statusline.=dead#statusline#ModeColor()
let l:statusline.=dead#statusline#CurrentMode()
return l:statusline
@ -31,7 +29,6 @@ endfunction
function! dead#statusline#HelpStatusLine() abort
let l:statusline=''
let l:statusline.='%#User4#'
let l:statusline.='%= '
let l:statusline.='%h'
return l:statusline

View File

@ -1,6 +1,5 @@
" Externals {{{
let g:loaded_python_provider=1 " Disable python 2 interface
let g:python_host_skip_check=1 " Skip python 2 host check
let g:loaded_python_provider=1 " Disable python 2 interface
let g:python_host_skip_check=1 " Skip python 2 host check
if filereadable('bin/python3')
let g:python3_host_prog = '/bin/python3'
endif
@ -12,90 +11,7 @@ endif
set runtimepath+=/usr/share/vim/vimfiles/
let mapleader="\<SPACE>"
let maplocalleader=','
" }}}
" {{{ Ale
let g:ale_lint_delay = 0
let g:ale_disable_lsp = 1
let g:ale_fix_on_save = 1
let g:ale_linters_explicit = 1
let g:ale_use_global_executables = 1
let g:ale_close_preview_on_insert = 1
let g:ale_sign_highlight_linenrs = 1
let g:ale_echo_cursor = 0
let g:ale_virtualtext_cursor = 1
let g:ale_set_highlights = 1
let g:ale_set_signs = 1
let g:ale_javascript_eslint_suppress_missing_config = 1
let g:ale_sign_error = ''
let g:ale_sign_warning = ''
let g:ale_sign_info = '●'
let g:ale_loclist_msg_format = '[%linter%] %s% (code)% [%severity%]'
let g:ale_linter_aliases = { 'jsx': ['css', 'javascript'] }
let g:ale_fixers = { '*': ['remove_trailing_lines', 'trim_whitespace'] }
let g:ale_pattern_options = {
\ '\.min\.js$': {'ale_linters': [], 'ale_fixers': []},
\ '\.min\.css$': {'ale_linters': [], 'ale_fixers': []},
\}
nmap <silent> <F7> <Plug>(ale_previous_wrap)
nmap <silent> <F8> <Plug>(ale_next_wrap)
" }}}
" CoC {{{
let g:coc_global_extensions = ['coc-highlight', 'coc-snippets', 'coc-tsserver', 'coc-css', 'coc-html', 'coc-json', 'coc-emmet']
" Config
nnoremap <silent><F6> :vsplit<CR><Bar>:CocConfig<CR>
inoremap <silent><expr> <TAB>
\ pumvisible() ? coc#_select_confirm() :
\ coc#expandableOrJumpable() ? "\<C-r>=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\<CR>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ coc#refresh()
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
let g:coc_snippet_next = '<TAB>'
let g:coc_snippet_prev = '<S-TAB>'
" <CR> to confirm completion
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<CR>"
" Use <c-space> to trigger completion.
inoremap <silent><expr> <c-space> coc#refresh()
" GoTo code navigation.
nnoremap <silent> gd <Plug>(coc-definition)
nnoremap <silent> gr <Plug>(coc-references)
" Use D to show documentation in preview window.
nnoremap <silent> D :call <SID>show_documentation()<CR>
function! s:show_documentation()
if (index(['vim','help'], &filetype) >= 0)
execute 'h '.expand('<cword>')
else
call CocAction('doHover')
endif
endfunction
" Symbol renaming.
nnoremap <leader>rn <Plug>(coc-rename)
"}}}
"{{{ Polyglot
let g:vim_markdown_toc_autofit = 1
let g:markdown_fenced_languages = ['vim', 'help']
let g:javascript_plugin_jsdoc = 1
"}}}
" Plugins {{{
packadd! pear-tree
packadd! loupe
packadd! vim-commentary
packadd! fzf.vim
packadd! fern.vim
packadd! gina.vim
" }}}
" Colors {{{
set termguicolors
aug colores
au!
@ -108,5 +24,10 @@ let g:srcery_italic = 1
let g:srcery_underline = 1
let g:srcery_undercurl = 1
colorscheme srcery
" }}}
" vim:foldmethod=marker:foldlevel=0
packadd! pear-tree
packadd! loupe
packadd! vim-commentary
packadd! fzf.vim
packadd! fern.vim
packadd! gina.vim

View File

@ -0,0 +1,24 @@
let g:ale_lint_delay = 0
let g:ale_disable_lsp = 1
let g:ale_fix_on_save = 1
let g:ale_linters_explicit = 1
let g:ale_use_global_executables = 1
let g:ale_close_preview_on_insert = 1
let g:ale_sign_highlight_linenrs = 1
let g:ale_echo_cursor = 0
let g:ale_virtualtext_cursor = 1
let g:ale_set_highlights = 1
let g:ale_set_signs = 1
let g:ale_javascript_eslint_suppress_missing_config = 1
let g:ale_sign_error = '𝐗'
let g:ale_sign_warning = '⚠'
let g:ale_sign_info = '●'
let g:ale_loclist_msg_format = '[%linter%] %s% (code)% [%severity%]'
let g:ale_linter_aliases = { 'jsx': ['css', 'javascript'] }
let g:ale_fixers = { '*': ['remove_trailing_lines', 'trim_whitespace'] }
let g:ale_pattern_options = {
\ '\.min\.js$': {'ale_linters': [], 'ale_fixers': []},
\ '\.min\.css$': {'ale_linters': [], 'ale_fixers': []},
\}
nmap <silent> <F7> <Plug>(ale_previous_wrap)
nmap <silent> <F8> <Plug>(ale_next_wrap)

View File

@ -0,0 +1,46 @@
let g:coc_global_extensions = ['coc-highlight', 'coc-snippets', 'coc-tsserver', 'coc-css', 'coc-html', 'coc-json', 'coc-emmet']
" Config
nnoremap <silent><F6> :vsplit<CR><Bar>:CocConfig<CR>
let g:coc_snippet_next = '<TAB>'
let g:coc_snippet_prev = '<S-TAB>'
inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" :
\ coc#expandableOrJumpable() ?
\ "\<C-r>=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\<CR>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ coc#refresh()
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
inoremap <silent><expr> <C-space> coc#refresh()
if exists('*complete_info')
inoremap <expr> <cr> complete_info()["selected"] != "-1" ? "\<C-y>" : "\<C-g>u\<CR>"
else
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
endif
" GoTo code navigation.
nnoremap <silent> gd <Plug>(coc-definition)
nnoremap <silent> gr <Plug>(coc-references)
" Use D to show documentation in preview window.
nnoremap <silent> D :call <SID>show_documentation()<CR>
function! s:show_documentation()
if (index(['vim','help'], &filetype) >= 0)
execute 'h '.expand('<cword>')
else
call CocAction('doHover')
endif
endfunction
" Symbol renaming.
nnoremap <leader>rn <Plug>(coc-rename)

View File

@ -1,6 +1,4 @@
let g:gitgutter_highlight_lines = 1
let g:gitgutter_highlight_linenrs = 1
let g:gitgutter_set_sign_backgrounds = 1
let g:gitgutter_sign_allow_clobber = 0
let g:gitgutter_map_keys = 0
let g:gitgutter_grep = 'rg --color=never'

View File

@ -1,4 +1,4 @@
nnoremap <silent> <F5> :Fern . -reveal=% -drawer -toggle -width=20<CR>
nnoremap <silent> <F5> :Fern . -reveal=% -drawer -toggle<CR>
function! s:init_fern() abort
setlocal nonumber norelativenumber

View File

@ -1,3 +1,4 @@
nmap <leader>tt :GitGutterLineHighlightsToggle<CR>
nmap ghp <Plug>(GitGutterPreviewHunk)
nmap ghu <Plug>(GitGutterUndoHunk)
nmap ghs <Plug>(GitGutterStageHunk)

View File

@ -35,7 +35,8 @@ nnoremap <M-h> <C-W><C-H>
" Gotta Go Fast (save, buffers, quit, messages, newlines, SOF, EOF)
nnoremap <silent> <leader>g :w!<CR>
nnoremap <silent> <leader>b :noautocmd :ls<CR>:b<space>
nnoremap <silent> <leader>b :ls<CR>:b<space>
nnoremap <silent> <leader>c :close<CR>
nnoremap <silent> <leader>q :q!<CR>
nnoremap <silent> <leader>Q :qa!<CR>
nnoremap <silent> <leader>m :messages<CR>

View File

@ -0,0 +1,3 @@
let g:vim_markdown_toc_autofit = 1
let g:markdown_fenced_languages = ['vim', 'help']
let g:javascript_plugin_jsdoc = 1

View File

@ -28,7 +28,7 @@ set foldclose=all
set foldlevelstart=10
set selectmode=key
set keymodel=startsel
set signcolumn=yes
set signcolumn=yes:2
set tabstop=2
set shiftwidth=2
set softtabstop=2

View File

@ -1,4 +1,7 @@
# BSPWM Hotkeys
ctrl + alt + r
bspc wm -r
super + {_,shift} + w
bspc node -{c,k}
@ -39,17 +42,17 @@ super + {_,shift,ctrl} + u
bspc node {@/ -B,@brother -B,@/ -E}
# Run Applications
super + {b,q,m,s,n,p,t,g,r,d,i}
{$BROWSER,powermenu,monis,vent,escribir,pom,tv,grabar,ref,leer,wifimenu}
super + {b,q,s,n,p,t,r,d,i}
{$BROWSER,powermenu,vent,escribir,pom,tv,ref,leer,wpadd}
super + shift + {x,m,g}
{tmenux,unimon,corte}
super + {_,shift,ctrl} + m
{monis,unimon,espejo}
super + ctrl + m
espejo
super + {_,shift} + g
{grabar,corte}
super + {a,x,v,z}
$TERMINAL {_,--class=flota,--class=flota -e pulsemixer,--class=multi -e termux}
super + {z,x,v}
$TERMINAL {_,--class=flota,--class=flota -e pulsemixer}
super + space
j4-dmenu-desktop --dmenu="dmenu -i -w 250 -p ' ' " --no-generic
@ -57,11 +60,8 @@ super + space
super + {F1,F2,F3}
{fecha,tapa,notifocus}
ctrl + alt + x
xkill
ctrl + alt + l
xset s activate
ctrl + alt + {x,l}
{xkill,xset s activate}
Print
pantallazo

View File

@ -4,7 +4,7 @@ set -as terminal-overrides ',alacritty:Tc'
set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' # undercurl support
set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' # underscore colours - needs tmux-3.0
# set -g set-titles-string "#S > #{pane_current_command} (#{=-15:?window_name,#{window_name},#{s/deadguy/home/:?pane_current_path,#{b:pane_current_path},}})"
set -g set-titles-string "#S > #T (#{=-15:?window_name,#{window_name},#{s/deadguy/home/:?pane_current_path,#{b:pane_current_path},}})"
set -g set-titles-string "#S > #{=-15:?window_name,#{window_name},#{s/deadguy/home/:?pane_current_path,#{b:pane_current_path},}} (#T)"
set -g mode-keys vi
set -g history-limit 102400
set -sg escape-time 0
@ -113,6 +113,6 @@ bind-key & set-option -g status
# Mejor soporte para mouse
set -g @prevent-scroll-for-fullscreen-alternate-buffer 'on'
set -g @scroll-speed-num-lines-per-scroll '3'
run-shell ~/.local/bin/tmux-better-mouse-mode/scroll_copy_mode.tmux
run-shell ~/.local/apps/tmux-better-mouse-mode/scroll_copy_mode.tmux
# vim: set ft=tmux:

View File

@ -1 +0,0 @@
[ -z $DISPLAY ] && [ "$(fgconsole)" -eq 1 ] && exec startx "$XDG_CONFIG_HOME/X11/xinitrc" -- -keeptty -nolisten tcp

View File

@ -1,6 +1,5 @@
# -*- mode: shell-script -*-
# vim:ft=zsh
# Opciones principales {{{
autoload -Uz bracketed-paste-url-magic
zle -N bracketed-paste bracketed-paste-url-magic
@ -25,25 +24,9 @@ setopt CDABLE_VARS # Change directory to a path stored in a variable.
setopt MULTIOS # Write to multiple descriptors.
setopt AUTO_PARAM_SLASH # Tab completing directory appends a slash
setopt PROMPT_SUBST
# }}}
# Historial {{{
export HISTIGNORE="ls:cd:cd -:pwd:exit:date:* --help:* --version:* -v:* -h:man *:up"
HISTFILE="$ZDOTDIR/histfile"
HISTSIZE=10000
SAVEHIST=10000
setopt BANG_HIST # Treat the '!' character specially during expansion.
setopt EXTENDED_HISTORY # Write the history file in the ':start:elapsed;command' format.
setopt SHARE_HISTORY # Share history between all sessions.
setopt HIST_EXPIRE_DUPS_FIRST # Expire a duplicate event first when trimming history.
setopt HIST_IGNORE_DUPS # Do not record an event that was just recorded again.
setopt HIST_IGNORE_ALL_DUPS # Delete an old recorded event if a new event is a duplicate.
setopt HIST_FIND_NO_DUPS # Do not display a previously found event.
setopt HIST_IGNORE_SPACE # Do not record an event starting with a space.
setopt HIST_SAVE_NO_DUPS # Do not write a duplicate event to the history file.
setopt HIST_VERIFY # Do not execute immediately upon history expansion.
setopt HIST_BEEP # Beep when accessing non-existent history.
# }}}
# Plugins y extras {{{
hash tmux 2>/dev/null && source "${ZDOTDIR}"/tmux.zsh
foreach programa (
doc/fzf/completion.zsh
doc/fzf/key-bindings.zsh
@ -52,60 +35,8 @@ foreach programa (
source /usr/share/$programa
}
foreach extra (
lf-icons.zsh
up.plugin.zsh
zsh-autopair/autopair.plugin.zsh
zsh-system-clipboard/zsh-system-clipboard.plugin.zsh
git-extras-completion.zsh
autocompletar.zsh
aliases.zsh
zmarks.zsh
zsh-history-substring-search/zsh-history-substring-search.plugin.zsh
teclas.zsh
) {
source $ZDOTDIR/$extra
}
HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE=1
typeset -g ZSH_SYSTEM_CLIPBOARD_TMUX_SUPPORT='true'
for f in "${ZDOTDIR}"/conf/*; do
source "${f}"
done
source $XDG_DATA_HOME/lscolors.sh
# }}}
# Prompt {{{
function precmd() {
if [ -z "$NEW_LINE_BEFORE_PROMPT" ]; then
NEW_LINE_BEFORE_PROMPT=1
elif [ "$NEW_LINE_BEFORE_PROMPT" -eq 1 ]; then
echo "\n"
fi
}
function () {
if [[ $EUID == 0 ]]; then
local SUFFIX=' %F{yellow}%n%f:'
else
local SUFFIX=$(printf ':')
fi
export PS1="%(?..%{%F{red}%}(%?%)%{%f%} )%F{green}${SSH_TTY:+[%n@%m]}%f%B${SSH_TTY:+:}%b%F{blue}%B%2~%b%f%B${SUFFIX}%b "
}
export SPROMPT="zsh: correct %F{red}'%R'%f to %F{green}'%r'%f [%B%Uy%u%bes, %B%Un%u%bo, %B%Ue%u%bdit, %B%Ua%u%bbort]? "
function zle-keymap-select {
if [[ ${KEYMAP} == vicmd ]] ||
[[ $1 = 'block' ]]; then
echo -ne '\e[2 q'
elif [[ ${KEYMAP} == main ]] ||
[[ ${KEYMAP} == viins ]] ||
[[ ${KEYMAP} = '' ]] ||
[[ $1 = 'beam' ]]; then
echo -ne '\e[6 q'
fi
}
zle -N zle-keymap-select
zle-line-init() {
echo -ne "\e[6 q"
}
zle -N zle-line-init
echo -ne '\e[5 q'
preexec() { echo -ne '\e[6 q' ;}
# }}}
# vim:foldmethod=marker:foldlevel=0

View File

@ -0,0 +1,70 @@
# Set PS1 and RPS1
precmd() {
local cwd git_branch git_toplvl suffix newline
# -- Add a line before the prompt
[[ -v PS1_NL ]] && echo || PS1_NL=
newline=$'\n'
# -- PS1 (in precmd, avoid tools updating PS1)
if [[ $EUID == 0 ]]; then
suffix='%(?,%F{yellow},%F{red})%n%f:'
else
suffix='%(?,%F{yellow},%F{red})>%f'
fi
if [[ -n $SSH_CONNECTION ]]; then
PS1="%F{231}${SSH_TTY:+[%n@%m]}%f%B${SSH_TTY:+:}${newline}${suffix}%b "
else
PS1="%B${suffix}%b "
fi
# -- RPS1
# Error code if != 0
RPS1='%B%(?..%{%F{red}%}(%?%)%{%f%}) '
# if in git repo, print <branch>·<name>/<path>
if git_branch="$( git rev-parse --abbrev-ref HEAD 2>/dev/null )"; then
[[ -z "$(git status --porcelain 2>/dev/null)" ]] \
&& RPS1+="%F{green}${git_branch}%F{231} " \
|| RPS1+="%F{166}${git_branch}%F{231} "
git_toplvl="$( git rev-parse --show-toplevel 2>/dev/null )"
cwd="${${PWD##${git_toplvl}}:-/}"
RPS1+="%F{240}[%F{12}${git_toplvl##*/}%F{240}]%f%b"
else
RPS1+='%F{12}%2~%f%b'
fi
}
export SPROMPT="zsh: correct %F{red}'%R'%f to %F{green}'%r'%f [%B%Uy%u%bes, %B%Un%u%bo, %B%Ue%u%bdit, %B%Ua%u%bbort]? "
function zle-keymap-select {
if [[ ${KEYMAP} == vicmd ]] ||
[[ $1 = 'block' ]]; then
echo -ne '\e[2 q'
elif [[ ${KEYMAP} == main ]] ||
[[ ${KEYMAP} == viins ]] ||
[[ ${KEYMAP} = '' ]] ||
[[ $1 = 'beam' ]]; then
echo -ne '\e[6 q'
fi
}
zle -N zle-keymap-select
zle-line-init() {
echo -ne "\e[6 q"
}
zle -N zle-line-init
echo -ne '\e[5 q'
preexec() { echo -ne '\e[6 q' ;}
# (Un)set (r)prompts
PS2='%F{245}> %f'
PS3='%F{245}> %f'
PS4='%F{245}> %f'
unset RPS2 RPS3 RPS4
# Clear previous rprompts
setopt TRANSIENT_RPROMPT

View File

@ -73,7 +73,7 @@ if (( ${+terminfo[smkx]} && ${+terminfo[rmkx]} )); then
add-zle-hook-widget -Uz zle-line-finish zle_application_mode_stop
fi
bindkey -M viins '^K' up-history # ^K to previous command.
bindkey -M viins '^K' up-history # ^K to previous command.
bindkey -M viins '^J' down-history # ^J to next command.
bindkey -M viins '^F' vi-forward-char # Go forward char or complete current completion.
bindkey -M viins '^B' backward-kill-word # Delete a WORD backward.
@ -84,24 +84,24 @@ bindkey -M viins '^U' history-incremental-pattern-search-backward
bindkey -M viins '^[[A' history-substring-search-up
bindkey -M viins '^[[B' history-substring-search-down
bindkey -M viins '^E' edit-command-line
bindkey '^L' tmux-clear-screen
bindkey '^X' run-with-sudo
bindkey '^L' tmux-clear-screen
bindkey '^X' run-with-sudo
# }}}
# Normal {{{
bindkey -M vicmd 'j' down-line # Override down-line-or-history.
bindkey -M vicmd 'k' up-line # Override up-line-or-history.
bindkey -M vicmd '^K' up-history # ^K to previous command.
bindkey -M vicmd '^J' down-history # ^J to next command.
bindkey -M vicmd 'H' vi-beginning-of-line # Go beginning of line.
bindkey -M vicmd 'L' vi-end-of-line # Go end of line.
bindkey -M vicmd 'cs' change-surround # Change surround operator.
bindkey -M vicmd 'ds' delete-surround # Delete surround operator.
bindkey -M vicmd 'ys' add-surround # Add surround operator.
bindkey -M vicmd 'j' down-line # Override down-line-or-history.
bindkey -M vicmd 'k' up-line # Override up-line-or-history.
bindkey -M vicmd '^K' up-history # ^K to previous command.
bindkey -M vicmd '^J' down-history # ^J to next command.
bindkey -M vicmd 'H' vi-beginning-of-line # Go beginning of line.
bindkey -M vicmd 'L' vi-end-of-line # Go end of line.
bindkey -M vicmd 'cs' change-surround # Change surround operator.
bindkey -M vicmd 'ds' delete-surround # Delete surround operator.
bindkey -M vicmd 'ys' add-surround # Add surround operator.
bindkey -M vicmd '?' history-incremental-search-backward
bindkey -M vicmd '/' history-incremental-search-forward
bindkey -M vicmd '^[[A' history-substring-search-up
bindkey -M vicmd '^[[B' history-substring-search-down
bindkey -M vicmd '^Y' redo
bindkey -M vicmd '^Y' redo
# }}}
# Visual {{{
bindkey -M visual 'H' vi-beginning-of-line # Go beginning of line.

View File

@ -0,0 +1,15 @@
export HISTIGNORE="ls:cd:cd -:pwd:exit:date:* --help:* --version:* -v:* -h:man *:up"
HISTFILE="$ZDOTDIR/histfile"
HISTSIZE=10000
SAVEHIST=10000
setopt BANG_HIST # Treat the '!' character specially during expansion.
setopt EXTENDED_HISTORY # Write the history file in the ':start:elapsed;command' format.
setopt SHARE_HISTORY # Share history between all sessions.
setopt HIST_EXPIRE_DUPS_FIRST # Expire a duplicate event first when trimming history.
setopt HIST_IGNORE_DUPS # Do not record an event that was just recorded again.
setopt HIST_IGNORE_ALL_DUPS # Delete an old recorded event if a new event is a duplicate.
setopt HIST_FIND_NO_DUPS # Do not display a previously found event.
setopt HIST_IGNORE_SPACE # Do not record an event starting with a space.
setopt HIST_SAVE_NO_DUPS # Do not write a duplicate event to the history file.
setopt HIST_VERIFY # Do not execute immediately upon history expansion.
setopt HIST_BEEP # Beep when accessing non-existent history.

View File

@ -1,6 +1,9 @@
hash -d gl=$HOME/.local/share
hash -d gl=$XDG_DATA_HOME
hash -d ga=$HOME/.local/apps
hash -d gb=$HOME/.local/bin
hash -d g.=$HOME/.config
hash -d g.=$XDG_CONFIG_HOME
hash -d gn=$XDG_CONFIG_HOME/nvim
hash -d gz=$ZDOTDIR
hash -d gm=$HOME/snd/Albums
hash -d gd=$HOME/doc
hash -d gv=$HOME/vid

View File

@ -0,0 +1,10 @@
foreach plugin (
zsh-autopair/autopair.plugin.zsh
zsh-system-clipboard/zsh-system-clipboard.plugin.zsh
zsh-history-substring-search/zsh-history-substring-search.plugin.zsh
) {
source $ZDOTDIR/conf/$plugin
}
HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE=1
typeset -g ZSH_SYSTEM_CLIPBOARD_TMUX_SUPPORT='true'

7
.local/bin/termux → .config/zsh/tmux.zsh Executable file → Normal file
View File

@ -19,7 +19,7 @@ tmux_sessions() {
# get the IDs
if ! ID="$(tmux list-sessions 2>/dev/null)"; then
# tmux returned error, so try cleaning up /tmp
rm -rf /tmp/tmux*
\rm -rf /tmp/tmux*
fi
create_new_session="Crear Sesión"
if [[ -n "$ID" ]]; then
@ -40,5 +40,6 @@ tmux_sessions() {
: # Start terminal normally
fi
}
tmux_sessions
if [[ -z $TMUX ]]; then
tmux_sessions
fi

View File

@ -1,3 +1,309 @@
# Scripts
bin
===
Estos son los scripts que uso con mi sistema. En su gran mayoría son para
agregar funcionalidad a mi window manager, BSPWM, pero pueden ser utilizados
fuera del mismo sin demasiado problema.\
Varios tienen a dmenu como su principal dependencia.
## [0x0](./0x0)
Postear texto y archivos a 0x0.st
## [actualizar](./actualizar)
Chequea si hay actualizaciones a paquetes instalados y enviá una notificación.
Basado en vpnd
## [ae](./ae)
Crea un listado del contenido de esta carpeta usando fzf y fd. El archivo
seleccionado es abierto en $EDITOR
## [agrandar](./agrandar)
BSPWM: agrandar nodo en cualquier dirección.
## [bandcamp](./bandcamp)
Solidarizar discos de bandcamp usando youtube-dl
## [brillo](./brillo)
Sube y baja el brillo usando xbacklight
## [cachetear](./cachetear)
Borrar el cache de paquetes viejos
## [cartero](./cartero)
Chequear si hay correo.
## [celu](./celu)
Para conectar el móvil a la computadora
## [cfg](./cfg)
Lista algunos archivos de configuración con fzf y abre el seleccionado en
$EDITOR
## [corte](./corte)
Terminar screencast
## [crear](./crear)
Crear un script en esta carpeta, hacerle chmod +x y abrir en $EDITOR
## [deci](./deci)
Una boludez con lolcat
## [disco](./disco)
Escuchar CDs con mpv
## [disks](./disks)
`du` pero mas cheto
## [dpi](./dpi)
Calculo para tener la cantidad de DPI adecuada en las fonts según la pantalla.
## [equiset](./equiset)
Apagar la pantalla con xset mas temprano o mas tarde según si la batería esta
puesta.
## [escribir](./escribir)
Crear posts para blog usando Hugo, o notas personales.
## [espejo](./espejo)
2 Monitores 1 --Cup-- digo, misma imagen
## [exeflock4](./exeflock4)
i3lock
## [fecha](./fecha)
No uso barra, con notificaciones me arreglo mejor.
## [foco](./foco)
BSPWM: enfocar nodo
## [fp](./fp)
Font preview robado de alguien mas. Requiere fzf y xdo
## [grabar](./grabar)
Grabar screencasts con ffmpeg.
## [hx](./hx)
Dotfile manager
## [leer](./leer)
Dmenu para abrir pdf con zathura
## [lfview](./lfview)
Previewer de LF
## [minve](./minve)
BSPWM: minimizar nodos con dmenu
## [monis](./monis)
Selector de monitores
## [mover](./mover)
BSPWM: mover nodo
## [notifocus](./notifocus)
No uso barra, con notificaciones me arreglo mejor.
## [paclist](./paclist)
Crear lista de paquetes instalados
## [pantallazo](./pantallazo)
Screenshot manager
## [pom](./pom)
Pomodoro timer
## [postear](./postear)
Git push para Hugo
## [powermenu](./powermenu)
Dmenu para power options
## [randbg](./randbg)
Fondo de pantalla random con hsetroot
## [ref](./ref)
Dmenu para cuando dibujo
## [setbg](./setbg)
Fondo de pantalla con hsetroot
## [sxiv-gif](./sxiv-gif)
Ver gifs animados
## [sxiv-rifle](./sxiv-rifle)
Ver todas las imágenes de una carpeta
## [tapa](./tapa)
Muestra album art en una notificación. Usado con ncmpcpp
## [tblock](./tblock)
Transmission blocklist
## [tsa](./tsa)
Transmission add
## [tsb](./tsb)
Parte de tblock
## [tsd](./tsd)
Transmission con notificaciones
## [tv](./tv)
Ver videos con dmenu y mpv
## [txbar](./txbar)
Barra de estado para tmux
## [unimon](./unimon)
Un solo monitor
## [upd](./upd)
Actualizar paquetes, manpages y paclist
## [vent](./vent)
BSPWM: window switcher con dmenu
## [vix](./vix)
Abrir archivo en $EDITOR en otro pane de tmux. Usado con LF
## [wifimenu](./wifimenu)
IWD
## [winclass](./winclass)
xprop
## [wpadd](./wpadd)
wifimenu pero para wpa_supplicant
## [xui](./xui)
FZF para instalar paquetes
## [ytdl](./ytdl)
youtube-dl
## [ytp](./ytp)
youtube-dl para playlists
## [zu](./zu)
Extraer archivos con tar
---
This page is generated automatically by [makebinreadme.sh](https://github.com/ssh0/dotfiles/blob/master/bin/makebinreadme.sh)
Estos son los scripts que uso con mi sistema. En su gran mayoria son para agregar funcionalidad a mi window manager, bspwm, pero pueden ser utilizados fuera del mismo sin demasiado problema. Varios tienen a dmenu como su principal dependencia.

View File

@ -33,7 +33,7 @@ articulo() {
[ -z "$nombre" ] && exit 0
nombreForm="$(echo "$nombre" | tr ' ' '-')"
hugo new articulos/"$nombreForm".md
sleep 1
sleep 5
prog content/articulos/"$nombre".md
}

View File

@ -18,8 +18,11 @@ grae() {
scale_y=$(echo "$res_ext_y / $res_int_y" | bc -l)
xrandr --output "$external" --auto --scale 1.0x1.0 --output "$internal" --auto --same-as "$external" --scale "$scale_x"x"$scale_y"
bspc monitor -d 1 2 3 4 5 6 7 8 9 10
bspc rule -a Firefox:Navigator state=tiled, desktop='^2'
if [ -e /tmp/bspwm_0_0-socket ]; then
bspc monitor -d 1 2 3 4 5 6 7 8 9 10
bspc rule -a Firefox:Navigator state=tiled, desktop='^2'
fi
}
grae

View File

@ -1,25 +1,12 @@
#!/bin/sh
M=$(bspc query -M --names)
NUM=$(echo "$M" | awk 'END{print NR}')
conectados=$(xrandr -q | awk '/ connected/ {count++} END {print count}')
sec=$(xrandr -q | awk '/ connected/ {print $1}' | sed -sn 2p)
ettin() {
sec=$(echo "$M" | awk NR==2)
if [ "$conectados" = 1 ]; then
xrandr --output LVDS1 --primary --auto --scale 1.0x1.0 "$(xrandr -q | awk '/ disconnected/ {print "--output", $1, "--off"}' | paste -sd ' ')"
randbg
elif [ "$conectados" = 2 ]; then
xrandr --output LVDS1 --primary --auto --scale 1.0x1.0 --output "$sec" --right-of LVDS1 --auto --scale 1.0x1.0
setbg
bspc monitor LVDS1 -d 1 2 3 4 5
bspc monitor "$sec" -d 6 7 8 9 10
bspc rule -a Firefox:Navigator state=tiled desktop='^6'
}
cyclops() {
xrandr --output LVDS1 --primary --auto --scale 1.0x1.0 "$(echo "$M" | awk '! /LVDS1/ {print "--output", $1, "--off"}' | paste -sd ' ')"
bspc monitor -d 1 2 3 4 5 6 7 8 9 10
bspc rule -a Firefox:Navigator state=tiled desktop='^2'
}
if [ "$NUM" = 1 ]; then
cyclops
elif [ "$NUM" = 2 ]; then
ettin
randbg
fi

View File

@ -1,3 +0,0 @@
#!/bin/sh
$TERMINAL --class=multi -e tmux new -A -s "Z"

View File

@ -1,14 +0,0 @@
#!/bin/sh
# open a new tmux session
# or attach to existing sessions
sessions="$(tmux ls 2> /dev/null | awk '! /attached/ { sub(":", "", $1); print $1 ; }')"
[ ! "$sessions" ] && sessions="new" || sessions="$sessions\nnew"
choice=$(printf "%b" "$sessions" | dmenu -i -w 245 -p "Attach ")
[ ! "$choice" ] && exit
if [ "$choice" = "new" ]; then
$TERMINAL -e tmux
else
$TERMINAL -e tmux a -t "$choice"
fi

View File

@ -1,17 +0,0 @@
#!/bin/sh
#
# enable/disable touchpad
# find your touchpad name:
# egrep -i 'synap|alps|etps' /proc/bus/input/devices
#
# Source: Xero's dotfiles on github
PAD='AlpsPS/2 ALPS GlidePoint'
A=$(xinput list-props "$PAD" | sed -n -e 's/.*Device Enabled ([0-9][0-9]*):\t\(.*\)/\1/p' )
if [ "$A" -eq 1 ]; then
xinput set-int-prop "$PAD" "Device Enabled" 8 0
notify-send -t 5000 'touchpad disabled' -i /usr/share/icons/Papirus-Dark/24x24/devices/input-touchpad.svg
else
xinput set-int-prop "$PAD" "Device Enabled" 8 1
notify-send -t 5000 'touchpad enabled' -i /usr/share/icons/Papirus-Dark/24x24/devices/input-touchpad.svg
fi

View File

@ -1,13 +1,10 @@
#!/bin/sh
M=$(bspc query -M --names)
xrandr --output LVDS1 --primary --auto --scale 1.0x1.0 "$(xrandr -q | awk '/ disconnected/ {print "--output", $1, "--off"}' | paste -sd ' ')"
cyclops() {
xrandr --output LVDS1 --primary --auto --scale 1.0x1.0 "$(echo "$M" | awk '! /LVDS1/ {print "--output", $1, "--off"}' | paste -sd ' ')"
if [ -e /tmp/bspwm_0_0-socket ]; then
bspc config remove_disabled_monitors
bspc config remove_unplugged_monitors
bspc monitor -d 1 2 3 4 5 6 7 8 9 10
bspc rule -a Firefox:Navigator state=tiled, desktop='^2'
}
cyclops
fi

View File

@ -29,8 +29,8 @@
<a href="https://www.reddit.com/r/neovim/new">Neovim</a>
</li>
<li>
<a href="https://www.reddit.com/r/republicaargentina/new"
>Argentina</a
<a href="https://www.reddit.com/r/wallpapers/new"
>Wallpapers</a
>
</li>
</ul>

14
.zshenv
View File

@ -8,7 +8,8 @@ fi
export VISUAL="$EDITOR"
export GIT_EDITOR="$EDITOR"
export TERMINAL="alacritty"
export BROWSER="firefox"
# export BROWSER="firefox"
export BROWSER="${${DISPLAY:-lynx}:+firefox}"
export COLORTERM="truecolor"
export OPENER="xdg-open"
export PAGER="less"
@ -20,7 +21,7 @@ export BLOCK_SIZE="'1"
export QUOTING_STYLE=literal
export HIGHLIGHT_OPTIONS='--out-format="ansi" --style="pablo"'
export GTK2_RC_FILES="$XDG_CONFIG_HOME/gtk-2.0/gtkrc-2.0"
export GTK2_RC_FILES="${XDG_CONFIG_HOME:-$HOME/.config}/gtk-2.0/gtkrc-2.0"
export QT_QPA_PLATFORMTHEME="gtk3"
export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority"
@ -44,7 +45,12 @@ export NODE_REPL_HISTORY="$XDG_DATA_HOME/node_repl_history"
export RANDFILE="$XDG_DATA_HOME/rnd"
export GOPATH="$XDG_DATA_HOME/go"
export HISTFILE="$XDG_DATA_HOME/bash/history"
export _JAVA_OPTIONS=-Djava.util.prefs.userRoot="$XDG_CONFIG_HOME/java"
_JAVA_OPTIONS="-Djava.util.prefs.userRoot=${XDG_DATA_HOME}/java "
_JAVA_OPTIONS+="-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true "
_JAVA_OPTIONS+="-Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel"
export _JAVA_OPTIONS
eval "$(sed 's/^[^#].*/export &/g;t;d' ${DIR:-$XDG_CONFIG_HOME}/user-dirs.dirs)"
# }}}
# FZF {{{
@ -81,6 +87,6 @@ export LESSHISTFILE="-"
# }}}
# Path {{{
typeset -U PATH path
path=(~/.local/bin ~/.config/yarn/bin ~/.local/share/npm/bin $path[@])
path=(~/.local/bin ~/.config/yarn/bin ~/.local/share/npm/bin ~/.local/wm/katriawm/src/core ~/.local/wm/nhkd $path[@])
# }}}
# vim:foldmethod=marker:foldlevel=0