Main update

Add packages
This commit is contained in:
drymer 2017-12-16 00:46:51 +01:00
parent 7fccc4f3ed
commit d784f77bda
20 changed files with 321 additions and 86 deletions

View File

@ -3,7 +3,7 @@
connection: local
vars:
install_dir: ~/Instalados/
shell_user: ap
shell_user: ~/Scripts/bin
emacs_version: emacs-25.3
i3_gaps_version: 4.14.1
termite_version: v12
@ -27,9 +27,6 @@
- packages
- hosts: localhost
vars:
install_dir: ~/Instalados/
shell_user: ap
roles:
- emacs-dotfiles
- i3-dotfiles

View File

@ -2,7 +2,13 @@
- name: Converge
hosts: all
vars:
install_dir: "/root/Instalados"
install_dir: ~/Instalados/
emacs_version: emacs-25.3
i3_gaps_version: 4.14.1
termite_version: v12
vte_version: 0.44.1.b
syncthing_inotify_version: v0.8.7
go_path: /opt/go/
roles:
- slim
- habitual-packages
@ -15,3 +21,4 @@
- pip-packages
- virtualbox
- virtualenvwrapper
- fonts

View File

@ -1 +0,0 @@
../../requirements.yml

View File

@ -87,8 +87,22 @@ habitual_packages:
- psmisc
- mutt
- xserver-xorg
- fbreader
- xapian-tools
- tree
- xserver-xorg-input-synaptics
- gparted
- pulseaudio
- pavucontrol
- alsa-utils
- mongodb-clients
- cifs-utils
- nfs-common
- nodejs
- encfs
- gajim
- libnotify-bin
- at
- x11-apps
- ttyrec
- recordmydesktop
- openvpn
- transmission-qt
- unoconv
- ledger
- gnuplot

View File

@ -14,7 +14,6 @@ floating_modifier $mod
# Display
set $display eDP-1
set $display2 HDMI-1
# volver a la misma ventana que estaba apretando el mismo worskpace
workspace_auto_back_and_forth yes
@ -22,11 +21,11 @@ workspace_auto_back_and_forth yes
# abrir una terminal
bindsym $mod+Return exec termite
# cerrat ventana
# cerrar ventana
bindsym $mod+Shift+Q kill
# arrancar dmenu
bindsym $mod+d exec --no-startup-id rofi -show combi
bindsym $mod+d exec --no-startup-id /usr/bin/zsh -c "`grep "^PATH" ~/.zshrc` rofi -show combi"
# Reinicia i3
bindsym $mod+Shift+r restart
@ -158,20 +157,16 @@ bar {
}
# Modo sistema
set $mode_system System (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown
mode "$mode_system" {
bindsym l exec --no-startup-id ~/.i3/scripts/lock, mode "default"
bindsym s exec --no-startup-id ~/.i3/scripts/exit pm-suspend, mode "default"
bindsym r exec --no-startup-id ~/.i3/scripts/exit reboot, mode "default"
bindsym e exec --no-startup-id ~/.i3/scripts/exit logout, mode "default"
# Bloquear pantalla
bindsym $mod+Control+l exec --no-startup-id ~/.i3/scripts/lock, mode "default"
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
# Seleccionar padre
bindsym $mod+i focus parent
bindsym $mod+Escape mode "$mode_system"
# Seleccionar hijo
bindsym $mod+o focus child
# evitar titulos feos
new_window pixel
# Colors de las ventanas
@ -189,19 +184,15 @@ exec --no-startup-id xbacklight -set 100
exec --no-startup-id bash ~/.i3/scripts/autolock.sh
exec --no-startup-id parcellite
exec --no-startup-id compton
exec --no-startup-id mpd ~/.mpd.conf
exec --no-startup-id bash ~/.xinitrc
exec --no-startup-id dunst
# Mover programas automáticamente a workspace
assign [title="(?i)emacs"] $ws1
# assign [class="(?i)firefox"] $ws2
assign [class="(?i)firefox"] $ws2
assign [class="(?i)tor"] $ws2
assign [class="(?i)chromium"] $ws2
assign [class="(?i)qutebrowser"] $ws2
assign [class="(?i)icecat"] $ws2
assign [title="bittorrent"] $ws3
assign [class="(?i)gnucash"] $ws6
assign [title="Steam"] $ws7
assign [class="(?i)mumble"] $ws8
assign [class="(?i)mpv"] $ws8
@ -222,12 +213,16 @@ for_window [class="(?i)feh"] floating enable
for_window [class="Progreso de operación de archivo"] floating enable
# i3-gaps
# gaps inner 10
# gaps outer 10
smart_borders on
# smart_gaps on
# Popups en pantalla completa
popup_during_fullscreen smart
# El foco no lo decide el ratón
focus_follows_mouse no
# Scratchpad
bindsym $mod+Shift+p move scratchpad
bindsym $mod+p scratchpad show
exec keepassx
for_window [title="KeePassX"] border 1pixel, floating enable, move scratchpad

View File

@ -12,7 +12,7 @@ markup=pango
[weather]
interval=3600
interval=60
border_top=0
border_right=0
border_left=-1

View File

@ -1,5 +1,6 @@
#!/bin/bash
sleep 0.01
# i3lock blurred screen inspired by /u/patopop007 and the blog post
# http://plankenau.com/blog/post-10/gaussianlock

View File

@ -16,11 +16,11 @@
TYPE="${BLOCK_INSTANCE:-mem}"
ram=$(free -h | grep Mem | awk '{print $7}' | sed "s/$//")
ram=$((`free | grep Mem | awk '{print $7}'`/1024/1024))
if [[ $ram -ge 6 ]]
if [[ $ram -lt 4 ]]
then
echo -n "<span foreground='#B60900' background='#61CE3C'></span><span foreground='black' background='#B60900'>  $ram </span><span foreground='#8A458A' background='#B60900'> </span>"
echo -n "<span foreground='#B60900' background='#61CE3C'></span><span foreground='black' background='#B60900'>  $ram </span><span foreground='#8A458A' background='#B60900'> </span>"
else
echo -n "<span foreground='#4c83ff' background='#61CE3C'></span><span foreground='black' background='#4c83ff'>  $ram </span><span foreground='#8A458A' background='#4c83ff'> </span>"
fi

View File

@ -1,3 +1,10 @@
#!/bin/sh
echo -n "<span foreground='#ffd700' background='#8A458A'></span><span foreground='black' background='#ffd700'>  " $(acpi -t | grep "Thermal 1" | cut -d' ' -f4) "º </span>"
temp=$(acpi -t | grep "Thermal 1" | cut -d' ' -f4)
if [[ -z $temp ]]
then
temp=$(acpi -t | head -n1 | cut -d' ' -f4)
fi
echo -n "<span foreground='#ffd700' background='#8A458A'></span><span foreground='black' background='#ffd700'>  " $temp "º </span>"

View File

@ -0,0 +1,6 @@
#!/bin/bash
~/.i3/scripts/lock
sleep 1
echo 'mem' > /sys/power/state

View File

@ -13,3 +13,8 @@ pip_packages:
- virtualenvwrapper
- nikola
- jenkins-cli
- jenkins
- httpie
- beets
- python-mpd2
- orgparse

View File

@ -17,7 +17,6 @@
::1 localhost
fe80::1%lo0 localhost
127.0.1.1 addicted-magic
# Custom host records are listed here.

View File

@ -524,7 +524,7 @@ key.setGlobalKey(["C-x","C-f"], function (aEvent, aArg) {
ext.exec("hok-start-foreground-mode", aArg);
}, "Hok - Foreground hint mode", true);
key.setGlobalKey(["C-x", "4", "C-f"], function (aEvent, aArg) {
key.setGlobalKey(["C-x", "f"], function (aEvent, aArg) {
ext.exec("hok-start-background-mode", aArg);
}, "HoK - Background hint mode", true);

View File

@ -7,3 +7,4 @@ alias ls='ls --color'
alias ec="emacsclient -t"
alias nav="qutebrowser --target tab-bg-silent "
alias rmr="/bin/rm"
alias weechat="docker run -ti --name weechat --rm -v ~/.weechat:/weechat --net=host drymer-weechat"

View File

@ -49,3 +49,5 @@ fi
# java stuff
. /etc/profile.d/openjdk*.sh
[ -f ~/.fzf.bash ] && source ~/.fzf.bash

View File

@ -25,8 +25,8 @@ function upgrade_kubectl (){
version=$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt);
curl -s -L https://storage.googleapis.com/kubernetes-release/release/$version/bin/linux/amd64/kubectl -o /tmp/kubectl
chmod +x /tmp/kubectl
sudo mv /tmp/kubectl ~/Scripts/bin/kubectl-$version
sudo ln -fs ~/Scripts/bin/kubectl-$version ~/Scripts/bin/kubectl
mv /tmp/kubectl ~/Scripts/bin/kubectl-$version
ln -fs ~/Scripts/bin/kubectl-$version ~/Scripts/bin/kubectl
echo "kubectl version: $version"
}
@ -37,33 +37,11 @@ function upgrade_kops (){
version=$(echo $uri | cut -d'/' -f6)
curl -s -L https://github.com/$uri -o /tmp/kops
chmod +x /tmp/kops
sudo mv /tmp/kops ~/Scripts/bin/kops-$version
sudo ln -fs ~/Scripts/bin/kops-$version ~/Scripts/bin/kops
mv /tmp/kops ~/Scripts/bin/kops-$version
ln -fs ~/Scripts/bin/kops-$version ~/Scripts/bin/kops
echo "kops version: $version"
}
# Completado vago para kubectl
KUBECTL_BIN=`which kubectl`
function kubectl (){
if [[ -z $KUBECTL_SET ]]
then
KUBECTL_SET=True
source <(kubectl completion zsh)
fi
$KUBECTL_BIN "$@"
}
# Completado vago para molecule
MOLECULE_BIN=`which molecule`
function molecule() {
if [[ -z $MOLECULE_SET ]]
then
MOLECULE_SET=True
eval "$(_MOLECULE_COMPLETE=source molecule)"
fi
$MOLECULE_BIN "$@"
}
# Limpiar ramas mergeadas
function delete_old_branches(){
git checkout master
@ -94,3 +72,201 @@ function kenter(){
fi
kubectl exec -ti $1 $2 $3 $command
}
# Comprueba que los repositorios git de un repositorio tienen commits a hacer
function git_updated() {
for git in `ls --color=none`
do
if [[ -d $git ]]
then
cd $git
gitstatus="`git status -s | awk '{print $2}'`"
if [[ -n $gitstatus ]]
then
echo "- \033[0;31m$git\033[0m:\n$gitstatus"
fi
cd ..
fi
done
}
# Docker presentaciones
function reveal () {
function async ()
{
sleep 3 && xdg-open http:localhost:8000
}
async &!
docker run -ti --name revealjs --rm -v `pwd`:/revealjs/files/ -p 8000:8000 revealjs
}
# Autocompletados
## kubectl
KUBECTL_BIN=`which kubectl`
function kubectl (){
if [[ -z $KUBECTL_SHOW_CONTEXT ]]
then
source <($KUBECTL_BIN completion zsh)
source <(kops completion zsh)
fi
KUBECTL_SHOW_CONTEXT="k8s-$($KUBECTL_BIN config current-context)"
$KUBECTL_BIN "$@"
}
## molecule
MOLECULE_BIN=`which molecule`
function molecule() {
if [[ -z $MOLECULE_SET ]]
then
MOLECULE_SET=True
eval "$(_MOLECULE_COMPLETE=source molecule)"
fi
$MOLECULE_BIN "$@"
}
## helm
HELM_BIN=`which helm`
function helm (){
if [[ -z $HELM_SHOW_CONTEXT ]]
then
source <($HELM_BIN completion zsh)
fi
$HELM_BIN "$@"
}
# fzf functions
## fkill - kill process
fkill() {
local pid
pid=$(ps -ef | sed 1d | fzf -m | awk '{print $2}')
if [ "x$pid" != "x" ]
then
echo $pid | xargs kill -${1:-9}
fi
}
## insert located file
fzf-locate-widget() {
local selected
if selected=$(locate / | fzf -q "$LBUFFER"); then
LBUFFER=$selected
fi
zle redisplay
}
zle -N fzf-locate-widget
bindkey '\ei' fzf-locate-widget
## Docker stuff: https://medium.com/@calbertts/docker-and-fuzzy-finder-fzf-4c6416f5e0b5
runc() {
export FZF_DEFAULT_OPTS='--height 90% --reverse --border'
local image=$(docker images --format '{{.Repository}}:{{.Tag}}' | fzf-tmux --reverse --multi)
if [[ $image != '' ]]; then
echo -e "\n \033[1mDocker image:\033[0m" $image
read -e -p $' \e[1mOptions: \e[0m' -i "-it --rm" options
printf " \033[1mChoose the command: \033[0m"
local cmd=$(echo -e "/bin/bash\nsh" | fzf-tmux --reverse --multi)
if [[ $cmd == '' ]]; then
read -e -p $' \e[1mCustom command: \e[0m' cmd
fi
echo -e " \033[1mCommand: \033[0m" $cmd
export FZF_DEFAULT_COMMAND='find ./ -type d -maxdepth 1 -exec basename {} \;'
printf " \033[1mChoose the volume: \033[0m"
local volume=$(fzf-tmux --reverse --multi)
local curDir=${PWD##*/}
if [[ $volume == '.' ]]; then
echo -e " \033[1mVolume: \033[0m" $volume
volume="`pwd`:/$curDir -w /$curDir"
else
echo -e " \033[1mVolume: \033[0m" $volume
volume="`pwd`/$volume:/$volume -w /$volume"
fi
export FZF_DEFAULT_COMMAND=""
export FZF_DEFAULT_OPTS=""
history -s runc
history -s docker run $options -v $volume $image $cmd
echo ''
docker run $options -v $volume $image $cmd
fi
}
stopc() {
export FZF_DEFAULT_OPTS='--height 90% --reverse --border'
local container=$(docker ps --format '{{.Names}} => {{.Image}}' | fzf-tmux --reverse --multi | awk -F '\\=>' '{print $1}')
if [[ $container != '' ]]; then
echo -e "\n \033[1mDocker container:\033[0m" $container
printf " \033[1mRemove?: \033[0m"
local cmd=$(echo -e "No\nYes" | fzf-tmux --reverse --multi)
if [[ $cmd != '' ]]; then
if [[ $cmd == 'No' ]]; then
echo -e "\n Stopping $container ...\n"
history -s stopc
history -s docker stop $container
docker stop $container > /dev/null
else
echo -e "\n Stopping $container ..."
history -s stopc
history -s docker stop $container
docker stop $container > /dev/null
echo -e " Removing $container ...\n"
history -s stopc
history -s docker rm $container
docker rm $container > /dev/null
fi
fi
fi
export FZF_DEFAULT_OPTS=""
}
runinc() {
export FZF_DEFAULT_OPTS='--height 90% --reverse --border'
local container=$(docker ps --format '{{.Names}} => {{.Image}}' | fzf-tmux --reverse --multi | awk -F '\\=>' '{print $1}')
if [[ $container != '' ]]; then
echo -e "\n \033[1mDocker container:\033[0m" $container
read -e -p $' \e[1mOptions: \e[0m' -i "-it" options
if [[ $@ == '' ]]; then
read -e -p $' \e[1mCommand: \e[0m' cmd
else
cmd="$@"
fi
echo ''
history -s runinc "$@"
history -s docker exec $options $container $cmd
docker exec $options $container $cmd
echo ''
fi
export FZF_DEFAULT_OPTS=""
}
showipc() {
export FZF_DEFAULT_OPTS='--height 90% --reverse --border'
local container=$(docker ps -a --format '{{.Names}} => {{.Image}}' | fzf-tmux --reverse --multi | awk -F '\\=>' '{print $1}')
if [[ $container != '' ]]; then
local network=$(docker inspect $container -f '{{.NetworkSettings.Networks}}' | awk -F 'map\\[|:' '{print $2}')
echo -e "\n \033[1mDocker container:\033[0m" $container
history -s showipc
history -s docker inspect -f "{{.NetworkSettings.Networks.${network}.IPAddress}}" $container
echo -e " \033[1mNetwork:\033[0m" $network
echo -e " \033[1mIP Address:\033[0m" $(docker inspect -f "{{.NetworkSettings.Networks.${network}.IPAddress}}" $container) "\n"
fi
}
# Clean docker
function docker_clean(){
echo "Deleting stopped containers..."
docker rm $(docker ps -a -q | awk '{print $1}')
echo "Deleting volumes..."
docker volume rm $(docker volume ls)
echo "Deleting none images..."
docker rmi $(docker images -f "dangling=true" -q)
}

View File

@ -1,7 +1,7 @@
[options]
font = DejaVu Sans Mono
clickable_url = on
browser = qutebrowser
browser = firefox
cursor_blink = on
cursor_shape = underline
scrollback_lines = 10000
@ -40,4 +40,4 @@ color14 = #729FCF
# white
color7 = #d0d0d0
color15 = #f5f5f5
color15 = #f5f5f5

View File

@ -48,6 +48,7 @@ prompt_segment() {
POWERLEVEL9K_CUSTOM_EXEC_TIME="prompt_cmd_exec_time"
# Cosas de la bateria
prompt_battery() {
# The battery can have four different states - default to 'unknown'.
local current_state="unknown"
@ -142,8 +143,17 @@ prompt_battery() {
if [[ $current_state != "charged" ]]
then
# Draw the prompt_segment
if [[ -n $bat_percent ]]; then
"$1_prompt_segment" "${0}_${current_state}" "$2" "$DEFAULT_COLOR" "${battery_states[$current_state]}" "$message" 'BATTERY_ICON'
if [[ -n $bat_percent && $bat_percent -ne 94 && $bat_percent -ne 98 ]]; then
"$1_prompt_segment" "${0}_${current_state}" "$2" "$DEFAULT_COLOR" "${battery_states[$current_state]}" "$message" 'BATTERY_ICON'
fi
fi
}
# K8s
POWERLEVEL9K_KUBECTL_CONTEXT="prompt_kubectl_context"
prompt_kubectl_context() {
if [[ -v KUBECTL_SHOW_CONTEXT ]]
then
prompt_segment $DEFAULT_COLOR blue_COLOR "$KUBECTL_SHOW_CONTEXT"
fi
}

View File

@ -6,18 +6,16 @@ export TERM="xterm-256color"
# Ruta de oh-my-zsh
export ZSH=$HOME/.oh-my-zsh
# Tema a elegir: usa uno simple si me conecto por ssh
if [[ -n $SSH_CLIENT ]];
then
ZSH_THEME="alanpeabody"
else
POWERLEVEL9K_MODE='awesome-fontconfig'
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(battery time context dir virtualenv vcs)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(custom_exec_time status background_jobs)
POWERLEVEL9K_PYTHON_ICON=""
ZSH_THEME="powerlevel9k/powerlevel9k"
POWERLEVEL9K_BATTERY_ICON='\uf1e6 '
fi
POWERLEVEL9K_MODE='awesome-fontconfig'
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(battery time context dir virtualenv vcs)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(custom_exec_time status background_jobs kubectl_context)
POWERLEVEL9K_PYTHON_ICON=""
ZSH_THEME="powerlevel9k/powerlevel9k"
POWERLEVEL9K_BATTERY_ICON='\uf1e6 '
# Acortar a partir de un directorio
POWERLEVEL9K_SHORTEN_DIR_LENGTH=1
# Acortar path que se muestra en el prompt
POWERLEVEL9K_SHORTEN_STRATEGY=truncate_to_unique
# No comprobar si hay actualizaciones
DISABLE_AUTO_UPDATE="true"
@ -32,7 +30,7 @@ COMPLETION_WAITING_DOTS="true"
HIST_STAMPS="dd/mm/yyyy"
# Plugins
plugins=(git colored-man-pages sprunge autojump gpg-agent pip urlencode ssh-agent)
plugins=(git colored-man-pages sprunge gpg-agent pip urlencode ssh-agent aws)
# Path
PATH="/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/sbin:/sbin:/usr/local/bin:$HOME/Scripts/bin/"
@ -50,7 +48,7 @@ export LC_ALL=es_ES.UTF-8
export EDITOR="emacsclient -t -c"
export ALTERNATE_EDITOR="nano"
# Funciones para custom_exec_time y battery_prompt
# Funciones personalizadas
source $HOME/.oh-my-zsh/custom/themes/custom.zsh
# Alias
@ -63,3 +61,21 @@ source /usr/local/bin/virtualenvwrapper_lazy.sh > /dev/null
# Cargar funciones
source $HOME/.functions
# Filtro para less
export LESS='-R'
export LESSOPEN='|~/.lessfilter %s'
# Systemd stuff
export XDG_RUNTIME_DIR="/run/user/$UID"
export DBUS_SESSION_BUS_ADDRESS="unix:path=${XDG_RUNTIME_DIR}/bus"
# fzf stuff
source ~/.fzf.zsh
source ~/Instalados/z/z.sh
source ~/Instalados/fz/fz.plugin.zsh
source ~/Instalados/zsh-interactive-cd/zsh-interactive-cd.plugin.zsh
# --select-1 automatically selects the item if there's only one
export FZF_CTRL_T_OPTS="--select-1 --exit-0"
# The following example uses tree command to show the entries of the directory
export FZF_ALT_C_OPTS="--preview 'tree -C {} | head -200'"

View File

@ -38,7 +38,7 @@
- name: Set zsh as main shell
become: yes
shell: usermod --shell /bin/zsh "{{ shell_user }}"
shell: usermod --shell /bin/zsh "{{ ansible_user_id }}"
- name: Acrivate locale
become : yes