Re quilombo parte 3
Mas que nada retoques a todo lo nuevo para ajustarlo y que quede mejor. Estuve jugando bastante con el orden de arranque de programas cuando empieza la sesion de X, moviendolos de aca para alla a ver que resultaba mejor. Por ahora estoy conforme con como quedo. Varios ajustes a la configuracion de nvim. Decidi que gina y gitgutter no me terminaron de convencer asi que puse fugitive. Por ahora bastante bien la verdad, lastima que no me reconoce los dotfiles, y bueh. Tambien retoque bastante el tema de statusline, mapeos, y opciones generales. Borre algunos scripts, modifique otros. Hubo varios mini cambios desparramados por ahi tambien.
This commit is contained in:
parent
e8cb8f17f7
commit
c30209e84c
|
@ -3,21 +3,9 @@
|
||||||
setxkbmap -option caps:escape
|
setxkbmap -option caps:escape
|
||||||
xsetroot -cursor_name left_ptr &
|
xsetroot -cursor_name left_ptr &
|
||||||
equiset &
|
equiset &
|
||||||
xcompmgr &
|
|
||||||
monis &
|
|
||||||
dpi &
|
|
||||||
mpd &
|
mpd &
|
||||||
xss-lock -l -- exeflock4 &
|
xss-lock -l -- exeflock4 &
|
||||||
|
xrdb -merge "$XDG_CONFIG_HOME/X11/xresources"
|
||||||
case ${1} in
|
monis &
|
||||||
(k)
|
|
||||||
nhkd &
|
|
||||||
katriawm
|
|
||||||
;;
|
|
||||||
(*)
|
|
||||||
sxhkd &
|
|
||||||
bspwm
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
exec runsvdir -P ~/.local/service.x 'log: ...........................................................................................................................................................................................................................................................................................................................................................................................................'
|
exec runsvdir -P ~/.local/service.x 'log: ...........................................................................................................................................................................................................................................................................................................................................................................................................'
|
||||||
|
|
|
@ -47,7 +47,7 @@ colors:
|
||||||
|
|
||||||
# Normal colors
|
# Normal colors
|
||||||
normal:
|
normal:
|
||||||
black: '#1c1c1c'
|
black: '#2c2c2c'
|
||||||
red: '#ef2f27'
|
red: '#ef2f27'
|
||||||
green: '#519f50'
|
green: '#519f50'
|
||||||
yellow: '#faa030'
|
yellow: '#faa030'
|
||||||
|
|
|
@ -3,8 +3,9 @@
|
||||||
bspc rule -r "*"
|
bspc rule -r "*"
|
||||||
|
|
||||||
bspmonis &
|
bspmonis &
|
||||||
|
randbg &
|
||||||
|
|
||||||
bspc config border_width 1
|
bspc config border_width 2
|
||||||
bspc config window_gap 6
|
bspc config window_gap 6
|
||||||
bspc config top_padding 10
|
bspc config top_padding 10
|
||||||
bspc config left_padding 0
|
bspc config left_padding 0
|
||||||
|
@ -14,10 +15,10 @@ bspc config split_ratio 0.5
|
||||||
|
|
||||||
# Opciones
|
# Opciones
|
||||||
bspc config gapless_monocle true
|
bspc config gapless_monocle true
|
||||||
bspc config single_monocle false
|
|
||||||
bspc config ignore_ewmh_focus true
|
bspc config ignore_ewmh_focus true
|
||||||
bspc config pointer_follows_focus true
|
bspc config pointer_follows_focus true
|
||||||
bspc config removal_adjustment true
|
bspc config removal_adjustment true
|
||||||
|
bspc config single_monocle false
|
||||||
bspc config borderless_monocle false
|
bspc config borderless_monocle false
|
||||||
bspc config remove_unplugged_monitors false
|
bspc config remove_unplugged_monitors false
|
||||||
bspc config remove_disabled_monitors false
|
bspc config remove_disabled_monitors false
|
||||||
|
@ -47,6 +48,10 @@ bspc rule -a Catia state=floating
|
||||||
bspc rule -a Cadence state=floating
|
bspc rule -a Cadence state=floating
|
||||||
bspc rule -a mpv state=floating
|
bspc rule -a mpv state=floating
|
||||||
bspc rule -a Alacritty:flota state=floating
|
bspc rule -a Alacritty:flota state=floating
|
||||||
bspc rule -a Sxiv:fontpreview state=floating
|
bspc rule -a Sxiv:flota state=floating
|
||||||
|
bspc rule -a Firefox state=floating
|
||||||
bspc rule -a Zathura state=tiled
|
bspc rule -a Zathura state=tiled
|
||||||
bspc rule -a Alacritty:multi desktop='^1'
|
bspc rule -a gzdoom state=fullscreen
|
||||||
|
|
||||||
|
xcompmgr &
|
||||||
|
unclutter --jitter 30 --timeout 3 --ignore-scrolling &
|
||||||
|
|
|
@ -78,7 +78,7 @@
|
||||||
[urgency_low]
|
[urgency_low]
|
||||||
background = "#212121"
|
background = "#212121"
|
||||||
foreground = "#e8d0c0"
|
foreground = "#e8d0c0"
|
||||||
frame_color = "#b16286"
|
frame_color = "#73d0ff"
|
||||||
timeout = 3
|
timeout = 3
|
||||||
|
|
||||||
[urgency_normal]
|
[urgency_normal]
|
||||||
|
|
|
@ -65,12 +65,14 @@
|
||||||
[credential]
|
[credential]
|
||||||
helper = /usr/libexec/git-core/git-credential-libsecret
|
helper = /usr/libexec/git-core/git-credential-libsecret
|
||||||
|
|
||||||
[merge]
|
[mergetool "nvim"]
|
||||||
tool = nvr
|
cmd = nvim -f -c \"Gdiffsplit!\" \"$MERGED\"
|
||||||
conflictstyle = diff3
|
|
||||||
|
|
||||||
[mergetool "nvr"]
|
[merge]
|
||||||
cmd = nvr -s -d $LOCAL $BASE $REMOTE $MERGED -c 'wincmd J | wincmd ='
|
tool = nvim
|
||||||
|
|
||||||
|
[mergetool]
|
||||||
|
prompt = false
|
||||||
|
|
||||||
[diff]
|
[diff]
|
||||||
tool = nvr
|
tool = nvr
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
# This file goes in ~/.config/mpv
|
# This file goes in ~/.config/mpv
|
||||||
ao=jack,alsa,
|
ao=jack,alsa,
|
||||||
scale=ewa_lanczossharp
|
# scale=ewa_lanczossharp
|
||||||
cscale=ewa_lanczossharp
|
# cscale=ewa_lanczossharp
|
||||||
|
# hwdec=vaapi
|
||||||
deband=no
|
deband=no
|
||||||
geometry=50%:50%
|
geometry=50%:50%
|
||||||
alang=eng,en
|
alang=eng,en
|
||||||
|
@ -13,7 +14,6 @@ osc=yes
|
||||||
ytdl-format=bestvideo[height<=?1080]+bestaudio/best
|
ytdl-format=bestvideo[height<=?1080]+bestaudio/best
|
||||||
screenshot-format=png
|
screenshot-format=png
|
||||||
screenshot-directory="~/img/scrot"
|
screenshot-directory="~/img/scrot"
|
||||||
hwdec=vaapi
|
|
||||||
osd-level=1
|
osd-level=1
|
||||||
osd-duration="3500"
|
osd-duration="3500"
|
||||||
osd-font="IBM Plex Sans"
|
osd-font="IBM Plex Sans"
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
always-display-description yes
|
always-display-description yes
|
||||||
display-article-progress yes
|
display-article-progress yes
|
||||||
reload-only-visible-feeds yes
|
reload-only-visible-feeds yes
|
||||||
|
openbrowser-and-mark-jumps-to-next-unread yes
|
||||||
|
toggleitemread-jumps-to-next-unread yes
|
||||||
auto-reload yes
|
auto-reload yes
|
||||||
show-keymap-hint no
|
show-keymap-hint no
|
||||||
text-width 80
|
text-width 80
|
||||||
|
@ -57,14 +59,13 @@ bind-key d pagedown
|
||||||
bind-key u pageup
|
bind-key u pageup
|
||||||
bind-key l open
|
bind-key l open
|
||||||
bind-key h quit
|
bind-key h quit
|
||||||
bind-key a toggle-article-read
|
bind-key M mark-feed-read
|
||||||
|
bind-key o open-in-browser-and-mark-read
|
||||||
bind-key n next-unread
|
bind-key n next-unread
|
||||||
bind-key N prev-unread
|
bind-key N prev-unread
|
||||||
bind-key D pb-download
|
bind-key D pb-download
|
||||||
bind-key U show-urls
|
bind-key U show-urls
|
||||||
bind-key x pb-delete
|
bind-key x pb-delete
|
||||||
bind-key ^t next-unread
|
|
||||||
bind-key / open-search
|
|
||||||
|
|
||||||
# programas externos
|
# programas externos
|
||||||
notify-program "notify-send"
|
notify-program "notify-send"
|
||||||
|
@ -75,9 +76,7 @@ save-path ~/.config/newsboat/saved
|
||||||
# macros con prefijo
|
# macros con prefijo
|
||||||
macro , open-in-browser
|
macro , open-in-browser
|
||||||
macro d set browser "ytdl"; open-in-browser ; set browser linkhandler
|
macro d set browser "ytdl"; open-in-browser ; set browser linkhandler
|
||||||
macro a set browser "bandcamp"; open-in-browser ; set browser linkhandler
|
|
||||||
macro v set browser "setsid nohup mpv"; open-in-browser ; set browser linkhandler
|
macro v set browser "setsid nohup mpv"; open-in-browser ; set browser linkhandler
|
||||||
macro w set browser "tmux split-window -hp 60 && tmux send-keys '$lynx %u && tmux kill-pane\n'"; open-in-browser ; set browser linkhandler
|
macro w set browser "tmux split-window -hp 60 && tmux send-keys '$lynx %u && tmux kill-pane\n'"; open-in-browser ; set browser linkhandler
|
||||||
macro r set browser "tmux split-window -hp 60 && tmux send-keys 'tuir -l %u && tmux kill-pane\n'"; open-in-browser ; set browser linkhandler
|
|
||||||
|
|
||||||
# vim: ft=conf cms=#%s
|
# vim: ft=conf cms=#%s
|
||||||
|
|
|
@ -8,12 +8,11 @@ endfunction
|
||||||
|
|
||||||
function! dead#statusline#StatusLine() abort
|
function! dead#statusline#StatusLine() abort
|
||||||
let l:statusline=''
|
let l:statusline=''
|
||||||
let l:statusline.='%#error#'
|
let l:statusline.='%#TabLineFill#%{dead#statusline#LinterStatus()} '
|
||||||
let l:statusline.=dead#statusline#LinterStatus()
|
let l:statusline.='%#User6#%{fugitive#head()} '
|
||||||
let l:statusline.='%#User1#'
|
let l:statusline.='%{dead#statusline#LinePasteMode()}'
|
||||||
let l:statusline.=dead#statusline#LinePasteMode()
|
|
||||||
let l:statusline.='%= '
|
let l:statusline.='%= '
|
||||||
let l:statusline.=' %p%% %l:%c '
|
let l:statusline.='%#User1#%p%% %l:%c '
|
||||||
let l:statusline.=dead#statusline#ModeColor()
|
let l:statusline.=dead#statusline#ModeColor()
|
||||||
let l:statusline.=dead#statusline#CurrentMode()
|
let l:statusline.=dead#statusline#CurrentMode()
|
||||||
return l:statusline
|
return l:statusline
|
||||||
|
@ -53,7 +52,7 @@ endfunction
|
||||||
function! dead#statusline#LinePasteMode() abort
|
function! dead#statusline#LinePasteMode() abort
|
||||||
let paste_status = &paste
|
let paste_status = &paste
|
||||||
if paste_status == 1
|
if paste_status == 1
|
||||||
return ' paste '
|
return '[paste]'
|
||||||
else
|
else
|
||||||
return ''
|
return ''
|
||||||
endif
|
endif
|
||||||
|
@ -78,13 +77,8 @@ function! dead#statusline#LinterStatus() abort
|
||||||
let l:all_errors = l:counts.error + l:counts.style_error
|
let l:all_errors = l:counts.error + l:counts.style_error
|
||||||
let l:all_non_errors = l:counts.total - l:all_errors
|
let l:all_non_errors = l:counts.total - l:all_errors
|
||||||
return l:counts.total == 0 ? '' : printf(
|
return l:counts.total == 0 ? '' : printf(
|
||||||
\ ' :%d :%d ',
|
\ ' :%d :%d',
|
||||||
\ l:all_non_errors,
|
\ l:all_non_errors,
|
||||||
\ l:all_errors
|
\ l:all_errors
|
||||||
\)
|
\)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! dead#statusline#GitStatus()
|
|
||||||
let [a,m,r] = GitGutterGetHunkSummary()
|
|
||||||
return printf('+%d ~%d -%d', a, m, r)
|
|
||||||
endfunction
|
|
||||||
|
|
|
@ -8,7 +8,6 @@ let $GIT_EDITOR = 'nvr -cc split --remote-wait'
|
||||||
if executable("rg")
|
if executable("rg")
|
||||||
set grepprg=rg\ --vimgrep
|
set grepprg=rg\ --vimgrep
|
||||||
endif
|
endif
|
||||||
set runtimepath+=/usr/share/vim/vimfiles/
|
|
||||||
let mapleader="\<SPACE>"
|
let mapleader="\<SPACE>"
|
||||||
let maplocalleader=','
|
let maplocalleader=','
|
||||||
|
|
||||||
|
@ -30,4 +29,6 @@ packadd! loupe
|
||||||
packadd! vim-commentary
|
packadd! vim-commentary
|
||||||
packadd! fzf.vim
|
packadd! fzf.vim
|
||||||
packadd! fern.vim
|
packadd! fern.vim
|
||||||
packadd! gina.vim
|
packadd! ale
|
||||||
|
packadd! coc.nvim
|
||||||
|
packadd! vim-fugitive
|
||||||
|
|
|
@ -19,8 +19,8 @@ function! s:init_fern() abort
|
||||||
\ "\<Plug>(fern-action-collapse)",
|
\ "\<Plug>(fern-action-collapse)",
|
||||||
\ )
|
\ )
|
||||||
|
|
||||||
nmap <buffer> H <Plug>(fern-action-open:split)
|
nmap <buffer> <C-x> <Plug>(fern-action-open:split)
|
||||||
nmap <buffer> V <Plug>(fern-action-open:vsplit)
|
nmap <buffer> <C-V> <Plug>(fern-action-open:vsplit)
|
||||||
nmap <buffer> t <Plug>(fern-action-open:tabedit)
|
nmap <buffer> t <Plug>(fern-action-open:tabedit)
|
||||||
nmap <buffer> r <Plug>(fern-action-rename)
|
nmap <buffer> r <Plug>(fern-action-rename)
|
||||||
nmap <buffer> R <Plug>(fern-action-reload)
|
nmap <buffer> R <Plug>(fern-action-reload)
|
||||||
|
@ -28,15 +28,17 @@ function! s:init_fern() abort
|
||||||
nmap <buffer> K <Plug>(fern-action-new-dir)
|
nmap <buffer> K <Plug>(fern-action-new-dir)
|
||||||
nmap <buffer> c <Plug>(fern-action-copy)
|
nmap <buffer> c <Plug>(fern-action-copy)
|
||||||
nmap <buffer> m <Plug>(fern-action-move)
|
nmap <buffer> m <Plug>(fern-action-move)
|
||||||
nmap <buffer> h <Plug>(fern-action-hidden:toggle)
|
nmap <buffer> ! <Plug>(fern-action-hidden:toggle)
|
||||||
nmap <buffer> C <Plug>(fern-action-clipboard-copy)
|
nmap <buffer> C <Plug>(fern-action-clipboard-copy)
|
||||||
nmap <buffer> M <Plug>(fern-action-clipboard-move)
|
nmap <buffer> M <Plug>(fern-action-clipboard-move)
|
||||||
nmap <buffer> P <Plug>(fern-action-clipboard-paste)
|
nmap <buffer> P <Plug>(fern-action-clipboard-paste)
|
||||||
|
nmap <buffer> l <Plug>(fern-action-expand)
|
||||||
nmap <buffer> D <Plug>(fern-action-remove)
|
nmap <buffer> D <Plug>(fern-action-remove)
|
||||||
nmap <buffer> <BS> <Plug>(fern-action-leave)
|
nmap <buffer> <BS> <Plug>(fern-action-leave)
|
||||||
nmap <buffer> <space> <Plug>(fern-action-mark-toggle)
|
nmap <buffer> <space> <Plug>(fern-action-mark-toggle)
|
||||||
nmap <buffer> <CR> <Plug>(fern-my-open-expand-collapse)
|
nmap <buffer> <CR> <Plug>(fern-my-open-expand-collapse)
|
||||||
nmap <buffer><nowait> o <Plug>(fern-my-expand-or-collapse)
|
nmap <buffer><nowait> o <Plug>(fern-my-expand-or-collapse)
|
||||||
|
nmap <buffer> <F5> <Plug>(fern-action-open-and-close)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
augroup fern-custom
|
augroup fern-custom
|
||||||
|
|
|
@ -4,3 +4,8 @@ nmap ghu <Plug>(GitGutterUndoHunk)
|
||||||
nmap ghs <Plug>(GitGutterStageHunk)
|
nmap ghs <Plug>(GitGutterStageHunk)
|
||||||
nmap {c <Plug>(GitGutterPrevHunk)
|
nmap {c <Plug>(GitGutterPrevHunk)
|
||||||
nmap }c <Plug>(GitGutterNextHunk)
|
nmap }c <Plug>(GitGutterNextHunk)
|
||||||
|
|
||||||
|
nnoremap <silent> <Leader>ff :G<CR>
|
||||||
|
nnoremap <silent> <Leader>fd :Gvdiffsplit!<CR>
|
||||||
|
nnoremap <silent> <Leader>fh :diffget //2<CR>
|
||||||
|
nnoremap <silent> <Leader>fl :diffget //3<CR>
|
|
@ -22,7 +22,7 @@ set notimeout
|
||||||
set ignorecase
|
set ignorecase
|
||||||
set scrolloff=5
|
set scrolloff=5
|
||||||
set sidescroll=5
|
set sidescroll=5
|
||||||
set shortmess+=aoOWsc
|
set shortmess+=aoIOWsc
|
||||||
set foldmethod=marker
|
set foldmethod=marker
|
||||||
set foldclose=all
|
set foldclose=all
|
||||||
set foldlevelstart=10
|
set foldlevelstart=10
|
||||||
|
@ -49,13 +49,7 @@ set listchars+=precedes:<,extends:>
|
||||||
set diffopt+=algorithm:histogram,indent-heuristic
|
set diffopt+=algorithm:histogram,indent-heuristic
|
||||||
set diffopt+=foldcolumn:0
|
set diffopt+=foldcolumn:0
|
||||||
set fillchars=eob:\ ,stlnc:\ ,stl:\ ,vert:\│
|
set fillchars=eob:\ ,stlnc:\ ,stl:\ ,vert:\│
|
||||||
|
set formatoptions+=nl
|
||||||
|
set formatoptions-=crot
|
||||||
let formatlistpat='^\s*\(\d\+[\]:.)}\t ]\|[*-][\t ]\)\s*'
|
let formatlistpat='^\s*\(\d\+[\]:.)}\t ]\|[*-][\t ]\)\s*'
|
||||||
let g:netrw_dirhistmax=0
|
|
||||||
match ErrorMsg '^\(<\|=\|>\)\{7\}\([^=].\+\)\?$'
|
match ErrorMsg '^\(<\|=\|>\)\{7\}\([^=].\+\)\?$'
|
||||||
set formatoptions&
|
|
||||||
\ formatoptions+=n
|
|
||||||
\ formatoptions+=l
|
|
||||||
\ formatoptions-=c
|
|
||||||
\ formatoptions-=r
|
|
||||||
\ formatoptions-=o
|
|
||||||
\ formatoptions-=t
|
|
||||||
|
|
|
@ -20,9 +20,6 @@ super + shift + {1-9,0}
|
||||||
super + ctrl + {1-9,0}
|
super + ctrl + {1-9,0}
|
||||||
id=$(bspc query -N -n); bspc node -d {1-9,10}; bspc node -f ${id}
|
id=$(bspc query -N -n); bspc node -d {1-9,10}; bspc node -f ${id}
|
||||||
|
|
||||||
super + {_,shift} + ntilde
|
|
||||||
minve {hide,show}
|
|
||||||
|
|
||||||
super + {equal, plus, minus}
|
super + {equal, plus, minus}
|
||||||
bspc node -l {normal, above, below}
|
bspc node -l {normal, above, below}
|
||||||
|
|
||||||
|
@ -41,22 +38,25 @@ super + shift + {d,a}
|
||||||
super + {_,shift,ctrl} + u
|
super + {_,shift,ctrl} + u
|
||||||
bspc node {@/ -B,@brother -B,@/ -E}
|
bspc node {@/ -B,@brother -B,@/ -E}
|
||||||
|
|
||||||
|
super + m
|
||||||
|
bspc monitor -f last
|
||||||
|
|
||||||
# Run Applications
|
# Run Applications
|
||||||
|
super + {_,shift} + ntilde
|
||||||
|
minve {hide,show}
|
||||||
|
|
||||||
|
super + space
|
||||||
|
j4-dmenu-desktop --dmenu="dmenu -i -w 250 -p ' ' " --no-generic
|
||||||
|
|
||||||
super + {b,q,s,n,p,t,r,d,i}
|
super + {b,q,s,n,p,t,r,d,i}
|
||||||
{$BROWSER,powermenu,vent,escribir,pom,tv,ref,leer,wpadd}
|
{$BROWSER,powermenu,vent,escribir,pom,tv,ref,leer,wpadd}
|
||||||
|
|
||||||
super + {_,shift,ctrl} + m
|
|
||||||
{monis,unimon,espejo}
|
|
||||||
|
|
||||||
super + {_,shift} + g
|
super + {_,shift} + g
|
||||||
{grabar,corte}
|
{grabar,corte}
|
||||||
|
|
||||||
super + {z,x,v}
|
super + {z,x,v}
|
||||||
$TERMINAL {_,--class=flota,--class=flota -e pulsemixer}
|
$TERMINAL {_,--class=flota,--class=flota -e pulsemixer}
|
||||||
|
|
||||||
super + space
|
|
||||||
j4-dmenu-desktop --dmenu="dmenu -i -w 250 -p ' ' " --no-generic
|
|
||||||
|
|
||||||
super + {F1,F2,F3}
|
super + {F1,F2,F3}
|
||||||
{fecha,tapa,notifocus}
|
{fecha,tapa,notifocus}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
while read -r file
|
while read -r file
|
||||||
do
|
do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
"b") setbg "$file" & ;;
|
"b") hsetroot -fill "$file" & ;;
|
||||||
"m") mv "$file" "$HOME/img/rand" ;;
|
"m") mv "$file" "$HOME/img/rand" ;;
|
||||||
"r") convert -rotate 90 "$file" "$file" ;;
|
"r") convert -rotate 90 "$file" "$file" ;;
|
||||||
"R") convert -rotate -90 "$file" "$file" ;;
|
"R") convert -rotate -90 "$file" "$file" ;;
|
||||||
|
|
|
@ -40,3 +40,4 @@ for f in "${ZDOTDIR}"/conf/*; do
|
||||||
done
|
done
|
||||||
|
|
||||||
source $XDG_DATA_HOME/lscolors.sh
|
source $XDG_DATA_HOME/lscolors.sh
|
||||||
|
source "$ZDOTDIR/other.zsh"
|
||||||
|
|
|
@ -1,44 +1,33 @@
|
||||||
# Set PS1 and RPS1
|
# Set PS1 and RPS1
|
||||||
precmd() {
|
precmd() {
|
||||||
local cwd git_branch git_toplvl suffix newline
|
local git_branch git_toplvl suffix
|
||||||
|
|
||||||
# -- Add a line before the prompt
|
# -- Add a line before the prompt
|
||||||
[[ -v PS1_NL ]] && echo || PS1_NL=
|
[[ -v PS1_NL ]] && echo || PS1_NL=
|
||||||
|
|
||||||
newline=$'\n'
|
|
||||||
|
|
||||||
# -- PS1 (in precmd, avoid tools updating PS1)
|
# -- PS1 (in precmd, avoid tools updating PS1)
|
||||||
if [[ $EUID == 0 ]]; then
|
if [[ $EUID == 0 ]]; then
|
||||||
suffix='%(?,%F{yellow},%F{red})%n%f:'
|
suffix='%(?,%F{yellow},%F{red})%n%f:'
|
||||||
else
|
else
|
||||||
suffix='%(?,%F{yellow},%F{red})>%f'
|
suffix='%(?,%F{yellow},%F{red})>%f'
|
||||||
fi
|
fi
|
||||||
|
PS1="%B${suffix}%b "
|
||||||
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
|
# -- RPS1
|
||||||
# Error code if != 0
|
# Error code if != 0
|
||||||
RPS1='%B%(?..%{%F{red}%}(%?%)%{%f%}) '
|
RPS1='%B%(?..%{%F{red}%}(%?%)%{%f%}) '
|
||||||
|
|
||||||
# if in git repo, print <branch>·<name>/<path>
|
# if in git repo, print <branch> <name>/<path>
|
||||||
if git_branch="$( git rev-parse --abbrev-ref HEAD 2>/dev/null )"; then
|
if git_branch="$( git rev-parse --abbrev-ref HEAD 2>/dev/null )"; then
|
||||||
[[ -z "$(git status --porcelain 2>/dev/null)" ]] \
|
[[ -z "$(git status --porcelain 2>/dev/null)" ]] \
|
||||||
&& RPS1+="%F{green}${git_branch}%F{231} " \
|
&& RPS1+="%F{green}${git_branch}%F{231}%b " \
|
||||||
|| RPS1+="%F{166}${git_branch}%F{231} "
|
|| RPS1+="%F{166}${git_branch}%F{231}%b "
|
||||||
|
|
||||||
git_toplvl="$( git rev-parse --show-toplevel 2>/dev/null )"
|
git_toplvl="$( git rev-parse --show-toplevel 2>/dev/null )"
|
||||||
cwd="${${PWD##${git_toplvl}}:-/}"
|
RPS1+="%F{240}[%F{201}${git_toplvl##*/}:%F{12}%2~%F{240}]%f"
|
||||||
|
|
||||||
RPS1+="%F{240}[%F{12}${git_toplvl##*/}%F{240}]%f%b"
|
|
||||||
else
|
else
|
||||||
RPS1+='%F{12}%2~%f%b'
|
RPS1+='%b%F{12}%2~%f'
|
||||||
fi
|
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]? "
|
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 {
|
function zle-keymap-select {
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
# Programas
|
# Programas
|
||||||
alias \
|
alias \
|
||||||
vdi='nvim -d' \
|
v='$EDITOR' \
|
||||||
|
x='xui' \
|
||||||
|
m='neomutt' \
|
||||||
|
z='zathura' \
|
||||||
|
g='lab' \
|
||||||
se='sudoedit' \
|
se='sudoedit' \
|
||||||
gdl='gallery-dl' \
|
|
||||||
am='alsamixer' \
|
am='alsamixer' \
|
||||||
pm='pulsemixer' \
|
pm='pulsemixer' \
|
||||||
nb='newsboat -q' \
|
nb='newsboat -q' \
|
||||||
v='$EDITOR' \
|
|
||||||
play='ncmpcpp' \
|
|
||||||
x='xui' \
|
|
||||||
z='zathura' \
|
|
||||||
py='python ' \
|
py='python ' \
|
||||||
pyserv='python -m http.server' \
|
vdi='nvim -d' \
|
||||||
git='lab' \
|
irc='catgirl' \
|
||||||
irc='catgirl freenode'
|
play='ncmpcpp' \
|
||||||
|
pyserv='python -m http.server'
|
||||||
|
|
||||||
# XBPS
|
# XBPS
|
||||||
alias \
|
alias \
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
M=$(bspc query -M --names)
|
||||||
|
NUM=$(echo "$M" | awk 'END{print NR}')
|
||||||
|
|
||||||
|
if [ "$NUM" = 1 ]; then
|
||||||
|
bspc monitor -d 1 2 3 4 5 6 7 8 9 10
|
||||||
|
bspc rule -a Firefox:Navigator state=tiled desktop='^2'
|
||||||
|
elif [ "$NUM" = 2 ]; then
|
||||||
|
pri=$(echo "$M" | awk NR==1)
|
||||||
|
sec=$(echo "$M" | awk NR==2)
|
||||||
|
bspc monitor "$pri" -d 1 2 3 4 5
|
||||||
|
bspc monitor "$sec" -d 6 7 8 9 10
|
||||||
|
bspc rule -a Firefox:Navigator state=tiled desktop='^6'
|
||||||
|
fi
|
|
@ -1,56 +0,0 @@
|
||||||
#!/usr/bin/env zsh
|
|
||||||
|
|
||||||
function () {
|
|
||||||
# Bookmarks
|
|
||||||
local -A bookmarks=(
|
|
||||||
'nvim' '~/.config/nvim/init.vim'
|
|
||||||
'git' '$XDG_CONFIG_HOME/git/config'
|
|
||||||
'gtk2' '~/.config/gtk-2.0/gtkrc-2.0'
|
|
||||||
'gtk3' '~/.config/gtk-3.0/settings.ini'
|
|
||||||
'lf' '~/.config/lf/lfrc'
|
|
||||||
'preview' '~/.local/bin/lfview'
|
|
||||||
'mpv' '~/.config/mpv/mpv.conf'
|
|
||||||
'xres' '~/.config/X11/xresources'
|
|
||||||
'wm' '~/.config/bspwm/bspwmrc'
|
|
||||||
'keys' '~/.config/sxhkd/sxhkdrc'
|
|
||||||
'shell' '~/.config/zsh/.zshrc'
|
|
||||||
'dunst' '~/.config/dunst/dunstrc'
|
|
||||||
'music' '~/.config/ncmpcpp/config'
|
|
||||||
'tmux' '~/.config/tmux/tmux.conf'
|
|
||||||
'xinit' '~/.config/X11/xinitrc'
|
|
||||||
'alias' '~/.config/zsh/aliases.zsh'
|
|
||||||
'term' '~/.config/alacritty.yml'
|
|
||||||
'env' '~/.zshenv'
|
|
||||||
)
|
|
||||||
|
|
||||||
local selected_bookmark
|
|
||||||
|
|
||||||
if [[ "$1" != '' ]] {
|
|
||||||
selected_bookmark="${bookmarks[$1]}"
|
|
||||||
} else {
|
|
||||||
local bookmarks_table
|
|
||||||
|
|
||||||
local key
|
|
||||||
foreach key (${(k)bookmarks}) {
|
|
||||||
bookmarks_table+="$key ${bookmarks[$key]}\n"
|
|
||||||
}
|
|
||||||
|
|
||||||
if (! hash fzf &>/dev/null) {
|
|
||||||
return 1
|
|
||||||
} else {
|
|
||||||
selected_bookmark=$(
|
|
||||||
printf "$bookmarks_table" \
|
|
||||||
| fzf \
|
|
||||||
--height='45%' \
|
|
||||||
)
|
|
||||||
|
|
||||||
selected_bookmark="${selected_bookmark[(ws: :)2]}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if [[ "$selected_bookmark" != '' ]] {
|
|
||||||
eval $EDITOR "$selected_bookmark"
|
|
||||||
} else {
|
|
||||||
exit 0
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,27 +1,26 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
prog() {
|
abrir() { ${TERMINAL:-alacritty} --class=flota -e nvim "$@"; }
|
||||||
$TERMINAL --class=flota -e nvim "$@"
|
listar() { ${DMENU:-dmenu} -i -w 125 "$@"; }
|
||||||
}
|
|
||||||
|
|
||||||
diario() {
|
diario() {
|
||||||
cd "$HOME/doc/blog" || exit
|
cd "$HOME/doc/blog" || exit
|
||||||
menuBlog=$(printf "Hoy\\nMañana\\nAyer\\nArchivo" | dmenu -i -w 120 -p " ")
|
menuBlog=$(printf "Hoy\\nMañana\\nAyer\\nArchivo" | listar -p " ")
|
||||||
case $menuBlog in
|
case $menuBlog in
|
||||||
"Hoy") prog "$(date -I)".md ;;
|
"Hoy") abrir "$(date -I)".md ;;
|
||||||
"Mañana") prog "$(date --date='tomorrow' +%F)".md ;;
|
"Mañana") abrir "$(date --date='tomorrow' +%F)".md ;;
|
||||||
"Ayer") prog "$(date --date='yesterday' +%F)".md ;;
|
"Ayer") abrir "$(date --date='yesterday' +%F)".md ;;
|
||||||
"Archivo") archivo ;;
|
"Archivo") archivo ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
notas() {
|
notas() {
|
||||||
cd "$HOME/doc/notas" || exit
|
cd "$HOME/doc/notas" || exit
|
||||||
menuNota=$(printf "Nueva\\nArchivo" | dmenu -i -w 120 -p " ")
|
menuNota=$(printf "Nueva\\nArchivo" | listar -p " ")
|
||||||
case $menuNota in
|
case $menuNota in
|
||||||
"Nueva")
|
"Nueva")
|
||||||
nombre="$(dmenu -i -p "Titulo: ")" 2>/dev/null
|
nombre="$(dmenu -i -p "Titulo: ")" 2>/dev/null
|
||||||
prog "$nombre".md
|
abrir "$nombre".md
|
||||||
;;
|
;;
|
||||||
"Archivo") archivo ;;
|
"Archivo") archivo ;;
|
||||||
esac
|
esac
|
||||||
|
@ -34,16 +33,16 @@ articulo() {
|
||||||
nombreForm="$(echo "$nombre" | tr ' ' '-')"
|
nombreForm="$(echo "$nombre" | tr ' ' '-')"
|
||||||
hugo new articulos/"$nombreForm".md
|
hugo new articulos/"$nombreForm".md
|
||||||
sleep 5
|
sleep 5
|
||||||
prog content/articulos/"$nombre".md
|
abrir content/articulos/"$nombre".md
|
||||||
}
|
}
|
||||||
|
|
||||||
archivo() {
|
archivo() {
|
||||||
selarch=$(fd -d 1 -e md | sort -Mr | dmenu -i -w 200 -p " ")
|
selarch=$(fd -d 1 -e md | sort -Mr | dmenu -i -w 200 -p " ")
|
||||||
[ -z "$selarch" ] && exit 0
|
[ -z "$selarch" ] && exit 0
|
||||||
prog "$selarch"
|
abrir "$selarch"
|
||||||
}
|
}
|
||||||
|
|
||||||
MENU="$(printf "Artículo\\nPersonal\\nNotas" | dmenu -i -w 130 -p " ")"
|
MENU="$(printf "Artículo\\nPersonal\\nNotas" | listar -p " ")"
|
||||||
case $MENU in
|
case $MENU in
|
||||||
'Personal') diario ;;
|
'Personal') diario ;;
|
||||||
'Artículo') articulo ;;
|
'Artículo') articulo ;;
|
||||||
|
|
304
.local/bin/fp
304
.local/bin/fp
|
@ -1,241 +1,93 @@
|
||||||
#!/usr/bin/env bash
|
#!/bin/sh
|
||||||
#
|
# Font preview with ueberzug and fzf
|
||||||
# Siddharth Dushantha 2020
|
# https://github.com/OliverLew/fontpreview-ueberzug
|
||||||
#
|
# Dependencies: imagemagick, ueberzug, fzf, fontconfig
|
||||||
# Dependencies: sxiv, imagemagick, xdotool, fzf
|
# This is inspired by https://github.com/sdushantha/fontpreview
|
||||||
|
|
||||||
VERSION=1.0.7
|
# Checking for environment variables if available.
|
||||||
|
# These are compatible with original fontpreview.
|
||||||
|
SIZE=${FONTPREVIEW_SIZE:-800x800}
|
||||||
|
FONT_SIZE=${FONTPREVIEW_FONT_SIZE:-50}
|
||||||
|
BG_COLOR=${FONTPREVIEW_BG_COLOR:-#080808}
|
||||||
|
FG_COLOR=${FONTPREVIEW_FG_COLOR:-#b3b1ad}
|
||||||
|
PREVIEW_TEXT=${FONTPREVIEW_PREVIEW_TEXT:-"Jackdaws Love\nMy Big Sphinx\nOf Quartz\n\n1234567890\n¡!@#$\%|^&*\n',.;:_-=+\"\n(){}[]<>¿?ñÑ"}
|
||||||
|
|
||||||
# Default values
|
# Ueberzug related variables
|
||||||
SEARCH_PROMPT="> "
|
FIFO="/tmp/fontpreview-ueberzug-fifo"
|
||||||
SIZE=532x365
|
IMAGE="/tmp/fontpreview-ueberzug-img.png"
|
||||||
POSITION="+0+0"
|
ID="fontpreview-ueberzug"
|
||||||
FONT_SIZE=34
|
WIDTH=$(tput cols)
|
||||||
BG_COLOR="#ffffff"
|
HEIGHT=$(tput lines)
|
||||||
FG_COLOR="#000000"
|
|
||||||
PREVIEW_TEXT="Jackdaws love\nmy big sphinx\nof quartz\n\n1234567890\n¡!@$\%|=+:;\"\'\n(){}[]<>¿?ñÑ"
|
|
||||||
|
|
||||||
show_help() {
|
usage() {
|
||||||
printf "%s" "\
|
echo "Usage: fontpreview [-h] [-s FONT_SIZE] [-b BG] [-f FG] [-t TEXT]"
|
||||||
usage: fontpreview [-h] [--size \"px\"] [--position \"+x+y\"] [--search-prompt SEARCH_PROMPT]
|
|
||||||
[--font-size \"FONT_SIZE\"] [--bg-color \"BG_COLOR\"] [--fg-color \"FG_COLOR\"]
|
|
||||||
[--preview-text \"PREVIEW_TEXT\"] [-i font.otf] [-o preview.png] [--version]
|
|
||||||
|
|
||||||
┌─┐┌─┐┌┐┌┌┬┐┌─┐┬─┐┌─┐┬ ┬┬┌─┐┬ ┬
|
|
||||||
├┤ │ ││││ │ ├─┘├┬┘├┤ └┐┌┘│├┤ │││
|
|
||||||
└ └─┘┘└┘ ┴ ┴ ┴└─└─┘ └┘ ┴└─┘└┴┘
|
|
||||||
Very customizable and minimal font previewer written in bash
|
|
||||||
|
|
||||||
optional arguments:
|
|
||||||
-h, --help show this help message and exit
|
|
||||||
-i, --input filename of the input font (.otf, .ttf, .woff are supported)
|
|
||||||
-o, --output filename of the output preview image (input.png if not set)
|
|
||||||
--size size of the font preview window
|
|
||||||
--position the position where the font preview window should be displayed
|
|
||||||
--search-prompt input prompt of fuzzy searcher
|
|
||||||
--font-size font size
|
|
||||||
--bg-color background color of the font preview window
|
|
||||||
--fg-color foreground color of the font preview window
|
|
||||||
--preview-text preview text that should be displayed in the font preview window
|
|
||||||
--version show the version of fontpreview you are using
|
|
||||||
"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pre_exit() {
|
start_ueberzug() {
|
||||||
# Get the proccess ID of this script and kill it.
|
mkfifo "$FIFO" || exit 1
|
||||||
# We are dumping the output of kill to /dev/null
|
touch "$IMAGE" || exit 1
|
||||||
# because if the user quits sxiv before they
|
ueberzug layer --parser simple --silent <"$FIFO" &
|
||||||
# exit this script, an error will be shown
|
# https://github.com/seebye/ueberzug/issues/54#issuecomment-502869935
|
||||||
# from kill and we dont want that
|
exec 3>"$FIFO"
|
||||||
kill -9 "$(cat "$PIDFILE" 2>/dev/null)" &> /dev/null
|
|
||||||
|
|
||||||
# Delete tempfiles, so we don't leave useless files behind.
|
|
||||||
rm -rf "$FONTPREVIEW_DIR"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
generate_preview(){
|
stop_ueberzug() {
|
||||||
# Credits: https://bit.ly/2UvLVhM
|
exec 3>&-
|
||||||
convert -size $SIZE xc:"$BG_COLOR" \
|
rm "$FIFO" "$IMAGE" >/dev/null 2>&1
|
||||||
-gravity center \
|
|
||||||
-pointsize $FONT_SIZE \
|
|
||||||
-font "$1" \
|
|
||||||
-fill "$FG_COLOR" \
|
|
||||||
-annotate +0+0 "$PREVIEW_TEXT" \
|
|
||||||
-flatten "$2"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
main(){
|
preview() {
|
||||||
# Checkig if needed dependencies are installed
|
# In fzf the cols and lines are those of the preview pane
|
||||||
dependencies=(sxiv convert fzf)
|
[ -f "$1" ] || fontfile=$(fc-match -f "%{file}" "$1")
|
||||||
for dependency in "${dependencies[@]}"; do
|
convert -size "$SIZE" xc:"$BG_COLOR" -fill "$FG_COLOR" \
|
||||||
type -p "$dependency" &>/dev/null || {
|
-pointsize "$FONT_SIZE" -font "$fontfile" -gravity center \
|
||||||
echo "error: Could not find '${dependency}', is it installed?" >&2
|
-annotate +0+0 "$PREVIEW_TEXT" "$IMAGE" &&
|
||||||
exit 1
|
{
|
||||||
}
|
printf "action\tadd\tidentifier\t%s\t" "$ID"
|
||||||
done
|
printf "x\t%d\ty\t%d\tpath\t%s\t" 2 1 "$IMAGE"
|
||||||
|
printf "width\t%d\theight\t%d\n" "$WIDTH" "$HEIGHT"
|
||||||
# Checking for enviornment variables which the user might have set.
|
} >"$FIFO" ||
|
||||||
# This config file for fontpreview is pretty much the bashrc, zshrc, etc
|
printf "action\tremove\tidentifier\t%s\n" "$ID" >"$FIFO"
|
||||||
# Majority of the variables in fontpreview can changed using the enviornment variables
|
|
||||||
# and this makes fontpreview very customizable
|
|
||||||
[[ $FONTPREVIEW_SEARCH_PROMPT != "" ]] && SEARCH_PROMPT=$FONTPREVIEW_SEARCH_PROMPT
|
|
||||||
[[ $FONTPREVIEW_SIZE != "" ]] && SIZE=$FONTPREVIEW_SIZE
|
|
||||||
[[ $FONTPREVIEW_POSITION != "" ]] && POSITION=$FONTPREVIEW_POSITION
|
|
||||||
[[ $FONTPREVIEW_FONT_SIZE != "" ]] && FONT_SIZE=$FONTPREVIEW_FONT_SIZE
|
|
||||||
[[ $FONTPREVIEW_BG_COLOR != "" ]] && BG_COLOR=$FONTPREVIEW_BG_COLOR
|
|
||||||
[[ $FONTPREVIEW_FG_COLOR != "" ]] && FG_COLOR=$FONTPREVIEW_FG_COLOR
|
|
||||||
[[ $FONTPREVIEW_PREVIEW_TEXT != "" ]] && PREVIEW_TEXT=$FONTPREVIEW_PREVIEW_TEXT
|
|
||||||
|
|
||||||
# Save the window ID of the terminal window fontpreview is executed in.
|
|
||||||
# This is so that when we open up sxiv, we can change the focus back to
|
|
||||||
# the terminal window, so that the user can search for the fonts without
|
|
||||||
# having to manualy change the focus back to the terminal.
|
|
||||||
|
|
||||||
# Flag to run some commands only once in the loop
|
|
||||||
FIRST_RUN=true
|
|
||||||
|
|
||||||
while true; do
|
|
||||||
# List out all the fonts which imagemagick is able to find, extract
|
|
||||||
# the font names and then pass them to fzf
|
|
||||||
font=$(convert -list font | awk -F: '/^[ ]*Font: /{print substr($NF,2)}' | fzf --prompt="$SEARCH_PROMPT")
|
|
||||||
|
|
||||||
# Exit if nothing is returned by fzf, which also means that the user
|
|
||||||
# has pressed [ESCAPE]
|
|
||||||
[[ -z $font ]] && return
|
|
||||||
|
|
||||||
generate_preview "$font" "$FONT_PREVIEW"
|
|
||||||
|
|
||||||
if [[ $FIRST_RUN == true ]]; then
|
|
||||||
FIRST_RUN=false
|
|
||||||
|
|
||||||
# Display the font preview using sxiv
|
|
||||||
#sxiv -g "$SIZE$POSITION" "$FONT_PREVIEW" -N "fontpreview" -b &
|
|
||||||
sxiv -N "fontpreview" -b -g "$SIZE$POSITION" "$FONT_PREVIEW" &
|
|
||||||
|
|
||||||
# Change focus from sxiv, back to the terminal window
|
|
||||||
# so that user can continue to search for fonts without
|
|
||||||
# having to manually change focus back to the terminal window
|
|
||||||
|
|
||||||
# Save the process ID so that we can kill
|
|
||||||
# sxiv when the user exits the script
|
|
||||||
echo $! >"$PIDFILE"
|
|
||||||
|
|
||||||
# Check for crashes of sxiv
|
|
||||||
elif [[ -f $PIDFILE ]] ; then
|
|
||||||
if ! pgrep -F "$PIDFILE" >/dev/null 2>&1; then
|
|
||||||
echo "Restart sxiv - You maybe using a obsolete version. " >&2
|
|
||||||
# Display the font preview using sxiv
|
|
||||||
sxiv -g "$SIZE$POSITION" -N "fontpreview" -b "$FONT_PREVIEW" &
|
|
||||||
|
|
||||||
# Change focus from sxiv, back to the terminal window
|
|
||||||
# so that user can continue to search for fonts without
|
|
||||||
# having to manually change focus back to the terminal window
|
|
||||||
|
|
||||||
# Save the process ID so that we can kill
|
|
||||||
# sxiv when the user exits the script
|
|
||||||
echo $! >"$PIDFILE"
|
|
||||||
fi
|
|
||||||
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Disable CTRL-Z because if we allowed this key press,
|
while getopts "hs:b:f:t:" arg; do
|
||||||
# then the script would exit but, sxiv would still be
|
case "$arg" in
|
||||||
# running
|
s) FONT_SIZE=$OPTARG ;;
|
||||||
trap "" SIGTSTP
|
b) BG_COLOR=$OPTARG ;;
|
||||||
|
f) FG_COLOR=$OPTARG ;;
|
||||||
trap pre_exit EXIT
|
t) PREVIEW_TEXT=$OPTARG ;;
|
||||||
|
*)
|
||||||
# Use mktemp to create a temporary directory that won't
|
usage
|
||||||
# collide with temporary files of other application.
|
exit
|
||||||
FONTPREVIEW_DIR="$(mktemp -d "${TMPDIR:-/tmp}/fontpreview_dir.XXXXXXXX")" || exit
|
;;
|
||||||
PIDFILE="$FONTPREVIEW_DIR/fontpreview.pid"
|
|
||||||
touch "$PIDFILE" || exit
|
|
||||||
FONT_PREVIEW="$FONTPREVIEW_DIR/fontpreview.png"
|
|
||||||
touch "$FONT_PREVIEW" || exit
|
|
||||||
TERMWIN_IDFILE="$FONTPREVIEW_DIR/fontpreview.termpid"
|
|
||||||
touch "$TERMWIN_IDFILE" || exit
|
|
||||||
|
|
||||||
font=$1
|
|
||||||
|
|
||||||
|
|
||||||
# Parse the arguments
|
|
||||||
options=$(getopt -o hi:o: --long position:,size:,version,search-prompt:,font-size:,bg-color:,fg-color:,preview-text:,input:,output:,help -- "$@")
|
|
||||||
eval set -- "$options"
|
|
||||||
|
|
||||||
while true; do
|
|
||||||
case "$1" in
|
|
||||||
--size)
|
|
||||||
shift
|
|
||||||
FONTPREVIEW_SIZE=$2
|
|
||||||
;;
|
|
||||||
--position)
|
|
||||||
shift
|
|
||||||
FONTPREVIEW_POSITION=$2
|
|
||||||
;;
|
|
||||||
-h|--help)
|
|
||||||
show_help
|
|
||||||
exit
|
|
||||||
;;
|
|
||||||
--version)
|
|
||||||
echo $VERSION
|
|
||||||
exit
|
|
||||||
;;
|
|
||||||
-i|--input)
|
|
||||||
input_file="$2"
|
|
||||||
;;
|
|
||||||
-o|--output)
|
|
||||||
output_file="$2"
|
|
||||||
;;
|
|
||||||
--search-prompt)
|
|
||||||
FONTPREVIEW_SEARCH_PROMPT=$2
|
|
||||||
;;
|
|
||||||
--font-size)
|
|
||||||
FONTPREVIEW_FONT_SIZE=$2
|
|
||||||
;;
|
|
||||||
--bg-color)
|
|
||||||
FONTPREVIEW_BG_COLOR=$2
|
|
||||||
;;
|
|
||||||
--fg-color)
|
|
||||||
FONTPREVIEW_FG_COLOR=$2
|
|
||||||
;;
|
|
||||||
--preview-text)
|
|
||||||
FONTPREVIEW_PREVIEW_TEXT=$2
|
|
||||||
;;
|
|
||||||
--)
|
|
||||||
shift
|
|
||||||
break
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
shift
|
|
||||||
done
|
done
|
||||||
|
shift $((OPTIND - 1))
|
||||||
|
|
||||||
|
if [ "$#" = 0 ]; then
|
||||||
# Point a font file to fontpreview and it will preview it.
|
trap stop_ueberzug EXIT QUIT INT TERM
|
||||||
# Example:
|
# Check if dependencies are installed
|
||||||
# $ fontpreview /path/to/fontFile.ttf
|
for dependency in ueberzug convert fzf fc-list; do
|
||||||
#
|
command -v "$dependency" >/dev/null 2>&1 ||
|
||||||
# This is useful because people can preview fonts which they have not
|
{
|
||||||
# installed onto their system. So if they want to preview a font file that
|
echo "Please install ${dependency}." >&2
|
||||||
# is in their Downloads directory, then they can easily preview it.
|
exit 1
|
||||||
if [ -f "$font" ]; then
|
}
|
||||||
generate_preview "$font" "$FONT_PREVIEW"
|
done
|
||||||
|
# Prepare
|
||||||
# Display the font preview using sxiv
|
start_ueberzug
|
||||||
sxiv -g "$SIZE$POSITION" -N "fontpreview" -b "$FONT_PREVIEW" &
|
# Export cli args as environment variables for preview command
|
||||||
|
export FONTPREVIEW_FONT_SIZE="$FONT_SIZE"
|
||||||
# For some strange reason, sxiv just doesnt have time to read the file
|
export FONTPREVIEW_BG_COLOR="$BG_COLOR"
|
||||||
sleep 0.1
|
export FONTPREVIEW_FG_COLOR="$FG_COLOR"
|
||||||
exit
|
export FONTPREVIEW_PREVIEW_TEXT="$PREVIEW_TEXT"
|
||||||
|
# The preview command runs this script again with an argument
|
||||||
|
fc-list -f "%{family}:%{style}\n" |
|
||||||
|
while IFS=: read -r family style; do
|
||||||
|
echo "${family%,*}${style:+:${style%,*}}"
|
||||||
|
done | sort | uniq |
|
||||||
|
fzf --reverse --cycle --preview "sh $0 {}" \
|
||||||
|
--preview-window "left:$((WIDTH / 2)):noborder:wrap"
|
||||||
|
elif [ "$#" = 1 ]; then
|
||||||
|
[ -p "$FIFO" ] && preview "$1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if the user gave an input file if they did, then create a preview
|
|
||||||
# and then save the preview to the current working directory
|
|
||||||
if [ "$input_file" != "" ] ; then
|
|
||||||
[ -z "$output_file" ] && output_file="${input_file}.png"
|
|
||||||
generate_preview "$input_file" "$output_file"
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
main
|
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
conectados=$(xrandr -q | awk '/ connected/ {count++} END {print count}')
|
conectados=$(xrandr -q | awk '/ connected/ {count++} END {print count}')
|
||||||
|
pri=$(xrandr -q | awk '/ connected/ {print $1}' | sed -sn 1p)
|
||||||
sec=$(xrandr -q | awk '/ connected/ {print $1}' | sed -sn 2p)
|
sec=$(xrandr -q | awk '/ connected/ {print $1}' | sed -sn 2p)
|
||||||
|
|
||||||
if [ "$conectados" = 1 ]; then
|
if [ "$conectados" = 1 ]; then
|
||||||
xrandr --output LVDS1 --primary --auto --scale 1.0x1.0 "$(xrandr -q | awk '/ disconnected/ {print "--output", $1, "--off"}' | paste -sd ' ')"
|
xrandr --output "$pri" --primary --auto --scale 1.0x1.0 "$(xrandr -q | awk '/ disconnected/ {print "--output", $1, "--off"}' | paste -sd ' ')"
|
||||||
randbg
|
|
||||||
elif [ "$conectados" = 2 ]; then
|
elif [ "$conectados" = 2 ]; then
|
||||||
xrandr --output LVDS1 --primary --auto --scale 1.0x1.0 --output "$sec" --right-of LVDS1 --auto --scale 1.0x1.0
|
xrandr --output "$pri" --primary --auto --scale 1.0x1.0 --output "$sec" --right-of "$pri" --auto --scale 1.0x1.0
|
||||||
randbg
|
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
xrandr --output LVDS1 --primary --auto --scale 1.0x1.0 "$(xrandr -q | awk '/ disconnected/ {print "--output", $1, "--off"}' | paste -sd ' ')"
|
pri=$(xrandr -q | awk '/ connected/ {print $1}' | sed -sn 1p)
|
||||||
|
|
||||||
|
xrandr --output "$pri" --primary --auto --scale 1.0x1.0 "$(xrandr -q | awk '/ disconnected/ {print "--output", $1, "--off"}' | paste -sd ' ')"
|
||||||
|
|
||||||
if [ -e /tmp/bspwm_0_0-socket ]; then
|
if [ -e /tmp/bspwm_0_0-socket ]; then
|
||||||
bspc config remove_disabled_monitors
|
bspc config remove_disabled_monitors
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
sudo xbps-install -Su
|
sudo xbps-install -Su
|
||||||
echo "Actualizando db..."
|
|
||||||
sudo updatedb
|
|
||||||
echo "Actualizando manpages..."
|
|
||||||
sudo makewhatis /usr/share/man
|
|
||||||
echo "Actualizando la lista de paquetes..."
|
echo "Actualizando la lista de paquetes..."
|
||||||
paclist
|
paclist
|
||||||
echo "Listo."
|
echo "Listo."
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
exec dunst
|
|
|
@ -1,3 +0,0 @@
|
||||||
#!/usr/bin/sh
|
|
||||||
|
|
||||||
exec unclutter --jitter 30 --timeout 3 --ignore-scrolling
|
|
|
@ -1 +0,0 @@
|
||||||
AddKeysToAgent yes
|
|
39
.zshenv
39
.zshenv
|
@ -8,7 +8,6 @@ fi
|
||||||
export VISUAL="$EDITOR"
|
export VISUAL="$EDITOR"
|
||||||
export GIT_EDITOR="$EDITOR"
|
export GIT_EDITOR="$EDITOR"
|
||||||
export TERMINAL="alacritty"
|
export TERMINAL="alacritty"
|
||||||
# export BROWSER="firefox"
|
|
||||||
export BROWSER="${${DISPLAY:-lynx}:+firefox}"
|
export BROWSER="${${DISPLAY:-lynx}:+firefox}"
|
||||||
export COLORTERM="truecolor"
|
export COLORTERM="truecolor"
|
||||||
export OPENER="xdg-open"
|
export OPENER="xdg-open"
|
||||||
|
@ -28,25 +27,25 @@ export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority"
|
||||||
export XDG_DATA_HOME="$HOME/.local/share"
|
export XDG_DATA_HOME="$HOME/.local/share"
|
||||||
export XDG_CONFIG_HOME="$HOME/.config"
|
export XDG_CONFIG_HOME="$HOME/.config"
|
||||||
export XDG_CACHE_HOME="$HOME/.cache"
|
export XDG_CACHE_HOME="$HOME/.cache"
|
||||||
export XINITRC="$XDG_CONFIG_HOME/X11/xinitrc"
|
export XINITRC="${XDG_CONFIG_HOME:-$HOME/.config}/X11/xinitrc"
|
||||||
export ZDOTDIR="$XDG_CONFIG_HOME/zsh"
|
export ZDOTDIR="${XDG_CONFIG_HOME:-$HOME/.config}/zsh"
|
||||||
|
|
||||||
export GPG_TTY=$(tty)
|
export GPG_TTY=$(tty)
|
||||||
export GNUPGHOME="$XDG_DATA_HOME/gnupg"
|
export GNUPGHOME="${XDG_DATA_HOME:-$HOME/.local/share}/gnupg"
|
||||||
export SSH_ASKPASS="/bin/gnome-ssh-askpass"
|
export SSH_ASKPASS="/bin/gnome-ssh-askpass"
|
||||||
export PASSWORD_STORE_DIR="$XDG_DATA_HOME/pass"
|
export PASSWORD_STORE_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/pass"
|
||||||
eval $(keychain --dir ~/.local/share/keychain --quiet --eval --noask --agents ssh,gpg id_rsa)
|
eval $(keychain --dir ~/.local/share/keychain --quiet --eval --noask --agents ssh,gpg id_rsa)
|
||||||
|
|
||||||
export NOTMUCH_CONFIG="$XDG_CONFIG_HOME/notmuch-config"
|
export NOTMUCH_CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/notmuch-config"
|
||||||
export WGETRC="$XDG_CONFIG_HOME/wget/wgetrc"
|
export WGETRC="${XDG_CONFIG_HOME:-$HOME/.config}/wget/wgetrc"
|
||||||
export WEECHAT_HOME="$XDG_CONFIG_HOME/weechat"
|
export WEECHAT_HOME="${XDG_CONFIG_HOME:-$HOME/.config}/weechat"
|
||||||
export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME/npm/npmrc"
|
export NPM_CONFIG_USERCONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/npm/npmrc"
|
||||||
export NODE_REPL_HISTORY="$XDG_DATA_HOME/node_repl_history"
|
export NODE_REPL_HISTORY="${XDG_DATA_HOME:-$HOME/.local/share}/node_repl_history"
|
||||||
export RANDFILE="$XDG_DATA_HOME/rnd"
|
export RANDFILE="${XDG_DATA_HOME:-$HOME/.local/share}/rnd"
|
||||||
export GOPATH="$XDG_DATA_HOME/go"
|
export GOPATH="${XDG_DATA_HOME:-$HOME/.local/share}/go"
|
||||||
export HISTFILE="$XDG_DATA_HOME/bash/history"
|
export HISTFILE="${XDG_DATA_HOME:-$HOME/.local/share}/bash/history"
|
||||||
|
|
||||||
_JAVA_OPTIONS="-Djava.util.prefs.userRoot=${XDG_DATA_HOME}/java "
|
_JAVA_OPTIONS="-Djava.util.prefs.userRoot=${XDG_DATA_HOME:-$HOME/.local/share}/java "
|
||||||
_JAVA_OPTIONS+="-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true "
|
_JAVA_OPTIONS+="-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true "
|
||||||
_JAVA_OPTIONS+="-Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel"
|
_JAVA_OPTIONS+="-Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel"
|
||||||
export _JAVA_OPTIONS
|
export _JAVA_OPTIONS
|
||||||
|
@ -54,21 +53,19 @@ export _JAVA_OPTIONS
|
||||||
eval "$(sed 's/^[^#].*/export &/g;t;d' ${DIR:-$XDG_CONFIG_HOME}/user-dirs.dirs)"
|
eval "$(sed 's/^[^#].*/export &/g;t;d' ${DIR:-$XDG_CONFIG_HOME}/user-dirs.dirs)"
|
||||||
# }}}
|
# }}}
|
||||||
# FZF {{{
|
# FZF {{{
|
||||||
export FZF_DEFAULT_COLORS='--color=dark,fg:-1,fg+:254,bg:-1,bg+:235,hl:33,hl+:33,info:8,border:1,prompt:4,pointer:3,marker:3,spinner:8,header:6'
|
export FZF_DEFAULT_OPTS="--cycle \
|
||||||
|
--color=bg:-1,hl:#5fff87,bg+:-1,hl+:#ffaf5f \
|
||||||
export FZF_DEFAULT_OPTS="$FZF_DEFAULT_COLORS \
|
--color=info:#af87ff,prompt:#5fff87,pointer:#ff87d7,marker:#ff87d7,spinner:#ff87d7 \
|
||||||
--extended \
|
|
||||||
--reverse \
|
--reverse \
|
||||||
--inline-info \
|
--inline-info \
|
||||||
--no-bold \
|
--no-bold \
|
||||||
--ansi \
|
--ansi \
|
||||||
--bind ctrl-f:page-down,ctrl-b:page-up \
|
--preview-window :wrap:noborder"
|
||||||
--preview-window wrap"
|
|
||||||
|
|
||||||
export FZF_DEFAULT_COMMAND="fd -t f -c always -H"
|
export FZF_DEFAULT_COMMAND="fd -t f -c always -H"
|
||||||
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
|
|
||||||
export FZF_COMPLETION_OPTS='+c -x'
|
export FZF_COMPLETION_OPTS='+c -x'
|
||||||
export FZF_CTRL_T_OPTS="--select-1 --exit-0 --preview 'bat --color=always {}'"
|
export FZF_CTRL_T_OPTS="--select-1 --exit-0 --preview 'bat --color=always {}'"
|
||||||
|
export FZF_CTRL_R_OPTS="--preview 'echo {}' --preview-window down:3:hidden:wrap --bind '?:toggle-preview'"
|
||||||
export FZF_VIM_LOG=$(git config --get alias.l | awk '{$1=""; print $0;}' | tr -d '\r')
|
export FZF_VIM_LOG=$(git config --get alias.l | awk '{$1=""; print $0;}' | tr -d '\r')
|
||||||
# }}}
|
# }}}
|
||||||
# Less {{{
|
# Less {{{
|
||||||
|
|
|
@ -11,6 +11,7 @@ alsa-plugins-samplerate
|
||||||
alsa-plugins-speex
|
alsa-plugins-speex
|
||||||
alsa-utils
|
alsa-utils
|
||||||
android-udev-rules
|
android-udev-rules
|
||||||
|
ansible
|
||||||
atool
|
atool
|
||||||
audacity
|
audacity
|
||||||
base-system
|
base-system
|
||||||
|
@ -63,8 +64,10 @@ keychain
|
||||||
klystrack
|
klystrack
|
||||||
krita
|
krita
|
||||||
lf
|
lf
|
||||||
|
libXfixes-devel
|
||||||
libXft-devel
|
libXft-devel
|
||||||
libXinerama-devel
|
libXinerama-devel
|
||||||
|
libXrandr-devel
|
||||||
libfluidsynth
|
libfluidsynth
|
||||||
libjack-32bit
|
libjack-32bit
|
||||||
libopenal
|
libopenal
|
||||||
|
@ -91,6 +94,7 @@ neovim
|
||||||
neovim-remote
|
neovim-remote
|
||||||
newsboat
|
newsboat
|
||||||
nfs-utils
|
nfs-utils
|
||||||
|
nftables
|
||||||
nodejs
|
nodejs
|
||||||
notmuch
|
notmuch
|
||||||
noto-fonts-cjk
|
noto-fonts-cjk
|
||||||
|
@ -110,8 +114,11 @@ powertop
|
||||||
pulseaudio
|
pulseaudio
|
||||||
pulsemixer
|
pulsemixer
|
||||||
python3
|
python3
|
||||||
|
python3-ansible-lint
|
||||||
python3-pip
|
python3-pip
|
||||||
ripgrep
|
ripgrep
|
||||||
|
rkhunter
|
||||||
|
runit-nftables
|
||||||
setxkbmap
|
setxkbmap
|
||||||
shellcheck
|
shellcheck
|
||||||
shfmt
|
shfmt
|
||||||
|
@ -127,10 +134,12 @@ tmux
|
||||||
toilet
|
toilet
|
||||||
transmission
|
transmission
|
||||||
udevil
|
udevil
|
||||||
|
ueberzug
|
||||||
unclutter-xfixes
|
unclutter-xfixes
|
||||||
unrar
|
unrar
|
||||||
unzip
|
unzip
|
||||||
vice
|
vice
|
||||||
|
vifm
|
||||||
void-repo-multilib
|
void-repo-multilib
|
||||||
void-repo-nonfree
|
void-repo-nonfree
|
||||||
vsv
|
vsv
|
||||||
|
|
Reference in New Issue