Buenas, este post es con la intención de postear/compartir nuestros .archivos y sus configuraciones.
Por acá les dejo los míos.
Prompt (.bashrc):
# Simplekodebashrc
PS1="\[\033[1;m\]·@Kodeinfect\[\033[1;34m\]\[\033[1;34m\] [\w]·\[\033[0m\] > "
(http://imageshack.us/a/img69/6757/promptm.png)
ConkyKode (.conkyrc):
#ConkyConfig ~ By Kypzkore Kodeinfect '
background no
use_xft yes
xftfont kroeger 05_55 caps:size=7
override_utf8_locale yes
# Text alpha when using Xft
xftalpha 1
update_interval 1
use_xft yes
draw_shades no
draw_outline no
draw_borders no
stippled_borders no
border_margin 2
border_width 6
default_color 656565
default_shade_color black
default_outline_color grey
own_window yes
own_window_argb_visual yes
own_window_transparent yes
own_window_type normal
own_window_hints undecorate,sticky,skip_taskbar,skip_pager
own_window_colour 000000
#alignment top_left
#alignment top_right
#alignment bottom_left
#alignment bottom_right
gap_x 10
gap_y 350
no_buffers yes
uppercase no
double_buffer yes
use_spacer yes
TEXT
${color}Sistema Operativo: ${color B1B1B1}Archlinux
${color}Kernel: ${color B1B1B1}$kernel
${color}Arquitectura: ${color B1B1B1}${machine}
${color}Memoria RAM: ${color B1B1B1}${font}$mem / ${memfree}
${color}Procesos: ${color B1B1B1}$processes
${color}Sistema Raiz: ${color B1B1B1}${fs_used /} / ${fs_size /}
${color}Sistema Home: ${color B1B1B1}${fs_used /home} / ${fs_size /home}
${color}Descarga: ${color B1B1B1}${downspeedf enp2s0}
${color}Subida: ${color B1B1B1}${upspeedf enp2s0}
${color}Actualizaciones: ${color B1B1B1}${execi 4200 perl /home/kode/.scripts/.conkyup.pl}
(http://imageshack.us/a/img547/1726/conkyu.png)
Un saludo ;)
Este es un script que modifica el archivo /etc/motd
rojo='\e[1;31m'
NC='\e[0m'
echo -e "${rojo} _,met\$\$\$\$\$gg." > /etc/motd
echo -e " ,g\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$P." >> /etc/motd
echo -e " ,g\$\$P\"\" \"\"\"Y\$\$.\"." >> /etc/motd
echo -e " ,\$\$P' \`\$\$\$." >> /etc/motd
echo -e " ',\$\$P ,ggs. \`\$\$b:" >> /etc/motd
echo -e " \`d\$\$' ,\$P\"' . \$\$\$" >> /etc/motd
echo -e " \$\$P d\$' , \$\$P" >> /etc/motd
echo -e " \$\$: \$\$. - ,d\$\$' " >> /etc/motd
echo -e " \$\$; Y\$b._ _,d\$P' ${NC} _, _, ,'\`." >> /etc/motd
echo -e "${rojo} Y\$\$. \`.\`\"Y\$\$\$\$P\"'${NC} \`\$\$' \`\$\$' \`. ,'" >> /etc/motd
echo -e "${rojo} \`\$\$b \"-.__ ${NC} \$\$ \$\$ \`'" >> /etc/motd
echo -e "${rojo} \`Y\$\$b ${NC} \$\$ \$\$ _, _" >> /etc/motd
echo -e "${rojo} \`Y\$\$. ${NC} ,d\$\$\$g\$\$ ,d\$\$\$b. \$\$,d\$\$\$b.\`\$\$' g\$\$\$\$\$b.\`\$\$,d\$\$b." >> /etc/motd
echo -e "${rojo} \`\$\$b. ${NC} ,\$P' \`\$\$ ,\$P' \`Y\$. \$\$\$' \`\$\$ \$\$ \"' \`\$\$ \$\$\$' \`\$\$" >> /etc/motd
echo -e "${rojo} \`Y\$\$b. ${NC} \$\$' \$\$ \$\$' \`\$\$ \$\$' \$\$ \$\$ ,ggggg\$\$ \$\$' \$\$" >> /etc/motd
echo -e "${rojo} \`\"Y\$b._ ${NC} \$\$ \$\$ \$\$ggggg\$\$ \$\$ \$\$ \$\$ ,\$P\" \$\$ \$\$ \$\$" >> /etc/motd
echo -e "${rojo} \`\"\"\"\" ${NC} \$\$ ,\$\$ \$\$. \$\$ ,\$P \$\$ \$\$' ,\$\$ \$\$ \$\$" >> /etc/motd
echo -e "${NC} \`\$g. ,\$\$\$ \`\$\$._ _., \$\$ _,g\$P' \$\$ \`\$b. ,\$\$\$ \$\$ \$\$" >> /etc/motd
echo -e " \`Y\$\$P'\$\$. \`Y\$\$\$\$P',\$\$\$\$P\"' ,\$\$. \`Y\$\$P'\$\$.\$\$. ,\$\$." >> /etc/motd
echo -e "${rojo}Debian GNU/Linux ${NC}" `cat /etc/debian_version` >> /etc/motd
Da como resultado
(http://gryphes.16mb.com/post-images/undercode-001.png)
(http://i40.tinypic.com/2zivfy8.png)
Mi .bashrc
alias ls="ls --color"
PS1="\[\033[1;32m\]$(echo -e '\103'):\$(pwd | tr '/[a-z]' '\134\134[A-Z]')>\[\033[0m\] \[\033[1;31m\]"
(http://i43.tinypic.com/2zqrn8m.png)
Y mi .conkyrc:
# Cherries
# by londonali1010
background no
update_interval 1
total_run_times 0
own_window yes
own_window_transparent yes
own_window_class Conky
own_window_hints undecorate,sticky,skip_pager,skip_taskbar,below
double_buffer yes
no_buffers yes
text_buffer_size 2048
cpu_avg_samples 2
net_avg_samples 2
override_utf8_locale yes
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders yes
use_spacer none
minimum_size 1000 0
alignment bottom_left
gap_x 12
gap_y 12
uppercase no
use_xft yes
xftfont DejaVu Sans:size=12
xftalpha 0.8
default_color d9b2ad
TEXT
${voffset 300}${font DejaVu Sans:size=24}${time %A}, ${time %d} ${time %B} ${time %Y}${font}
${battery_bar 8,720 BAT1}
${voffset -8}${fs_bar 8,720 /}
${voffset -8}${goto 400}${cpubar 8,310 cpu}
${voffset -8}${goto 400}${font saxMono:size=9}${top pid 1}${font DejaVu Sans:size=8}${voffset -1} ${top name 1}${voffset 1}${goto 660}${font saxMono:size=9}${top cpu 1}
${goto 400}${font saxMono:size=9}${top pid 2}${font DejaVu Sans:size=8}${voffset -1} ${top name 2}${voffset 1}${goto 650}${font saxMono:size=9}${top cpu 2}
${goto 400}${font saxMono:size=9}${top pid 3}${font DejaVu Sans:size=8}${voffset -1} ${top name 3}${voffset 1}${goto 640}${font saxMono:size=9}${top cpu 3}
${goto 400}${font saxMono:size=9}${top pid 4}${font DejaVu Sans:size=8}${voffset -1} ${top name 4}${voffset 1}${goto 620}${font saxMono:size=9}${top cpu 4}
${goto 400}${membar 8, 260}
${goto 400}${font saxMono:size=9}${top_mem pid 1}${font DejaVu Sans:size=8}${voffset -1} ${top_mem name 1}${voffset 1}${goto 620}${font saxMono:size=9}${top_mem mem 1}
${goto 400}${font saxMono:size=9}${top_mem pid 2}${font DejaVu Sans:size=8}${voffset -1} ${top_mem name 2}${voffset 1}${goto 630}${font saxMono:size=9}${top_mem mem 2}
${goto 400}${font saxMono:size=9}${top_mem pid 3}${font DejaVu Sans:size=8}${voffset -1} ${top_mem name 3}${voffset 1}${goto 640}${font saxMono:size=9}${top_mem mem 3}
${goto 400}${font saxMono:size=9}${top_mem pid 4}${font DejaVu Sans:size=8}${voffset -1} ${top_mem name 4}${voffset 1}${goto 650}${font saxMono:size=9}${top_mem mem 4}${font}
${voffset -90}${font route3:size=160}${time %k}${font route3:size=100}${voffset -80}${goto 230}${time %M}${font}
.conkyrc
# conky configuration
# edited by miniminiyo
# set to yes if you want Conky to be forked in the background
background no
# Update interval in seconds
update_interval 1,66
${offset 200}${color slate grey}${nodename}}
${offset 200}${color slate grey}${time %a, } ${color }${time %e %B %G}
${offset 200}${color slate grey}${time %Z, }${color }${time %H:%M:%S}
${offset 200}${color slate grey}UpTime: ${color }$uptime
${offset 200}${color slate grey}Kern:${color }$kernel
${offset 200}${color slate grey}Arquitectura:${color }$machine
${offset 200}${color slate grey}CPU:${color #8F4A4E} $cpu% ${freq_g}Ghz
#${offset 200}${execi 60 sensors | grep 'Core 0' | cut -c16-17}°C / ${execi 30 sensors | grep 'Core 1' | cut -c16-17}
${offset 200}${color slate grey}Load:${color #8F4A4E}$loadavg
${offset 200}${color slate grey}Processes: ${color }$processes
${offset 200}${color slate grey}Running:${color }$running_processes
${offset 200}${color slate grey}Highest CPU:
${offset 200}${color #ddaa00} ${top name 1}${top_mem cpu 1}
${offset 200}${color lightgrey} ${top name 2}${top cpu 2}
${offset 200}${color lightgrey} ${top name 3}${top cpu 3}
${offset 200}${color lightgrey} ${top name 4}${top cpu 4}
${offset 200}${color slate grey}Highest MEM:
${offset 200}${color #ddaa00} ${top_mem name 1}${top_mem mem 1}
${offset 200}${color lightgrey} ${top_mem name 2}${top_mem mem 2}
${offset 200}${color lightgrey} ${top_mem name 3}${top_mem mem 3}
${offset 200}${color lightgrey} ${top_mem name 4}${top_mem mem 4}
${offset 200}${color slate grey}MEM-user: ${color } $memperc% $mem/$memmax
${offset 200}${color slate grey}MEM-buffer: ${color } $buffers
${offset 200}${color slate grey}MEM-cached: ${color } $cached
${offset 200}${color slate grey}MEM-free: ${color } $memfree
${offset 200}${color slate grey}Lectura: ${color #ddaa00}$diskio_read
${offset 200}${color slate grey}Escritura: ${color #8F4A4E}$diskio_write
${offset 200}${color slate grey}Battery: ${color #8F4A4E} $battery_percent %
${offset 200}${color slate grey}/: ${color }${fs_free /}/${fs_size /}
${offset 200}${fs_bar 3,100 /}
${offset 200}${color slate grey}SWAP:${color }${swapperc /}%${color } ${swap /}${swapmax /}
${offset 200}${swapbar 3,100 }
${offset 200}${color slate grey}/HOME: ${color }${fs_free /home}/${fs_size /home}
${offset 200}${fs_bar 3,100 /home}
${offset 200}${color slate grey}NET:
${offset 200}${color}Up: ${color #ddaa00}${upspeed wlan0} ${color #ddaa00}${upspeed eth0}
${offset 200}${color}Down: ${color #8F4A4E}${downspeed wlan0} ${color #8f4a4e}${downspeed eth0}
${offset 200}${color}UpTotal: ${color #ddaa00}${totalup wlan0} ${totalup eth0}
${offset 200}${color}DownTotal: ${color #8F4A4E}${totaldown wlan0} ${totaldown eth0}
${offset 200}${color slate grey}Wireless:
${offset 200}${color}Servidor ${color #8F4A4E}${wireless_essid wlan0}
${offset 200}${color}Calidad ${color #8F4A4E}${wireless_bitrate wlan0}
${offset 200}${color}Modo ${color #8F4A4E}${wireless_mode wlan0}
${offset 200}${color}Calidad % ${color #8F4A4E}${wireless_link_qual_perc wlan0}%
${offset 200}${color}Ip Publica:
${offset 200}${color #8F4A4E}${execi 6000 echo $(curl -s http://ipwhats.appspot.com/ )}
${offset 200}${color}Acces point MAC:
${offset 200}${color #8F4A4E}${wireless_ap wlan0}
${offset 200}$color} Ip Interna:
${offset 200}${color #8F4A4E} ${addrs wlan0}
#${color} ${addrs eth0}
Quedaria asi
(http://frikidetodounpoco.sytes.net/wp-content/uploads/2013/02/Captura-de-pantalla-230713-155649.png)
Configuración en debian 7.
Lo que he añadido al .bashrc (usuario normal).
# Info que se muestra al abrir la shell.
. /home/user/scripts/info.sh
# Alias.
alias srm='shred --remove --zero --force' # Borrado seguro del fichero.
alias ssrm='wipe -rcfq' # Borrado seguro de ficheros y también admite directorios.
alias pastebinit='pastebinit -b http://paste.debian.net' # Pastear código en esa web.
alias pastebincl='pastebincl --guest --expire=1H --name=:B' # Pastear código en pastebin, con parámetros.
alias sprunge="curl -F 'sprunge=<-' http://sprunge.us" # Pastear código en esa web.
# Seteos de variables.
export PS1='${debian_chroot:+($debian_chroot)}\[\e[0;32m\][ STAT:\[\e[0m\] $?\[\e[0;32m\] TERM:\[\e[0m\] pts/\l\[\e[0;32m\] PSHELL:\[\e[0m\] $$\[\e[0;32m\] JOBS:\[\e[0m\] \j\[\e[0;32m\](\[\e[0m\]$!\[\e[0;32m\]) ][ \d\[\e[0;32m\] \t ]\[\e[0m\]\n\[\e[0;32m\]\u\[\e[0;31m\]\342\230\242\[\e[0;32m\]\h \[\e[0;34m\]\W\[\e[0;31m\]\$\[\e[0m\] '
export HISTTIMEFORMAT='%F %T ' # Para ver la fecha de ejecución en `history'.
#export HISTIGNORE='pwd*:ls*:date*:vi*:vim*' # Estos comandos no se logearan.
#export HISTCONTROL="$HISTCONTROL:ignorespace" # Añadir que no logee comandos precedidos por espacios. Por defecto ya esta 'ignoreboth' que ignora los espacios y los comandos duplicados.
#export HISTSIZE=5 # 10 lineas de historial.
shopt -s histappend # Si tienes muchas terminales abiertas, habrá solo un historial entre todas esas terminal.
PROMPT_COMMAND='echo -e "\e[0;32m[ `ls -1 | wc -l` `ls -l | grep ^d | wc -l` `ls -a1 | grep ^[.][^.] | wc -l` ]\e[0m"' # Se ejecuta al final de cada comando introducido.
(https://imageshack.us/a/img593/9275/nyzu.png)
El archivo info.sh al que hago mención.
#!/bin/bash
rojo='\e[0;31m'
verde='\e[0;32m'
normal='\e[0m'
capacidad=`df --human-readable | grep -w "rootfs" | awk '{print $4}'`
ultimo_acc=`last | grep -w "down" | sed -n '1p' | awk '{print $1" en "$2" a "$3" "$5" "$4" "$6" +"$9}'`
echo -e "\n+-----------------------------------------------+"
echo -e "|${rojo}Debian GNU/Linux${normal} ${verde}`cat /etc/debian_version`${normal}"
echo -e "|${rojo}Espacio libre / ${normal}: ${verde}$capacidad${normal}"
echo -e "|${rojo}Last${normal}: ${verde}$ultimo_acc${normal}"
echo -e "+-----------------------------------------------+"
(https://imageshack.us/a/img21/4263/1yee.png)
Cambios en el archivo anterior para el usuario root.
# Funciones.
warning(){
echo -n "Seguro ? [s/n] "
read
if [ "$REPLY" == "s" ]; then
killall wpa_supplicant /usr/bin/python
shred -fuz /etc/wicd/manager-settings.conf /etc/wicd/wireless-settings.conf
shred -fuz /var/log/syslog
shred -fuz /lib/data_e/.encfs6.xml /home/user/.ip.log
shred -fuz /home/user/.irssi/config*
fi
}
# Función para copia de seguridad
backup(){
rsync --verbose --recursive --delete --delete-excluded --links --perms --times --group --owner --files-from=/home/user/scripts/file_backup_rsync --exclude-from=/home/user/scripts/file_backup_rsync_exclude / /media/iomega/Debian_backup/
}
# Seteos de variables.
export PS1='${debian_chroot:+($debian_chroot)}\[\e[0;31m\][ STAT:\[\e[0m\] $?\[\e[0;31m\] TERM:\[\e[0m\] pts/\l\[\e[0;31m\] PSHELL:\[\e[0m\] $$\[\e[0;31m\] JOBS:\[\e[0m\] \j\[\e[0;31m\](\[\e[0m\]$!\[\e[0;31m\]) ][ \d\[\e[0;31m\] \t ]\[\e[0m\]\n\[\e[0;31m\]\u\[\e[0;32m\]\342\230\242\[\e[0;31m\]\h \[\e[0;34m\]\W\[\e[0;32m\]\$\[\e[0m\] '
(https://imageshack.us/a/img20/8826/6lom.png)
Funciones que tenía en el .bashrc pero que saque a archivos separados para que no se cargará tanto el fichero.
Geolocalización de IP.
#!/bin/bash
if [[ $# == 1 && "$1" =~ ^([0-9]{1,3}\.){3}[0-9]{1,3}$ ]]; then
curl "http://api.hostip.info/get_html.php?ip=${1}"
exit 0
fi
if [[ $# == 2 && "$2" =~ ^([0-9]{1,3}\.){3}[0-9]{1,3}$ ]]; then
if [ "$1" == "-c" ]; then
curl "http://api.hostip.info/country.php?ip=${2}"
echo
exit 0
elif [ "$1" == "-p" ]; then
curl "http://api.hostip.info/get_html.php?ip=${2}&position=true"
exit 0
elif [ "$1" == "-xml" ]; then
curl "http://api.hostip.info/?ip=${2}"
exit 0
elif [ "$1" == "-json" ]; then
curl "http://api.hostip.info/get_json.php?ip=${2}"
echo
exit 0
elif [ "$1" == "-pjson" ]; then
curl "http://api.hostip.info/get_json.php?ip=${2}&position=true"
echo
exit 0
fi
fi
printf "Uso: geoip <OPTION> <IP>
Por defecto muestra país con código, ciudad con código,
y la propia IP. Solo admite una opción a la vez.\n
-json Muestra la salida en formato json.
-c Visualizamos solo el código del país.
-p Muestra además la latitud y longitud.
-pjson Lo mismo que \"-p\" pero en formato json.
-xml Muestra toda la info en formato xml.\n\n"
exit 1
Escanear la red en busca de hosts vivos (CDIR es la ip de red con máscara del tipo /24).
#!/bin/bash
if [ $# -ne 1 ]; then
printf "Uso: escanear CDIR\n"
echo
exit 1
else
fping -a -g "$1" 2> /dev/null
echo
fi
exit 0
Subir un archivo a esa web, con opción de comprimirlo para evitar que bloquee extensiones no permitidas.
#!/bin/bash
if [[ $# -eq 2 && "$1" == "--zip" ]]; then
7z -tzip a "$2".zip "$2"
curl -F "file=@${2}.zip" https://anonfiles.com/api?plain
shred --zero --force --remove "$2".zip
echo
elif [ $# -eq 1 ]; then
curl -F "file=@${1}" https://anonfiles.com/api?plain
echo
else
printf "Uso: anonfiles file.zip\n\
--zip Comprime el archivo antes de enviarlo.\n"
echo
exit 1
fi
exit 0
Archivo .xinitrc completo.
#!/bin/bash
exec setxkbmap es &
xset r rate 200 40
#. ~/scripts/random_wallpaper.sh
urxvt -geometry 128x25 -cr '#CCCCCC' -bg '#080808' -fg '#CCCCCC' -fn "xft:Bitstream Vera Sans Mono:pixelsize=14" -pe default,matcher,tabbed &
iceweasel &
volumen()
{
STAT="`amixer get PCM | echo $?`"
if [ $STAT -ne 0 ]; then
echo "Mute"
else
echo "`amixer get PCM | awk '/Front\ Left:/ {print $5}' | sed 's/^\[\(.*\)\]$/\1/'`"
fi
}
red()
{
# Interfaz valida solo para wifi wlanX.
ESTADO="`/sbin/iwgetid`"
if [ "$ESTADO" != "" ]; then
ESSID="`/sbin/iwgetid --raw`"
INTERFAZ="`/sbin/iwgetid | awk '{print $1}'`"
SENAL="`/sbin/iwconfig 2> /dev/null | sed -n "/${INTERFAZ}/{n;n;n;n;n;p;}" | awk -F'=' '{printf $NF}' | sed 's/\s//g'`"
BITR="`/sbin/iwconfig 2> /dev/null | sed -n "/${INTERFAZ}/{n;n;p;}" | sed -E 's/^[^=]+=([.0-9]+)\s.*/\1Mb\/s/'`"
MI_MAC="`/sbin/ifconfig | grep $INTERFAZ | awk '{print $5}' | cut -c1-8`" # Mac de mi tarjeta, solo tres primeros pares.
AP="`/sbin/iwgetid --raw --ap | cut -c1-8`" # Mac del AP, solo tres primeros pares.
IP_EXT="`cat ~/scripts/data_xsetroot | sed -n '4p'`" # Contiene la ip externa, solo tres primeros octetos.
HOSTS="`cat ~/scripts/data_xsetroot | sed -n '2p'`" # Contiene el número de equipos conectados a nuestra red
echo "$ESSID($AP) $SENAL $BITR $INTERFAZ($MI_MAC) $IP_EXT $HOSTS"
else
echo "Sin conexion"
fi
}
temp(){
GRADOS=`sensors | sed -E -n '/Adapter: PCI adapter/{n;p;}' | sed -E 's/^.*\+([^ ]+)\s+$/\1/'`;
echo "$GRADOS";
}
#cancion()
#{
# if [ "`mocp --info | wc -l`" -ne 0 ]; then
# TITULO_B="`mocp -Q %song`"
# ARTISTA_B="`mocp -Q %artist`"
## TOTAL="`mocp -i|awk '/TotalTime/ {print $2}'`"
# echo "$ARTISTA_B - $TITULO_B"
# else
# echo "Musica OFF"
# fi
#}
while true;
do
xsetroot -name "[ `volumen` ][ `temp` ][ `red` ]`date +"[ %a %d %b %Y %T ]"`"
sleep 5
done &
exec /usr/local/bin/dwm
El archivo data_xsetroot al que hago referencia lo genera este script que se ejecuta en `cron' cada 10 minutos.
#!/bin/bash
ESTADO="`/sbin/iwgetid`"
if [ "$ESTADO" != "" ]; then
INTERFAZ="`/sbin/iwgetid | awk '{print $1}'`"
IP_PRIV="`/sbin/ifconfig $INTERFAZ | grep "inet addr" | awk '{printf $2}' | cut --delimiter=':' --fields=2`" # Saca la ip privada.
NETMASK="`/sbin/ifconfig $INTERFAZ | grep "Mask" | awk -F':' '{printf $NF}'`" # Saca la máscara de nuestra red.
CDIR="`ipcalc $IP_PRIV $NETMASK | grep -w "Network:" | awk '{printf $2}'`" # Calcula la red en la que estamos, con la máscara en notación cdir.
ALIVE="`fping -a -g $CDIR 2> /dev/null | wc -l`" # Escanea los hosts de la red.
sed -i "2s/^.*$/${ALIVE}/" ~/scripts/data_xsetroot # Escribe la info a ese fichero.
IP_EXT="`curl --user-agent "Mozilla/4.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" --connect-timeout 20 --max-time 30 --retry 3 --retry-delay 2 --retry-max-time 30 --silent --stderr /dev/null ifconfig.me/ip`" # Obtenemos la ip pública.
IP_TRUNK="`echo $IP_EXT | awk -F'.' '{printf $1"."$2"."$3 }'`" # Cortamos el último octeto de la ip pública.
if [ "$IP_TRUNK" != ".." ]; then
sed -i "4s/^.*$/${IP_TRUNK}/" ~/scripts/data_xsetroot
else
sed -i "4s/^.*$/NO_IP/" ~/scripts/data_xsetroot
fi
ESSID_LOG="`/sbin/iwgetid --raw`" # Sacamos el essid de la red.
AP_LOG="`/sbin/iwgetid --raw --ap`" # Sacamos la mac del ap.
echo "`date +'[ %a %d %b %Y %T ]'` $ESSID_LOG $AP_LOG $IP_EXT $ALIVE" >> ~/.ip.log # Enviamos info estadística a ese fichero.
else
exit
fi
(https://imageshack.us/a/img34/5801/am3x.png)
Archivo de configuración de dwm config.h completo.
/* See LICENSE file for copyright and license details. */
/* appearance */
static const char font[] = "-*-terminus-medium-r-*-*-12-*-*-*-*-*-*-*"; //Instalas xfonts-terminus para que tenga efecto.
static const char normbordercolor[] = "#FF0000"; //cccccc_rojo_ventanas en las que no estamos.
static const char normbgcolor[] = "#000000"; //cccccc_negro_fondo barra.
static const char normfgcolor[] = "#FFFF00"; //000000_amarillo_letras barra sin ejecutar nada.
static const char selbordercolor[] = "#00FF00"; //0066ff_verde_ventana en la que estamos.
static const char selbgcolor[] = "#545454"; //0066ff_gris_fondo barra al ejecutar terminal
static const char selfgcolor[] = "#FFFF00"; //ffffff_amarillo_letras barra al ejecutar terminal
static const unsigned int borderpx = 1; /* border pixel of windows */
static const unsigned int snap = 32; /* snap pixel */
static const Bool showbar = True; /* False means no bar */
static const Bool topbar = True; /* False means bottom bar */
/***k133***
const unsigned int pst = 1;
***k133***/
/* tagging */
static const char *tags[] = { "I", "II", "III", "IV", "V" };
static const Rule rules[] = {
/* class instance title tags mask isfloating monitor */
{ NULL, NULL, NULL, 0, False, -1 },
};
/* layout(s) */
static const float mfact = 0.5; /* factor of master area size [0.05..0.95] */
static const int nmaster = 1; /* number of clients in master area */
static const Bool resizehints = True; /* True means respect size hints in tiled resizals */
static const Layout layouts[] = {
/* symbol arrange function */
/* first entry is default */
{ "[F]", NULL }, /* no layout function means floating behavior */
{ "[T]", tile },
{ "[M]", monocle },
};
/* key definitions */
#define MODKEY Mod4Mask /*antes= Mod1Mask que es el alt, ahora esta la de windows*/
#define TAGKEYS(KEY,TAG) \
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
{ MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
{ MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/bash", "-c", cmd, NULL } } //***k133*** sh * bash
/* commands */
static const char *dmenucmd[] = { "dmenu_run", "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
static const char *termcmd[] = { "urxvt", "-geometry", "128x25", "-cr", "#CCCCCC", "-bg", "#080808", "-fg", "#CCCCCC", "-fn", "xft:Bitstream Vera Sans Mono:pixelsize=14", "-pe", "default,matcher,tabbed", NULL };
// static const char *lockmonitor[] = { "xlock", NULL };
static Key keys[] = {
/* modifier key function argument */
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
// { MODKEY|ShiftMask, XK_z, spawn, {.v = lockmonitor } },
{ MODKEY, XK_b, togglebar, {0} },
{ MODKEY, XK_j, focusstack, {.i = +1 } },
{ MODKEY, XK_k, focusstack, {.i = -1 } },
{ MODKEY, XK_i, incnmaster, {.i = +1 } },
{ MODKEY, XK_d, incnmaster, {.i = -1 } },
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
{ MODKEY, XK_l, setmfact, {.f = +0.05} },
{ MODKEY, XK_Return, zoom, {0} },
{ MODKEY, XK_Tab, view, {0} },
{ MODKEY|ShiftMask, XK_c, killclient, {0} },
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
{ MODKEY, XK_space, setlayout, {0} },
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
{ MODKEY, XK_0, view, {.ui = ~0 } },
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
{ MODKEY, XK_comma, focusmon, {.i = -1 } },
{ MODKEY, XK_period, focusmon, {.i = +1 } },
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
{ MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
TAGKEYS( XK_1, 0)
TAGKEYS( XK_2, 1)
TAGKEYS( XK_3, 2)
TAGKEYS( XK_4, 3)
TAGKEYS( XK_5, 4)
TAGKEYS( XK_6, 5)
TAGKEYS( XK_7, 6)
TAGKEYS( XK_8, 7)
TAGKEYS( XK_9, 8)
{ MODKEY|ShiftMask, XK_q, quit, {0} },
/***k133***
/usr/include/X11/keysymdef.h
{ MODKEY, XK_Right, view, {.ui = pst = pst << 1} },
{ MODKEY, XK_Left, view, {.ui = pst = pst >> 1} },
{ MODKEY, XK_Up, view, {.ui = 0} },
{ MODKEY, XK_Down, view, {.ui = 4} }, */
};
/* button definitions */
/* click can be ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
static Button buttons[] = {
/* click event mask button function argument */
{ ClkLtSymbol, 0, Button1, setlayout, {0} },
{ ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
{ ClkWinTitle, 0, Button2, zoom, {0} },
{ ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
{ ClkClientWin, MODKEY, Button1, movemouse, {0} },
{ ClkClientWin, MODKEY, Button2, togglefloating, {0} },
{ ClkClientWin, MODKEY, Button3, resizemouse, {0} },
// { ClkTagBar, 0, Button1, view, {0} },
// { ClkTagBar, 0, Button3, toggleview, {0} },
// { ClkTagBar, MODKEY, Button1, tag, {0} },
// { ClkTagBar, MODKEY, Button3, toggletag, {0} },
};
Escritorio limpio.
(https://imageshack.us/a/img543/5958/9m50.png) (https://imageshack.us/a/img543/5958/9m50.png)
(Clickear en la imagen para agrandar.)
Escritorio ocupado.
(https://imageshack.us/a/img191/6393/gyup.png)
(https://imageshack.us/a/img191/6393/gyup.png)
(Clickear en la imagen para agrandar.)
Archivo .inputrc
set editing-mode vi
Configuración de vim vimrc
" All system-wide defaults are set in $VIMRUNTIME/debian.vim (usually just
" /usr/share/vim/vimcurrent/debian.vim) and sourced by the call to :runtime
" you can find below. If you wish to change any of those settings, you should
" do it in this file (/etc/vim/vimrc), since debian.vim will be overwritten
" everytime an upgrade of the vim packages is performed. It is recommended to
" make changes after sourcing debian.vim since it alters the value of the
" 'compatible' option.
" This line should not be removed as it ensures that various options are
" properly set to work with the Vim-related packages available in Debian.
runtime! debian.vim
" Uncomment the next line to make Vim more Vi-compatible
" NOTE: debian.vim sets 'nocompatible'. Setting 'compatible' changes numerous
" options, so any other options should be set AFTER setting 'compatible'.
"set compatible
" Vim5 and later versions support syntax highlighting. Uncommenting the next
" line enables syntax highlighting by default.
syntax on
" If using a dark background within the editing area and syntax highlighting
" turn on this option as well
"set background=dark
" Uncomment the following to have Vim jump to the last position when
" reopening a file
"if has("autocmd")
" au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
"endif
" Uncomment the following to have Vim load indentation rules and plugins
" according to the detected filetype.
"if has("autocmd")
" filetype plugin indent on
"endif
" The following are commented out as they cause vim to behave a lot
" differently from regular Vi. They are highly recommended though.
set showcmd " Show (partial) command in status line.
"set showmatch
"set ignorecase
"set smartcase
set incsearch " Incremental search
"set autowrite
"set hidden
"set mouse=a
" Source a global configuration file if available
if filereadable("/etc/vim/vimrc.local")
source /etc/vim/vimrc.local
endif
set fileencoding=utf-8
set encoding=utf-8
set termencoding=utf-8
"set autoindent
set number " Numero de línea
set history=1000 " Recordar más lineas.
set tabstop=2 " Espacio para tabulador.
set shiftwidth=2 " Número de espacios que insertará el '>'
set expandtab " Los tabs los pasa a espacios.
set hlsearch " Resaltar búsquedas.
set textwidth=0 " No poner limite en ancho.
"set nowrap
" Corrección ortográfica.
" Descomentar la lineas para que la corrección solo se haga en ficheros con esas extensiones.
"augroup filetypedetect
"au BufNewFile,BufRead *.tex set spell
"au BufNewFile,BufRead *.txt set spell
"augroup END
set spell spelllang=es,en
set spellfile=/etc/vim/spell/es.utf-8.add
set printdevice=pdf " Para imprimir a pdf
set printoptions=syntax:y,paper:A4,left:5pc,right:5pc,top:5pc,bottom:5pc " Parámetros de impresión.
set printheader=%=%N " Cabecera en las hojas
set printfont=Monospace:h10
set printexpr=PrintFile(v:fname_in)
function! PrintFile(fname)
call system("lp " . (&printdevice == '' ? '' : ' -s -d' . &printdevice) . ' ' . a:fname)
call delete(a:fname)
return v:shell_error
endfunc
" Seteos especiales para archivos de programación.
autocmd FileType c,sh,sql,py,pl,html,php,xml setlocal cindent nospell autoindent
" Snippets
autocmd FileType c inoremap {<cr> {<cr><cr>}<up><tab>
autocmd FileType c inoremap print printf("",);<left><left><left><left>
" Uso de pliegues por indentación
set foldmethod=indent " Para pliegues con {{{,}}} poner marker.
"Si logs de los comandos introducidos
set viminfo=
"Esquema de resalto de sintaxis personalizado.
colorscheme elflord_mod