dgy
/
hexagons
Archived
1
0
Fork 0

zsh: pelado, pulido, emprolijado. dunst: ponerse al dia. newsboat: ya esta completo. bin: agregar bandcamp-dl, transmission, fzf, y corregir errores. mutt: ponerse al dia con el wizard.

This commit is contained in:
deadguy 2019-04-29 14:32:59 -03:00
parent e6ef260de7
commit 794bf1b2d8
Signed by: dgy
GPG Key ID: 37CA55B52CF63730
37 changed files with 312 additions and 656 deletions

View File

@ -86,4 +86,3 @@ bspc rule -a Termite:multi desktop='^1'
# scripts utiles
setbg &
unclutter &
bspborders

View File

@ -1,14 +1,14 @@
[global]
font = IBM Plex Sans 9
font = Noto Sans 9.5
markup = full
format = "%s \n%b"
sort = yes # Sort messages by urgency.
indicate_hidden = no # Show how many messages are hidden.
alignment = right # Message alignment: "left" "center" "right".
bounce_freq = 0 # Always set to 0
format = "<b>%s</b>\n%b"
sort = yes
indicate_hidden = no
alignment = left
bounce_freq = 0
show_age_threshold = -1
word_wrap = yes # Split into multiple lines
ignore_newline = no # Ignore newlines '\n' in notifications.
word_wrap = no
ignore_newline = no
# The geometry of the window:
# [{width}]x{height}[+/-{x}+/-{y}]
@ -22,7 +22,7 @@
# the top and down respectively.
# The width can be negative. In this case the actual width is the
# screen width minus the width defined in within the geometry option.
geometry = "400x8-10+31"
geometry = "0x8-10+31"
title = Dunst # Define window title
class = Dunst # Define window class
@ -58,7 +58,7 @@
separator_color = frame
startup_notification = false
dmenu = /usr/bin/rofi -p 'dunst: ' -dmenu
dmenu = /usr/bin/dmenu
browser = /usr/bin/firefox -new-tab
icon_position = right # Align icons left/right/off
max_icon_size = 0

View File

@ -4,7 +4,7 @@
include "/home/deadguy/.gtkrc-2.0.mine"
gtk-theme-name="8088"
gtk-icon-theme-name="ArchLabs-Light"
gtk-font-name="IBM Plex Sans weight=453 9"
gtk-font-name="Noto Sans Display 10"
gtk-cursor-theme-name="Alkano"
gtk-cursor-theme-size=0
gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ

View File

@ -3,7 +3,7 @@ gtk-application-prefer-dark-theme=1
gtk-cursor-theme-name=Alkano
gtk-theme-name=8088
gtk-icon-theme-name=ArchLabs-Light
gtk-font-name=IBM Plex Sans weight=453 9
gtk-font-name=Noto Sans Display 10
gtk-cursor-theme-size=0
gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ
gtk-toolbar-icon-size=GTK_ICON_SIZE_SMALL_TOOLBAR

View File

@ -12,8 +12,7 @@ application/pdf; zathura %s & disown; test=test -n "$DISPLAY"
# Autoview html
#text/html; w3m -I %{charset} -T text/html; copiousoutput
#text/html; ~/.config/mutt/etc/view_attachment.sh %s html; test=test -n "$DISPLAY"
text/html; "$BROWSER" %s 2>/dev/null & disown; test=test -n "$DISPLAY"; needsterminal
text/html; "$BROWSER" %s 2>/dev/null & disown; test=test -n "$DISPLAY"; needsterminal
text/html; w3m %s; nametemplate=%s.html; needsterminal
text/html; w3m -v -F -T text/html -dump %s; copiousoutput
text/plain; less %s; edit=nvim; compose=nvim; needsterminal

View File

@ -5,7 +5,6 @@ macro index,pager i1 '<sync-mailbox><enter-command>source /home/deadguy/.config/
macro index,pager i2 '<sync-mailbox><enter-command>source /home/deadguy/.config/mutt/accounts/2-alejo.muttrc<enter><change-folder>!<enter>;<check-stats>' "switch to alejo.jardon@gmail.com" # mw-autogenerated
macro index,pager i3 '<sync-mailbox><enter-command>source /home/deadguy/.config/mutt/accounts/3-zeta.muttrc<enter><change-folder>!<enter>;<check-stats>' "switch to iamz@airmail.cc" # mw-autogenerated
set mailcap_path = ~/.config/mutt/mailcap
source "~/.config/mutt/gpg.rc"
macro index O "<shell-escape>correo -Va<enter>" "run offlineimap to sync all mail"
@ -30,7 +29,6 @@ set uncollapse_jump # no collapse on unread message
set sort_re # thread based on regex
set reply_regexp = "^(([Rr][Ee]?(\[[0-9]+\])?: *)?(\[[^]]+\] *)?)*"
set quote_regexp = "^( {0,4}[>|:#%]| {0,4}[a-z0-9]+[>|]+)+"
set new_mail_command="notify-send -a neomutt -u normal 'You Got Mail' '%n new messages, %u unread.' &"
set date_format ="%a %d %b %R"
set alias_format = " %4n %t %-20a %r "
set autoedit ## Skip directly to composing

View File

@ -26,13 +26,9 @@ statusbar_color = magenta
empty_tag_color = blue
state_flags_color = red
# HEADER
alternative_header_first_line_format = "$8$aqqu$/a$b {%t}|{%f} $/b$8$atqq$/a$9"
alternative_header_second_line_format = "{{$8%a}{$8 - %b$9}{$8 (%y)$8}}|{%D$9}"
# SONG
song_list_format = "$5%n {$8%t}|{$2►$2<untitled>}|{$5►$8 %f} $5$R{$4%a}|{$8<unknown artist>} {$7 %l}"
song_status_format = {$8%t}{$8 "%b"}|{$6 "%a"}$8
song_list_format = "$5%n {$8%t}|{$2►$2<untitled>}|{$5►$8 %f} $R$5{$4%a}|{$8<unknown artist>} {$7 %l}"
song_status_format = {$8%t}{$8 "%b"}|{$6 "%a"}$8
song_window_title_format = "{%a - }{%t}{ [%b]}|{%f}"
song_columns_list_format = "(30)[blue]{a} (40)[red]{t|f} (30)[cyan]{br} (4f)[green]{lr}"
@ -53,7 +49,7 @@ progressbar_color = blue
progressbar_elapsed_color = blue
# VIEWS
user_interface = classic
user_interface = alternative
playlist_display_mode = classic
browser_display_mode = classic
search_engine_display_mode = columns

View File

@ -1,26 +1,28 @@
# opciones basicas
refresh-on-startup yes
always-display-description true
refresh-on-startup no
always-display-description yes
display-article-progress yes
text-width 80
auto-reload yes
# formatos
articlelist-format "%4i %S %f (%D) %6L %?T? %-17T; ?%t"
feedlist-format "%4i %n %S %11u %t"
feedlist-title-format "%N: (%u/%t) Feeds"
articlelist-title-format "%N: (%u/%t) %T [%U]"
searchresult-title-format "%N: (%u/%t) Search"
filebrowser-title-format "%N: %f %?O?Open File&Save File?"
help-title-format "%N: Help"
selecttag-title-format "%N: Select Tag"
selectfilter-title-format "%N: Select Filter"
itemview-title-format "%N: %T"
urlview-title-format "%N: URLs"
dialogs-title-format "%N: Dialogs"
notify-format "%n Articulos no leidos"
articlelist-format " %t %> %D %L "
feedlist-format "%S %n %11u %t %d"
datetime-format "%Y-%m-%d"
feedlist-title-format "Feeds: %u sin leer, %t total"
articlelist-title-format "%T [%U] (%u sin leer, %t total)"
searchresult-title-format "Search (%u sin leer, %t total)"
filebrowser-title-format "%f %?O?Open File&Save File?"
help-title-format "Ayuda"
selecttag-title-format "Elegir Etiqueta"
selectfilter-title-format "Elegir Filtro"
itemview-title-format "%T"
urlview-title-format "URLs"
dialogs-title-format "Dialogs"
notify-format "%d Articulos nuevos. %n Articulos no leidos"
# teclas
unbind-key SPACE
bind-key j down
bind-key k up
bind-key J next-feed articlelist
@ -39,6 +41,7 @@ bind-key U show-urls
bind-key x pb-delete
bind-key ^t next-unread
bind-key / open-search
bind-key SPACE macro-prefix
# colores
color listnormal cyan default
@ -63,17 +66,18 @@ notify-program "notify-send"
browser linkhandler
player mpv
save-path ~/.config/newsboat/saved
html-renderer "w3m -dump -T text/html"
#html-renderer "w3m -dump -T text/html"
# macros con prefijo
macro , open-in-browser
macro t set browser "transmission-remote --add %u"; open-in-browser ; set browser linkhandler
macro d set browser "tsp youtube-dl --add-metadata -ic"; open-in-browser ; set browser linkhandler
macro a set browser "tsp youtube-dl --add-metadata -xic -f bestaudio/best"; open-in-browser ; set browser linkhandler
macro d set browser "tsp ytdl"; open-in-browser ; set browser linkhandler
macro a set browser "tsp bandcamp"; 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 && tmux send-keys '$w3m %u && tmux kill-pane\n'"; open-in-browser ; set browser linkhandler
macro r set browser "tmux split-window && tmux send-keys 'rtv -l %u && tmux kill-pane\n'"; open-in-browser ; set browser linkhandler
macro s set browser "tmux split-window && tmux send-keys 'ranger ~/.config/newsboat/saved && tmux kill-pane\n'" ; open-in-browser ; set browser linkhandler
macro c set browser "xsel -b <<<" ; open-in-browser ; set browser linkandler
macro f set browser "firefox -new-tab" ; open-in-browser ; set browser linkandler
# vim: ft=conf cms=#%s

View File

@ -1,50 +1,43 @@
-------COMICS------------
https://www.questionablecontent.net/QCRSS.xml "~Questionable Content"
http://www.empoweredcomic.com/comic/rss "~Empowered"
https://www.questionablecontent.net/QCRSS.xml "~Questionable Content" comics
http://www.empoweredcomic.com/comic/rss "~Empowered" comics
-------BLOGS------------
https://chiptuneswin.com/blog/feed/ "~Chiptunes=WIN"
https://vimways.org/index.xml "Vimways"
https://chiptuneswin.com/blog/feed/ "~Chiptunes=WIN" blogs
https://vimways.org/index.xml "~Vimways" blogs
-------YOUTUBE-----------
https://www.youtube.com/feeds/videos.xml?channel_id=UCVls1GmFKf6WlTraIb_IaJg "~DistroTube"
https://www.youtube.com/feeds/videos.xml?user=gotbletu "~Gotbletu"
https://www.youtube.com/feeds/videos.xml?channel_id=UC2eYFnH61tmytImy1mTYvhA "~Luke Smith"
https://www.youtube.com/feeds/videos.xml?user=JtheLinuxguy "~Learn Linux"
https://www.youtube.com/feeds/videos.xml?user=moviebob "~Moviebob"
https://www.youtube.com/feeds/videos.xml?playlist_id=PLXleEiD94A2d6WdmDU0h7dXJg8scAaZ9U "~Moviebob Reviews"
https://www.youtube.com/feeds/videos.xml?channel_id=UCu8YylsPiu9XfaQC74Hr_Gw "~Seth's Bike Hacks"
https://www.youtube.com/feeds/videos.xml?channel_id=UCXKYjkimgemQuuNP-JRTz2Q "~Mundo Ciclismo TV"
https://www.youtube.com/feeds/videos.xml?user=tvmultimediacine "~Ruta Cleta"
https://www.youtube.com/feeds/videos.xml?user=GRGE2MB "~GRGE"
https://www.youtube.com/feeds/videos.xml?channel_id=UCSBUDr3oUg9y7YS1TZL_Jeg "~Wubbix"
https://www.youtube.com/feeds/videos.xml?user=olbaidoinomed "~Olbaid"
https://www.youtube.com/feeds/videos.xml?channel_id=UCq297H7Ca98HlB5mVFHGSsQ "~Reaper Mania"
https://www.youtube.com/feeds/videos.xml?channel_id=UCMUHt6JzCMsdtvkaJpU3KXw "~Reaper TV"
https://www.youtube.com/feeds/videos.xml?channel_id=UCVls1GmFKf6WlTraIb_IaJg "~DistroTube" youtube
https://www.youtube.com/feeds/videos.xml?user=gotbletu "~Gotbletu" youtube
https://www.youtube.com/feeds/videos.xml?channel_id=UC2eYFnH61tmytImy1mTYvhA "~Luke Smith" youtube
https://www.youtube.com/feeds/videos.xml?user=JtheLinuxguy "~Learn Linux" youtube
https://www.youtube.com/feeds/videos.xml?channel_id=UCi8XrDg1bK_MJ0goOnbpTMQ "~BudLabs" youtube
https://www.youtube.com/feeds/videos.xml?user=moviebob "~Moviebob" youtube
https://www.youtube.com/feeds/videos.xml?playlist_id=PLXleEiD94A2d6WdmDU0h7dXJg8scAaZ9U "~Moviebob Reviews" youtube
https://www.youtube.com/feeds/videos.xml?channel_id=UCu8YylsPiu9XfaQC74Hr_Gw "~Seth's Bike Hacks" youtube
https://www.youtube.com/feeds/videos.xml?channel_id=UCXKYjkimgemQuuNP-JRTz2Q "~Mundo Ciclismo TV" youtube
https://www.youtube.com/feeds/videos.xml?user=tvmultimediacine "~Ruta Cleta" youtube
https://www.youtube.com/feeds/videos.xml?channel_id=UCq297H7Ca98HlB5mVFHGSsQ "~Reaper Mania" youtube
https://www.youtube.com/feeds/videos.xml?channel_id=UCMUHt6JzCMsdtvkaJpU3KXw "~Reaper TV" youtube
https://www.youtube.com/feeds/videos.xml?user=GRGE2MB "~GRGE" youtube
https://www.youtube.com/feeds/videos.xml?channel_id=UCSBUDr3oUg9y7YS1TZL_Jeg "~Wubbix" youtube
https://www.youtube.com/feeds/videos.xml?user=olbaidoinomed "~Olbaid" youtube
-------REDDIT------------
https://www.reddit.com/r/unixporn.rss "~Unixporn"
https://www.reddit.com/r/zsh.rss "~Zsh"
https://www.reddit.com/r/bspwm.rss "~Bspwm"
https://www.reddit.com/r/linuxaudio.rss "~Linux Audio"
https://www.reddit.com/r/vimporn.rss "~Vim Porn"
https://www.reddit.com/r/unixart.rss "~Unix Art"
https://www.reddit.com/r/vim.rss "~Vim"
https://www.reddit.com/r/commandline.rss "~REDDIT: r/commandline"
https://www.reddit.com/r/awesomewm.rss "~Awesome WM"
https://www.reddit.com/r/learnprogramming.rss "~Learn Programming"
https://www.reddit.com/r/chiptunes.rss "~Chiptunes"
https://www.reddit.com/r/jungle.rss "~Jungle"
https://www.reddit.com/r/breakcore.rss "~Breakcore"
https://www.reddit.com/r/vaporwave.rss "~Vaporwave"
https://www.reddit.com/r/outrun.rss "~OutRun"
https://www.reddit.com/r/algorave.rss "~Algorave"
https://www.reddit.com/r/livecoding.rss "~Livecoding"
https://www.reddit.com/r/argentina.rss "~Argentina"
https://www.reddit.com/r/argentina.rss "~Argentina" reddit
https://www.reddit.com/r/zsh.rss "~Zsh" reddit
https://www.reddit.com/r/bspwm.rss "~Bspwm" reddit
https://www.reddit.com/r/linuxaudio.rss "~Linux Audio" reddit
https://www.reddit.com/r/vimporn.rss "~Vim Porn" reddit
https://www.reddit.com/r/unixart.rss "~Unix Art" reddit
https://www.reddit.com/r/vim.rss "~Vim" reddit
https://www.reddit.com/r/commandline.rss "~Command line" reddit
https://www.reddit.com/r/awesomewm.rss "~Awesome WM" reddit
https://www.reddit.com/r/learnprogramming.rss "~Learn Programming" reddit
https://www.reddit.com/r/chiptunes.rss "~Chiptunes" reddit
https://www.reddit.com/r/jungle.rss "~Jungle" reddit
https://www.reddit.com/r/breakcore.rss "~Breakcore" reddit
https://www.reddit.com/r/vaporwave.rss "~Vaporwave" reddit
https://www.reddit.com/r/outrun.rss "~OutRun" reddit
https://www.reddit.com/r/algorave.rss "~Algorave" reddit
https://www.reddit.com/r/livecoding.rss "~Livecoding" reddit

View File

@ -27,11 +27,11 @@ Plug 'junegunn/vim-plug'
" UI
Plug 'junegunn/seoul256.vim'
Plug 'zefei/vim-wintabs'
Plug 'jiangmiao/auto-pairs'
" Languages
Plug 'lervag/vimtex', { 'for': 'tex' }
Plug 'plasticboy/vim-markdown', { 'for': 'markdown' }
" Formatting
Plug 'tmsvg/pear-tree'
Plug 'w0rp/ale'
Plug 'sbdchd/neoformat', {'on': 'Neoformat'}
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }

View File

@ -85,9 +85,6 @@ super + {F2,F3,F4,F5,F6}
{pila,tapa,notifocus,grabar,corte}
# Media Keys
XF86Audio{RaiseVolume,LowerVolume,Mute}
volumen {up,down,mute}
XF86Audio{Prev,Next}
mpc -q {prev,next}

View File

@ -12,29 +12,13 @@ clickable_url = true
scrollback_lines = -10000
search_wrap = true
scrollbar = off
#font = Tamzen, Migu 1M Regular 10.85
font = BlexMono Nerd Font, Migu 1M 9
#font = Monaco Regular 8
# "system", "on" or "off"
font = NotoSansMono Nerd Font Regular 9.5
cursor_blink = off
# "block", "underline" or "ibeam"
cursor_shape = underline
# $BROWSER is used by default if set, with xdg-open as a fallback
browser = firefox
# set size hints for the window
size_hints = false
# Hide links that are no longer valid in url select overlay mode
filter_unmatched_urls = true
# emit escape sequences for extra modified keys
#modify_other_keys = false
[colors]
# special
@ -53,7 +37,7 @@ color9 = #fb4934
# green
color2 = #407e4a
color10 = #98971a
color10 = #8fc13e
# yellow
color3 = #d79921
@ -69,15 +53,13 @@ color13 = #d3869b
# cyan
color6 = #689d64
color14 = #8ec07c
color14 = #149b93
# white
color7 = #a89984
color15 = #c9c9c9
[hints]
padding = 4
# vim: ft=dosini cms=#%s
# syntax:ssHash
# vim: ft=dosini cms=#%s

View File

@ -23,7 +23,7 @@ alias surfraw='surfraw -browser=$BROWSER'
alias foxy='FoxDot & disown'
alias bm='bashmount'
alias kat='cat'
alias nb='newsboat'
alias nb='newsboat --quiet'
# MAXIMUM VERBOSITY YIELDS MAXIMUM RESULTS
alias chmod='chmod -v'
@ -40,8 +40,7 @@ alias umount='umount -v'
# Con opciones por defecto
alias cat='bat --style=numbers,changes,header --color=always'
alias buscar='fd -H --color=always'
alias donde='bfs -x'
alias buscar="rg --color='always' --heading --line-number --no-messages --no-ignore --hidden --follow --smart-case --glob '!.git/' --glob '!node_modules/' --regexp"
alias ncdu='ncdu --color dark -rr -x --exclude .git'
alias ls='ls -Ft --color=always --group-directories-first'
alias lst='ls -FAghoBtH --group-directories-first --dereference-command-line-symlink-to-dir --time-style=+"%d-%m-%Y %H:%M"'
@ -69,4 +68,6 @@ alias path='echo -e ${PATH//:/\\n}'
alias compare='grep -nFxvf'
alias pwn='chmod +x'
alias ta='tmux attach -t'
alias tk='tmux kill-session -t'
alias tk='tmux kill-session -t'
alias tsq='killall transmission-daemon 2> /dev/null'
alias tsl='transmission-remote --list'

View File

@ -30,19 +30,10 @@ if [[ $COMPLETION_WAITING_DOTS = true ]]; then
bindkey "^I" expand-or-complete-with-dots
fi
# }}}
# Pacman {{{
files() { pacman -Ql "$1" ;} # list files owned by package
explicit() { sudo pacman -D --asexplicit "$@" ;} # mark package as explicitly installed
# }}}
# FFF {{{
f() { fff "$@" }
cd "$(cat "${XDG_CACHE_HOME:=${HOME}/.cache}/fff/.fff_d")"
# }}}
# Handle trash {{{
trash-empty() { gio trash --empty }
trash() { gio trash -f $@ }
trash-ls() { gio list -h trash:// }
# }}}
# Prevent ranger nesting {{{
ranger() {
if [ -z "$RANGER_LEVEL" ]; then

View File

@ -8,13 +8,6 @@ export FZF_DEFAULT_OPTS="$FZF_DEFAULT_COLORS \
--preview-window wrap \
"
export FZF_COMPLETION_OPTS='+c -x'
if type rg &>/dev/null; then
export FZF_DEFAULT_COMMAND='rg --follow --hidden --files --glob "!.git/*" --glob "!node_modules/*" 2> /dev/null'
elif type ag &>/dev/null; then
export FZF_DEFAULT_COMMAND='ag -f -g "" --hidden --depth 16 --ignore dosdevices 2> /dev/null'
fi
_fzf_compgen_path() {
fd --hidden --follow --exclude ".git" . "$1"
}
@ -23,137 +16,13 @@ _fzf_compgen_dir() {
fd --type d --hidden --follow --exclude ".git" . "$1"
}
export FZF_DEFAULT_COMMAND='rg --files --no-ignore --hidden --follow -g "!{.git,node_modules}/*" 2> /dev/null'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
export FZF_ALT_C_COMMAND="bfs -type d -nohidden"
export FZF_COMPLETION_OPTS='+c -x'
export FZF_CTRL_T_OPTS="--select-1 --exit-0 --preview '(highlight -O ansi -l {} || bat --color \"always\" {} || tree -C {}) 2> /dev/null | head -200'"
export FZF_CTRL_R_OPTS="--preview 'echo {}' --preview-window down:3:hidden:wrap --bind '?:toggle-preview'"
export FZF_ALT_C_OPTS="--select-1 --exit-0 --preview 'tree -C {} | head -200'"
export FZF_VIM_LOG=$(git config --get alias.l | awk '{$1=""; print $0;}' | tr -d '\r')
command -v tree > /dev/null && export FZF_ALT_C_OPTS="--preview 'tree -C {} | head -$LINES'"
fl() { xdg-open "$(locate "*" | fzf -e)" ;}
# git logs, hash, and diff with fzf {{{
fshow() {
git log --graph --color=always \
--format="%C(auto)%h%d %s %C(black)%C(bold)%cr" "$@" |
fzf --ansi --preview "echo {} | grep -o '[a-f0-9]\{7\}' | head -1 | xargs -I % sh -c 'git show --color=always %'" \
--bind "enter:execute:
(grep -o '[a-f0-9]\{7\}' | head -1 |
xargs -I % sh -c 'git show --color=always % | less -R') << 'FZF-EOF'
{}
FZF-EOF"
}
g-open() {
project=$(git config --local remote.origin.url | sed s/git@github.com\:// | sed s/\.git//)
url="http://github.com/$project/commit/$1"
xdg-open $url
}
# }}}
# tls - tmux session control with fzf {{{
tls() {
[[ -n "$TMUX" ]] && change="switch-client" || change="attach-session"
if [ $1 ]; then
tmux $change -t "$1" 2>/dev/null || (tmux new-session -d -s $1 && tmux $change -t "$1"); return
fi
session=$(tmux list-sessions -F "#{session_name}" 2>/dev/null | fzf --exit-0) && tmux $change -t "$session" || echo "No sessions found."
}
# }}}
# fv - open any file in nvim or sublime {{{
fv() {
IFS=$'\n' out=($(fzf --query="$1" --exit-0 --expect=ctrl-g,ctrl-e))
key=$(head -1 <<< "$out")
file=$(head -2 <<< "$out" | tail -1)
if [ -n "$file" ]; then
[ "$key" = ctrl-g ] && subl "$file" || $EDITOR "$file"
fi
}
# }}}
# fk - kill process using fzf {{{
fk() {
local pid
pid=$( pstree -T -p -a | fzf -e -m -i +s --margin=4%,1%,1%,2% --inline-info --header="TAB to (un)select. ENTER to kill. ESC or CTRL+C to quit." --prompt='Process name > ' | awk -F ',' '{print $NF}' | awk '{print $1}' )
if [ "x$pid" != "x" ];
then
echo "$pid" | xargs kill -${1:-9}
fi
}
# }}}
# fh - repeat history {{{
fh() {
print -z $( ([ -n "$ZSH_NAME" ] && fc -l 1 || history) | fzf +s --tac | sed 's/ *[0-9]* *//')
}
# }}}
# fasd with fzf {{{
ff() {
local selected_path=$(
fasd -l -d \
| sed "s#$HOME#~#" \
| fzf \
--tac \
--no-sort \
--exact \
--prompt='cd ' \
--preview-window='right:60%' \
--preview='eval ls -l --si --almost-all --classify --color=always --group-directories-first --literal {} 2>/dev/null'
)
eval cd "$selected_path"
}
# }}}
# Bookmark manager. @param {string} [$1] Defined bookmark string. {{{
b() {
# Bookmarks
local -A bookmarks=(
'e' '~/Desktop/'
'd' '~/Documents/'
'w' '~/Downloads/'
'i' '~/Pictures/'
'p' '~/Projects/'
'v' '~/Videos/'
)
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 \
--exact \
--height='30%' \
--preview='eval ls -l --si --almost-all --classify --color=always --group-directories-first --literal {2} 2>/dev/null' \
--preview-window='right:60%' \
)
selected_bookmark="${selected_bookmark[(ws: :)2]}"
}
}
if [[ "$selected_bookmark" != '' ]] {
eval cd "$selected_bookmark"
} else {
return 1
}
}
# }}}

View File

@ -1,121 +0,0 @@
alias g='git'
alias ga='git add'
alias gaa='git add --all'
alias gapa='git add --patch'
alias gau='git add --update'
alias gap='git apply'
alias gb='git branch'
alias gba='git branch -a'
alias gbd='git branch -d'
alias gbda='git branch --no-color --merged | command grep -vE "^(\*|\s*(master|develop|dev)\s*$)" | command xargs -n 1 git branch -d'
alias gbl='git blame -b -w'
alias gbnm='git branch --no-merged'
alias gbr='git branch --remote'
alias gbs='git bisect'
alias gbsb='git bisect bad'
alias gbsg='git bisect good'
alias gbsr='git bisect reset'
alias gbss='git bisect start'
alias gc='git commit -v'
alias gc!='git commit -v --amend'
alias gcn!='git commit -v --no-edit --amend'
alias gca='git commit -v -a'
alias gca!='git commit -v -a --amend'
alias gcan!='git commit -v -a --no-edit --amend'
alias gcans!='git commit -v -a -s --no-edit --amend'
alias gcam='git commit -a -m'
alias gcsm='git commit -s -m'
alias gcb='git checkout -b'
alias gcf='git config --list'
alias gcl='git clone --recursive'
alias gclean='git clean -fd'
alias gpristine='git reset --hard && git clean -dfx'
alias gcm='git checkout master'
alias gcd='git checkout develop'
alias gcmsg='git commit -m'
alias gco='git checkout'
alias gcp='git cherry-pick'
alias gcpa='git cherry-pick --abort'
alias gcpc='git cherry-pick --continue'
alias gcs='git commit -S'
alias gd='git diff --color | diff-so-fancy'
alias gdca='git diff --cached'
alias gdcw='git diff --cached --word-diff'
alias gdct='git describe --tags `git rev-list --tags --max-count=1`'
alias gdt='git diff-tree --no-commit-id --name-only -r'
alias gdw='git diff --word-diff'
alias gf='git fetch'
alias gfa='git fetch --all --prune'
alias gfo='git fetch origin'
alias gg='git gui citool'
alias gga='git gui citool --amend'
alias ggsup='git branch --set-upstream-to=origin/$(git_current_branch)'
alias gpsup='git push --set-upstream origin $(git_current_branch)'
alias ghh='git help'
alias gignore='git update-index --assume-unchanged'
alias gignored='git ls-files -v | grep "^[[:lower:]]"'
alias gl='git pull'
alias glg='git log --stat'
alias glgp='git log --stat -p'
alias glgg='git log --graph'
alias glgga='git log --graph --decorate --all'
alias glgm='git log --graph --max-count=10'
alias glo='git log --oneline --decorate'
alias glol="git log --graph --pretty='%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'"
alias glod="git log --graph --pretty='%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset'"
alias glods="git log --graph --pretty='%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset' --date=short"
alias glola="git log --graph --pretty='%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --all"
alias glog='git log --oneline --decorate --graph'
alias gloga='git log --oneline --decorate --graph --all'
alias gm='git merge'
alias gmom='git merge origin/master'
alias gmt='git mergetool --no-prompt'
alias gmtvim='git mergetool --no-prompt --tool=vimdiff'
alias gmum='git merge upstream/master'
alias gma='git merge --abort'
alias gp='git push'
alias gpd='git push --dry-run'
alias gpu='git push upstream'
alias gpv='git push -v'
alias gr='git remote'
alias gra='git remote add'
alias grb='git rebase'
alias grba='git rebase --abort'
alias grbc='git rebase --continue'
alias grbd='git rebase develop'
alias grbi='git rebase -i'
alias grbm='git rebase master'
alias grbs='git rebase --skip'
alias grh='git reset'
alias grhh='git reset --hard'
alias grmv='git remote rename'
alias grrm='git remote remove'
alias grset='git remote set-url'
alias grt='cd $(git rev-parse --show-toplevel || echo ".")'
alias gru='git reset --'
alias grup='git remote update'
alias grv='git remote -v'
alias gsb='git status -sb'
alias gsd='git svn dcommit'
alias gsi='git submodule init'
alias gsps='git show --pretty=short --show-signature'
alias gsr='git svn rebase'
alias gss='git status -s'
alias gst='git status'
alias gsta='git stash save'
alias gstaa='git stash apply'
alias gstc='git stash clear'
alias gstd='git stash drop'
alias gstl='git stash list'
alias gstp='git stash pop'
alias gsts='git stash show --text'
alias gsu='git submodule update'
alias gts='git tag -s'
alias gtv='git tag | sort -V'
alias gunignore='git update-index --no-assume-unchanged'
alias gunwip='git log -n 1 | grep -q -c "\-\-wip\-\-" && git reset HEAD~1'
alias gup='git pull --rebase'
alias gupv='git pull --rebase -v'
alias glum='git pull upstream master'
alias gwch='git whatchanged -p --abbrev-commit --pretty=medium'
alias gwip='git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify -m "--wip-- [skip ci]"'

View File

@ -266,10 +266,10 @@ formats = {
whois_extra = "%y│ %wextr%b %|$1";
end_of_whois = "%y└─┄┄ ";
whois_not_found = "%y──┄┄ %wthere is no such nick %b$0";
topic = " ";
topic_info = " %wtopic set by %b$0 %B(%w$1%B)";
channel_synced = "%n %N sync %n{hilight $1} secs%: ";
channel_created = " %n created %n$1";
topic = " ";
topic_info = " ";
channel_synced = " ";
channel_created = " ";
log_day_changed = "%y ┌─┄┄─────┘%n\\012%y │ It is now %A %d %b %Y\\012%y └─┄┄─┄┄──┐ ";
own_action = "{ownaction $[-11]0} $1";

View File

@ -43,7 +43,7 @@ configuration {
line-padding: 2;
separator-style: "none";
hide-scrollbar: "true";
font: "IBM Plex Sans 10";
font: "Noto Sans 10";
margin: 0;
padding: 0;
}

32
.zshenv
View File

@ -15,8 +15,11 @@ export QT_QPA_PLATFORMTHEME=qt5ct
export SSH_ASKPASS="/usr/lib/seahorse/ssh-askpass"
export GTK2_RC_FILES="$HOME/.config/gtk-2.0/gtkrc-2.0"
export NOTMUCH_CONFIG="$HOME/.config/notmuch-config"
export RTV_BROWSER="$HOME/bin/linkhandler"
export MAILCAPS="$HOME/.config/mutt/mailcap"
export MANPAGER="nvim +'set filetype=man' -"
# fff
export FFF_TRASH_CMD="rm"
export FFF_MARK_FORMAT="> %f"
export FFF_COL2=3
@ -24,6 +27,34 @@ export FFF_COL2=3
# highlight
export HIGHLIGHT_OPTIONS='--out-format="ansi" --style="pablo"'
# 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="$FZF_DEFAULT_COLORS \
--extended \
--reverse \
--ansi \
--inline-info \
--no-bold \
--preview-window wrap"
export FZF_DEFAULT_COMMAND="rg \
--files \
--no-messages \
--no-ignore \
--hidden \
--follow \
--ignore-case \
--glob '!{.git,node_modules}/*'"
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
export FZF_ALT_C_COMMAND="bfs -type d -nohidden"
export FZF_COMPLETION_OPTS='+c -x'
export FZF_CTRL_T_OPTS="--select-1 --exit-0 --preview '(highlight -O ansi -l {} || bat --color \"always\" {} || tree -C {}) 2> /dev/null | head -200'"
export FZF_CTRL_R_OPTS="--preview 'echo {}' --preview-window down:3:hidden:wrap --bind '?:toggle-preview'"
export FZF_ALT_C_OPTS="--select-1 --exit-0 --preview 'tree -C {} | head -200'"
export FZF_VIM_LOG=$(git config --get alias.l | awk '{$1=""; print $0;}' | tr -d '\r')
# less
export LESS=" \
--ignore-case \
@ -36,6 +67,7 @@ export LESS=" \
--silent \
--tabs=4 \
--shift=5"
export LESSOPEN="| highlight $HIGHLIGHT_OPTIONS -- %s 2>/dev/null" # Use `highlight` program to try to highlight opened file according to its extension.
export LESSHISTFILE="$HOME/.config/less/lesshistory" # Command and search history file.
export LESSKEYRC="$HOME/.config/less/lesskey" # Path of the uncompiled lesskey file.

306
.zshrc
View File

@ -1,143 +1,7 @@
# -*- mode: shell-script -*-
# vim:ft=zsh
# Comienzo de perfil {{{
PROFILE_STARTUP=false
if [[ "$PROFILE_STARTUP" == true ]]; then
zmodload zsh/zprof
# http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html
PS4=$'%D{%M%S%.} %N:%i> '
exec 3>&2 2>$HOME/startlog.$$
setopt xtrace prompt_subst
fi
# }}}
# Funciones {{{
MODULES_DIR="$HOME/.config/zsh"
UPDATE_INTERVAL=5
function _net_test() {
netflag="/tmp/network_down"
touch $netflag
if [[ -n "$(curl -s --max-time 4 -I http://example.com | grep 200)" ]]; then
command rm $netflag >/dev/null
return 0
elif [[ -a $netflag ]]; then
return 1
elif [[ -z "$(curl -s --max-time 4 -I http://example.com | grep 200)" ]]; then
echo "NO NETWORK"
tput bel
touch $netflag
return 1
else
command rm $netflag >/dev/null
return 0
fi
}
function _update() {
if [[ -z $UPDATE_INTERVAL ]];
then
UPDATE_INTERVAL=30
fi
if [[ ! -a $MODULES_DIR/$1/.updatetime ]];
then
echo 0 > "$MODULES_DIR/$1/.updatetime"
fi
day=$((24 * 60 * 60 ))
gap=$(( $UPDATE_INTERVAL * $day ))
diff="$(( $(date +'%s') - $(cat $MODULES_DIR/$1/.updatetime) ))"
if [[ $diff -gt $gap ]]; then
(
_net_test
if [[ $? -eq 1 ]]; then
return
fi
echo "$2"
builtin cd "$MODULES_DIR/$1/" && git pull --rebase
echo "\n"
)
date +'%s' > "$MODULES_DIR/$1/.updatetime"
fi
}
function _get_clone_url() {
if [[ $1 =~ '^(git@|https)' ]]; then
cloneurl="$1"
if [[ $2 -eq 1 ]]; then
if [[ $1 =~ '.*github.*' ]]; then
cloneurl="https://github.com/$location"
fi
if [[ $1 =~ '.*gitlab.*' ]]; then
cloneurl="https://gitlab.com/$location"
fi
fi
else
cloneurl="git@github.com:$1"
if [[ $2 -eq 1 ]]; then
cloneurl="https://github.com/$1"
fi
fi
}
function _get_clone_dest() {
if [[ $1 =~ '^(git@|https)' ]]; then
tillcolon=("${(@s/:/)1}")
if [[ $tillcolon[1] = 'https' ]]; then
atslashes=("${(@s#/#)tillcolon}")
location="$atslashes[-2]/$atslashes[-1]"
else
location="$tillcolon[-1]"
fi
else
location=$1
fi
}
function source_or_install() {
_get_clone_dest "$2"
if [[ $HTTPS_CLONE -eq 1 ]]; then
_get_clone_url "$2" 1
else
_get_clone_url "$2"
fi
if [[ ! -d "$MODULES_DIR" ]]; then
mkdir -p "$MODULES_DIR"
fi
if [[ -a $1 ]] then;
source $1
else
_net_test
if [[ $? -eq 1 ]]; then
echo "oops"
return
fi
git clone --depth 3 "$cloneurl" "$MODULES_DIR/$location"
find $MODULES_DIR -type d -delete 2>/dev/null
if [[ ! -d $MODULES_DIR/$location ]]; then
echo "nothing cloned"
export HTTPS_CLONE=1
fi
date +'%s' > "$MODULES_DIR/$location/.updatetime"
echo "\n"
fi
_update $location
unset location
unset cloneurl
}
function force_updates() {
(
builtin cd $MODULES_DIR
find ./ -type f -name '.updatetime' -delete
source $HOME/.zshrc
)
}
# }}}
# Opciones principales {{{
source $MODULES_DIR/dotfiles.zsh
MODULES_DIR="$HOME/.config/zsh"
autoload -Uz compinit promptinit
autoload -Uz compinit
@ -170,9 +34,7 @@ unsetopt CHECK_JOBS
setopt RM_STAR_WAIT
setopt LIST_TYPES
setopt CORRECT
stty -ixon > /dev/null 2>/dev/null
# }}}
# Autocompletar {{{
setopt NO_LIST_BEEP
setopt COMPLETE_IN_WORD
setopt ALWAYS_TO_END
setopt PATH_DIRS
@ -180,76 +42,84 @@ setopt AUTO_MENU
setopt AUTO_LIST
setopt AUTO_PARAM_SLASH
setopt COMPLETE_ALIASES
setopt MENU_COMPLETE
unsetopt FLOW_CONTROL
setopt MARK_DIRS
setopt LIST_PACKED
setopt MAGIC_EQUAL_SUBST
setopt NO_NOMATCH
setopt AUTO_PUSHD
setopt PUSHD_IGNORE_DUPS
setopt PUSHD_SILENT
setopt PUSHD_TO_HOME
zstyle ':completion:*' menu select=1
zstyle ':completion:*:matches' group 'yes'
zstyle ':completion:*:options' description 'yes'
zstyle ':completion:*:options' auto-description '%d'
zstyle ':completion:*:corrections' format $'\n %F{green}--- %d (errors: %e) ---%f'
zstyle ':completion:*:descriptions' format $'\n %F{yellow}--- %d ---%f'
zstyle ':completion:*:messages' format $'\n %F{purple}--- %d ---%f'
zstyle ':completion:*:warnings' format $'\n %F{red}-- No Matches Found --%f'
zstyle ':completion:*:default' list-prompt '%S%M matches%s'
zstyle ':completion:*:default' select-prompt ' --- Match %M %P ---'
zstyle ':completion:*' format $'\n %F{yellow}--- %d ---%f'
zstyle ':completion:*' group-name ''
zstyle ':completion:*' verbose yes
zstyle ':completion::complete:*' use-cache on
zstyle ':completion::complete:*' cache-path "$HOME/.zcompcache"
zstyle ':completion:*' list-colors $LS_COLORS
zstyle ':completion:*:processes' command 'ps -au $USER -o pid,stat,%cpu,%mem,cputime,command'
zstyle ':completion:*:killall:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd'
zstyle ':completion:*:processes-names' command 'ps c -u ${USER} -o command | uniq'
zstyle ':completion:*:manuals' separate-sections true
zstyle ':completion:*:manuals.(^1*)' insert-sections true
zstyle ':completion:*:man:*' menu yes select
zstyle ':completion:*:parameters' list-colors '=*=34'
zstyle ':completion:*:commands' list-colors '=*=32'
zstyle ':completion:*:builtins' list-colors '=*=1;38;5;142'
zstyle ':completion:*:aliases' list-colors '=*=2;38;5;120'
zstyle ':completion:*:options' list-colors '=^(-- *)=34'
zstyle ':completion:*' list-separator "--"
zstyle ':completion:*:default' list-colors '=(#b)*(-- *)=36=33' '=*=36'
zstyle ':completion::*:kill:*:*' command 'ps xf -U $USER -o pid,%cpu,cmd'
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
zstyle ':completion:*:functions' ignored-patterns '(_*|pre(cmd|exec))'
zstyle ':completion:*' accept-exact '*(N)'
zstyle ':completion:*' rehash true
stty -ixon > /dev/null 2>/dev/null
# }}}
# Autocompletar {{{
zstyle ':completion:*' list-colors $LS_COLORS
zstyle ':completion:*' menu select
zstyle ':completion:*' group-name ''
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
zstyle ':completion:*' verbose true
zstyle ':completion:*' format $'\n %F{yellow}--- %d ---%f'
zstyle ':completion:*' list-separator "--"
zstyle ':completion:*:default' list-prompt '%S%M matches%s'
zstyle ':completion:*:default' select-prompt ' --- Match %M %P ---'
zstyle ':completion:*:options' description 'yes'
zstyle ':completion:*:options' auto-description '%d'
zstyle ':completion:*:expand:*' tag-order all-expansions
zstyle ':completion:*:matches' group 'yes'
zstyle ':completion:*:correct:*' insert-unambiguous true
zstyle ':completion:*:correct:*' original true
zstyle ':completion:*:corrections' format $'\n %F{green}--- %d (errors: %e) ---%f'
zstyle ':completion:*:descriptions' format $'\n %F{yellow}--- %d ---%f'
zstyle ':completion:*:messages' format $'\n %F{purple}--- %d ---%f'
zstyle ':completion:*:warnings' format $'\n %F{red}-- No Matches Found --%f'
zstyle ':completion:*:*:cd:*:directory-stack' menu yes select
zstyle ':completion:*:approximate:' max-errors 'reply=( $((($#PREFIX+$#SUFFIX)/3 )) numeric )'
zstyle ':completion::(^approximate*):*:functions' ignored-patterns '_*'
zstyle ':completion::complete:*' use-cache on
zstyle ':completion::complete:*' cache-path "$MODULES_DIR/.zcompcache"
zstyle ':completion:*:complete:-command-::commands' ignored-patterns '*\~'
zstyle ':completion:*:processes' command 'ps -au $USER -o pid,stat,%cpu,%mem,cputime,command'
zstyle ':completion:*:killall:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd'
zstyle ':completion:*:processes-names' command 'ps c -u ${USER} -o command | uniq'
zstyle ':completion:*:man:*' menu yes select
zstyle ':completion:*:manuals' separate-sections true
zstyle ':completion:*:manuals.(^1*)' insert-sections true
zstyle ':completion:*:parameters' list-colors '=*=34'
zstyle ':completion:*:commands' list-colors '=*=32'
zstyle ':completion:*:builtins' list-colors '=*=1;38;5;142'
zstyle ':completion:*:aliases' list-colors '=*=2;38;5;120'
zstyle ':completion:*:options' list-colors '=^(-- *)=34'
zstyle ':completion:*:default' list-colors '=(#b)*(-- *)=36=33' '=*=36'
zstyle ':completion::*:kill:*:*' command 'ps xf -U $USER -o pid,%cpu,cmd'
zstyle ':completion:*:*:kill:*' menu yes select
zstyle ':completion:*:*:kill:*' force-list always
zstyle ':completion:*:*:kill:*' insert-ids single
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
zstyle ':completion:*:functions' ignored-patterns '(_*|pre(cmd|exec))'
zstyle ':completion:*' accept-exact '*(N)'
zstyle ':completion:*' rehash true
# }}}
# Historial {{{
export HISTIGNORE="ls:cd:cd -:pwd:exit:date:* --help"
HISTFILE="$MODULES_DIR/histfile"
HISTSIZE=1000
SAVEHIST=1000
setopt APPENDHISTORY NOTIFY
unsetopt BEEP EXTENDEDGLOB NOMATCH
setopt BANG_HIST
setopt INC_APPEND_HISTORY
setopt SHARE_HISTORY
setopt EXTENDED_HISTORY
setopt HIST_EXPIRE_DUPS_FIRST
setopt HIST_IGNORE_DUPS
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_FIND_NO_DUPS
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_IGNORE_DUPS
setopt HIST_IGNORE_SPACE
setopt HIST_REDUCE_BLANKS
setopt HIST_SAVE_NO_DUPS
setopt HIST_VERIFY
setopt EXTENDED_HISTORY
setopt INC_APPEND_HISTORY
setopt SHARE_HISTORY
# }}}
# Plugins y extras {{{
source_or_install "$MODULES_DIR/agkozak/agkozak-zsh-prompt/agkozak-zsh-prompt.plugin.zsh" agkozak/agkozak-zsh-prompt
AGKOZAK_BLANK_LINES=1
AGKOZAK_CUSTOM_SYMBOLS=( '⇣⇡' '⇣' '⇡' '+' 'x' '!' '>' '?' )
AGKOZAK_CUSTOM_PROMPT='%(?..%B%F{red}(%?%)%f%b )'
AGKOZAK_CUSTOM_PROMPT+=$'%B%F{blue}%2v%f%b '
AGKOZAK_CUSTOM_PROMPT+='%F{green}%(4V.:.%(!.%#.$))%f '
AGKOZAK_PROMPT_DIRTRIM=0
source_or_install "$MODULES_DIR/zsh-users/zsh-completions/zsh-completions.plugin.zsh" zsh-users/zsh-completions
foreach programa (
LS_COLORS/dircolors.sh
fzf/key-bindings.zsh
@ -267,50 +137,24 @@ foreach plugin (
}
foreach extra (
agkozak-zsh-prompt/agkozak-zsh-prompt.plugin.zsh
zsh-completions/zsh-completions.plugin.zsh
up.plugin.zsh
k.sh
keys.zsh
widgets.zsh
teclas.zsh
extras.zsh
fzf.zsh
transmission.zsh
aliases.plugin.zsh
omg.zsh
dotfiles.zsh
) {
source $MODULES_DIR/$extra
}
AGKOZAK_BLANK_LINES=1
AGKOZAK_CUSTOM_SYMBOLS=( '⇣⇡' '⇣' '⇡' '+' 'x' '!' '>' '?' )
AGKOZAK_CUSTOM_PROMPT='%(?..%B%F{red}(%?%)%f%b )'
AGKOZAK_CUSTOM_PROMPT+=$'%B%F{blue}%2v%f%b '
AGKOZAK_CUSTOM_PROMPT+='%F{green}%(4V.:.%(!.%#.$))%f '
AGKOZAK_PROMPT_DIRTRIM=0
# }}}
# CDR, el cd persistente {{{
autoload -Uz chpwd_recent_dirs cdr add-zsh-hook
add-zsh-hook chpwd chpwd_recent_dirs
DIRSTACKFILE="$HOME/.cache/zsh/dirs"
if [[ ! -a $DIRSTACKFILE ]]; then
mkdir -p $DIRSTACKFILE[0,-5]
touch $DIRSTACKFILE
fi
if [[ -f $DIRSTACKFILE ]] && [[ $#dirstack -eq 0 ]]; then
dirstack=( ${(f)"$(< $DIRSTACKFILE)"} )
fi
chpwd() {
print -l $PWD ${(u)dirstack} >>$DIRSTACKFILE
d="$(sort -u $DIRSTACKFILE )"
echo "$d" > $DIRSTACKFILE
}
DIRSTACKSIZE=20
setopt AUTO_PUSHD PUSHD_SILENT PUSHD_TO_HOME
setopt PUSHD_IGNORE_DUPS
setopt PUSHD_MINUS
# }}}
# Fin perfil {{{
if [[ "$PROFILE_STARTUP" == true ]]; then
unsetopt xtrace
exec 2>&3 3>&-
zprof > ~/zshprofile
fi
# }}}
# vim:foldmethod=marker:foldlevel=0

10
bin/bandcamp Executable file
View File

@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -euf -o pipefail
youtube-dl --add-metadata -icx --no-cache-dir --no-call-home --audio-format mp3 --audio-quality 0 --prefer-ffmpeg --no-post-overwrites --geo-bypass -o "$HOME/Music/Albums/%(artist)s/%(album)s/%(artist)s - %(album)s - %(track_number)d %(track)s.%(ext)s" "$1"
curl -s "$1" > /tmp/pagina
# este cat es una mierda. tendria que reescribir esto para no usarlo asi y cambiar los pipes y toda la pindonga
titulo=$(cat /tmp/pagina | grep -Po "<title>.*</title>" | sed 's/<[^>]*>//g')
disco=${titulo% | *}
grupo=${titulo#* | }
sed -n '/image_/s/.*rel="image_src"\s\+href="\([^"]\+\).*/\1/p' /tmp/pagina | xargs -r curl -s --create-dirs -o "$HOME"/Music/Albums/"$grupo"/"$disco"/cover.jpg

36
bin/cfg
View File

@ -3,20 +3,25 @@
function () {
# Bookmarks
local -A bookmarks=(
'v' '~/.config/nvim/init.vim'
'b' '~/.config/bspwm/bspwmrc'
'k' '~/.config/sxhkd/sxhkdrc'
'c' '~/.config/mutt/muttrc'
'z' '~/.zshrc'
'n' '~/.config/dunst/dunstrc'
't' '~/.config/termite/config'
'r' '~/.config/ranger/rc.conf'
'm' '~/.config/ncmpcpp/config'
'x' '~/.tmux.conf'
'i' '~/.xinitrc'
'u' '~/.config/newsboat/urls'
'a' '~/.config/zsh/aliases.plugin.zsh'
'g' '~/.config/compton.conf'
'nvim' '~/.config/nvim/init.vim'
'irc' '~/.irssi/config'
'mpv' '~/.config/mpv/mpv.conf'
'xres' '~/.Xresources'
'rss' '~/.config/newsboat/config'
'wm' '~/.config/bspwm/bspwmrc'
'keys' '~/.config/sxhkd/sxhkdrc'
'correo' '~/.config/mutt/muttrc'
'shell' '~/.zshrc'
'dunst' '~/.config/dunst/dunstrc'
'term' '~/.config/termite/config'
'ranger' '~/.config/ranger/rc.conf'
'music' '~/.config/ncmpcpp/config'
'tmux' '~/.tmux.conf'
'xinit' '~/.xinitrc'
'urls' '~/.config/newsboat/urls'
'alias' '~/.config/zsh/aliases.plugin.zsh'
'compose' '~/.config/compton.conf'
'env' '~/.zshenv'
)
local selected_bookmark
@ -37,8 +42,7 @@ function () {
selected_bookmark=$(
printf "$bookmarks_table" \
| fzf \
--exact \
--height='35%' \
--height='45%' \
)
selected_bookmark="${selected_bookmark[(ws: :)2]}"

View File

@ -2,6 +2,7 @@
# Sync mail and give notification if there is new mail.
ping -q -c 1 1.1.1.1 > /dev/null || exit
pgrep -x mbsync >/dev/null && echo "mbsync already running." && exit
export DISPLAY=:0.0

11
bin/fgit Executable file
View File

@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -euf -o pipefail
git log --graph --color=always \
--format="%C(auto)%h%d %s %C(black)%C(bold)%cr" "$@" |
fzf --ansi --preview "echo {} | grep -o '[a-f0-9]\{7\}' | head -1 | xargs -I % sh -c 'git show --color=always %'" \
--bind "enter:execute:
(grep -o '[a-f0-9]\{7\}' | head -1 |
xargs -I % sh -c 'git show --color=always % | less -R') << 'FZF-EOF'
{}
FZF-EOF"

View File

@ -40,6 +40,7 @@ jacka() { \
-f pulse -i 1 \
-ac 2 -channel_layout stereo -async 1 \
-c:a flac "$HOME/Video/Tape/$(date '+%y%m%d-%H%M-%S').flac"
echo $! > /tmp/recordingpid
}
jackv() {
@ -63,7 +64,7 @@ mute() {
-s "$(xdpyinfo | grep dimensions | awk '{print $2;}')" \
-i :0.0 \
-c:v libx264 -qp 0 -r 30 \
"$HOME/Videos/-$(date '+%y%m%d-%H%M-%S').mkv" &
"$HOME/Videos/$(date '+%y%m%d-%H%M-%S').mkv" &
echo $! > /tmp/recordingpid
}
@ -78,11 +79,13 @@ audio() { \
}
askrecording() { \
choice=$(printf "screencast\\nvideo\\naudio" | dmenu -i -p "Select recording style:")
choice=$(printf "screencast\\nvideo\\naudio\\njackv\\njacka" | dmenu -i -p "Select recording style:")
case "$choice" in
screencast) screencast;;
video) mute;;
audio) audio;;
video) video;;
jackv) jackv;;
jacka) jacka;;
esac
}
@ -93,10 +96,10 @@ asktoend() { \
case "$1" in
screencast) screencast;;
video) mute;;
audio) audio;;
jacka) jacka;;
jackv) jackv;;
audio) audio;;
video) video;;
kill) killrecording;;
*) ([ -f /tmp/recordingpid ] && asktoend && exit) || askrecording;;
esac

View File

@ -4,8 +4,6 @@ case $1 in
zsh) source ~/.zshrc ;;
fonts) fc-cache -v -f ;;
keys) pkill -USR1 -x sxhkd ;;
dunst) ~/.config/dunst/./reload ;;
comp) pkill compton && compton -bcCGf ;;
xres) xrdb ~/.Xresources ;;
bar) ~/.config/polybar/./launch.sh ;;
*) echo "Can't help you with that" ;;

View File

@ -1,14 +1,7 @@
#!/usr/bin/env bash
set -euf -o pipefail
# Hacked together by deadguy from various bits and pieces from manpages,
# stackexchange, github, r/unixporn, and the awesome help from people in
# #bash, #zsh, and #archlinux-newbie on freenode.
# Steal it, use it, mod it, share it, love it.
# CONFIG ----------------------------------------------------
# This NEEDS to be the same as in mpd.conf
music_dir="$HOME/Music/Albums"
@ -20,19 +13,18 @@ img_reg=".*/(cover|front|folder|art).(jpg|jpeg|png|gif)$"
# What do we want the notification to look like?
artist_color="##a1b56c"
album_color="##ad7fa8"
#album_color="##ad7fa8"
song_color="##34e2e2"
title="<span color='$album_color' weight='bold'>%album%</span>"
#title="%album%"
form="<span color='$artist_color'>%artist%</span> - <span color='$song_color'>%title%</span>"
# END CONFIG ----------------------------------------------------
# These are some variables we need for things to work
song="$(mpc --format %file% current)"
songdir="$music_dir/$(dirname "${song}")/"
raw_cover="/tmp/current_cover.png"
heading="$(mpc current -f "$title" | sed "s:&:&amp;:g")"
heading="$(mpc current -f "%album%" | sed "s:&:&amp;:g")"
message="$(mpc current -f "$form" | sed "s:&:&amp;:g" )"
# Is there music on?
@ -54,5 +46,5 @@ fi
notify-send -u low -t 8000 -i "$cover" "$heading" "$message"
# add a rule to make sxiv:albumcover floating
#sxiv "$cover" -N albumcover -g 240x240-10-10 -bpq > /dev/null 2>&1 & pid=$!
#sxiv "$cover" -N albumcover -g 250x250-10-10 -bpq > /dev/null 2>&1 & pid=$!
# { sleep 4; kill "$pid"; } &

View File

@ -1,6 +1,6 @@
#!/bin/bash
if command -v tmux >/dev/null 2>&1; then
test -z "$TMUX" && (tmux new -A -s "" )
test -z "$TMUX" && (tmux new -A -s "Z" )
fi

8
bin/tls Executable file
View File

@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -euf -o pipefail
[[ -n "$TMUX" ]] && change="switch-client" || change="attach-session"
if [ "$1" ]; then
tmux $change -t "$1" 2>/dev/null || (tmux new-session -d -s "$1" && tmux $change -t "$1"); return
fi
session=$(tmux list-sessions -F "#{session_name}" 2>/dev/null | fzf --exit-0) && tmux $change -t "$session" || echo "No sessions found."

4
bin/ts-clear Executable file
View File

@ -0,0 +1,4 @@
#!/usr/bin/env bash
set -euf -o pipefail
transmission-remote -l | grep 100% | grep Done | awk '{print $1}' | xargs -n 1 -I % transmission-remote -t % -r

12
bin/tsa Executable file
View File

@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -euf -o pipefail
TRANS_PID=$(pidof transmission-daemon)
if [[ $TRANS_PID ]]; then
transmission-remote --add "$1"
else
tsd
sleep 5
transmission-remote --add "$1"
fi

18
bin/tsb Executable file
View File

@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -euf -o pipefail
TRANS_PID=$(pidof transmission-daemon)
if [[ $TRANS_PID ]]; then
echo "$(tput setaf 1) Stopping Transmission Daemon"
killall transmission-daemon 2> /dev/null ;
echo "$(tput setaf 3) Updating Blocklist"
tblock
echo "$(tput setaf 2) Restarting Transmission Daemon"
tsd
fi
if [[ ! $TRANS_PID ]]; then
echo "$(tput setaf 3) Updating Blocklist"
tblock
fi

15
bin/tsd Executable file
View File

@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -euf -o pipefail
transmission-daemon --foreground --log-info 2>&1 | while read -r line; do
echo "$line" |
grep -v "announcer.c:\|platform.c:\|announce done (tr-dht.c:" |
grep -v "Saved.*variant.c:" |
while read -r line; do
echo "$line" | grep -q "Queued for verification (verify.c:" &&
notify-send --app-name="Transmission Started" "${line#* * }"
echo "$line" | grep -q "changed from .Incomplete. to .Complete." &&
notify-send --app-name="Transmission Complete" "${line#* * }"
echo "$line" | systemd-cat --identifier="TransWrap" --priority=5
done > /dev/null 2>&1
done & disown

View File

@ -1,4 +0,0 @@
#!/usr/bin/env bash
set -euf -o pipefail
youtube-dl --add-metadata -icw --no-cache-dir --no-call-home --restrict-filenames --extract-audio --audio-format mp3 --audio-quality 0 --prefer-ffmpeg -o "%(title)s.%(ext)s"

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash
set -euf -o pipefail
youtube-dl --add-metadata -ic --no-call-home
youtube-dl --add-metadata -ic --no-call-home --no-cache-dir --geo-bypass -o "$HOME/Videos/%(title)s.%(ext)s" "$@"

View File

@ -2,4 +2,4 @@
# Description: download all videos from a playlist in a separate directory.
set -euf -o pipefail
youtube-dl -o '%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s'
youtube-dl -o '%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s' "$@"