martes, 13 de agosto de 2013
martes, 6 de agosto de 2013
Información meteorológica en conky
Lo primero será conseguir datos fiables. Para mi localización geográfica creo que los más adecuados serán los de http://www.aemet.es. Esta web proporciona los datos en un archivo xml con la predicción para siete días.
Suponiendo que sea Horcajuelo de la sierra (Madrid) descargaré este fichero:
wget http://www.aemet.es/xml/municipios/localidad_28071.xmlPara hacerlo más fácilmente legible he filtrado el archivo con este comando:
sed -e '1,/\/origen/d;s/<\/[^>]*>//g;s/<//g;s/>/ /g;s/elaborado //' localidad_28071.xmlAhora vamos a ver que pone.
- la fecha y hora en la que se ha generado el archivo
- la localidad
- la provincia
- la predicción para hoy en intervalos de 6 horas
- la de mañana y pasado en intervalos de 12 horas
- la de los cuatro días siguientes en un formato menos detallado
Bien, creo que será suficiente descargar este archivo únicamente una vez al día por lo cual crearé una tarea cron para obtenerlo.
Para conseguir los datos actuales en tiempo real (cada hora) escogeré la estación meteorológica que más me conviene desde esta dirección:
En este caso, la estación más cercana a Horcajuelo es la de Buitrago de Lozoya así que descargaré este archivo:
wget "http://www.aemet.es/es/eltiempo/observacion/ultimosdatos?k=mad&l=3110C&w=0&datos=img&x=h24&f=Todas" -O ultimosdatosponemos la dirección entre comillas porque si no se va quedar en el primer ampersand ( & ).
Una vez más, hay que filtrar el archivo. Estudiándolo un poquito se ve que resulta suficiente ejecutar el siguiente comando:
grep "\[23 ,[^ ]" ultimosdatos | sed -e 's/\[23 ,//g;s/\]//g'para obtener los últimos datos de
-Temperatura
-Viento
-Rachas
-Precipitaciones
-Presión
-Humedad
Así que podemos también crear otra tarea cron que se ejecute cada hora para descargar los datos.
Creo que usaré los iconos /usr/share/icons/gnome/48x48/status
domingo, 4 de agosto de 2013
Montar imágenes .vdi
La herramienta vditool no está disponible. Dándole unas cuantas vueltas y gracias a esta información:
http://www.vicente-navarro.com/blog/2008/07/27/montar-imagenes-de-disco-vdi-de-virtualbox/
https://www.virtualbox.org/ticket/4843
¿De dónde sale ese 63? De aquí:
http://www.vicente-navarro.com/blog/2008/07/27/montar-imagenes-de-disco-vdi-de-virtualbox/
https://www.virtualbox.org/ticket/4843
# VBoxManage internalcommands dumphdinfo reactos.vdiCon lo cual ya se puede montar tranquilamente
# mount -t vfat -o loop,offset=$((12288+63*512)) reactos.vdi /mnt¿De dónde sale ese 63? De aquí:
# aptitude install qemu kvm
# modprobe nbd 
# qemu-nbd -c /dev/nbd0 VirtualBox\ VMs/reactos/reactos.vdi
# sfdisk -d /dev/nbd0
jueves, 18 de julio de 2013
Screenshots matchbox-window-manager
No entiendo cómo se murió este proyecto aunque algo queda por ahí Estuve buscando algo como maemo o meego para mi netbook de 9", algo que no fuera android. Buscaba una optimización de la pantalla para poder hacer lo que haría en una pantalla más grande sin las restricciones de esos sistemas operativos enfocados a la nube. Bueno, como siempre, Debian, que es lo que conozco un poquitín.
Matchbox no es para desktop, según dicen, pero a mí me hace el apaño fenomenal. Aquí unas capturas (todo GTK, nada de NOKIA, no jodamos, que ahora están con el windor, pf).
GTK= Gimp Tool Kit. Para el que no lo sepa se escribió para desarrollar el GIMP, luego ya vinieron GNOME y todo eso. Lo que venía a ser software libre. (GIMP=Gnu Image Manipulation Program).
Y ahora me voy a ver si consigo la trifuerza XDDD, no está fácil.
martes, 9 de julio de 2013
Archivos de configuración de matchbox (II)
~/.conkyrc
#==============================================================================
# conkyrc_seamod_modification
# Date : 22/04/2012
# Author : atareao
# Version : v0.1
# License : Distributed under the terms of GNU GPL version 2 or later
#
# This version is a modification of conkyrc_seamode which is a modification of conkyrc_lunatico which is modification of conkyrc_orange -> Y yo también lo he modificao XDDD
#
# conkyrc_orange: http://gnome-look.org/content/show.php?content=137503&forumpage=0
# conkyrc_lunatico: http://gnome-look.org/content/show.php?content=142884
# conkyrc_seamod: http://miragesoft.deviantart.com/#/d4orjxy
#==============================================================================
background no
update_interval 1
cpu_avg_samples 1
net_avg_samples 2
temperature_unit celsius
double_buffer yes
no_buffers yes
text_buffer_size 2048
gap_x 20
gap_y 50
minimum_size 924 600
maximum_width 925
own_window no
own_window_type override
own_window_transparent yes
own_window_argb_visual yes
own_window_type normal
own_window_class conky-semi
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
border_inner_margin 0
border_outer_margin 0
alignment tl
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
override_utf8_locale yes
use_xft yes
xftfont caviar dreams:size=10
xftalpha 0.5
uppercase no
# Defining colors
default_color FFFFFF
# Shades of Gray
color1 444444
color2 AAAAAA
color3 888888
# Orange
color4 000000
# Green
color5 000000
# Loading lua script for drawning rings
lua_load ~/.conky/conky_rings.lua
lua_draw_hook_post main
## System information using conky capabilities
# Header with base system info
TEXT
${offset 700}${font Ubuntu:size=10,weight:bold}${color2}SISTEMA ${hr 2}
${offset 715}${font Ubuntu:size=10,weight:normal}${color2}$sysname $kernel
${offset 715}${font Ubuntu:size=10,weight:normal}${color2}$nodename
${offset 715}${font Ubuntu:size=10,weight:normal}${color2}Uptime: $uptime
${voffset 15}
${goto 815}${color2}${font ubuntu:size=22}${time %e}
${goto 815}${color1}${voffset -15}${font ubuntu:size=10}${time %A}
${goto 815}${color2}${voffset 1}${font ubuntu:size=9}${time %b}${voffset -2} ${color3}${font ubuntu:size=12}${time %Y}${font}
# Showing CPU Graph
${voffset -30}
${offset 780}${cpugraph 40,227 666666 666666}${voffset -27}
${offset 730}${font Ubuntu:size=10,weight:bold}${color2}CPU
# Showing TOP 5 CPU-consumers
${offset 745}${font Ubuntu:size=10,weight:normal}${color2}${top name 1}${alignr}${top cpu 1}%
${offset 745}${font Ubuntu:size=10,weight:normal}${color3}${top name 2}${alignr}${top cpu 2}%
${offset 745}${font Ubuntu:size=10,weight:normal}${color3}${top name 3}${alignr}${top cpu 3}%
${offset 745}${font Ubuntu:size=10,weight:normal}${color1}${top name 4}${alignr}${top cpu 4}%
${offset 745}${font Ubuntu:size=10,weight:normal}${color1}${top name 5}${alignr}${top cpu 5}%
#Showing memory part with TOP 5
${voffset 40}
${offset 730}${font Ubuntu:size=10,weight:bold}${color2}MEMORIA
${offset 745}${font Ubuntu:size=10,weight:normal}${color2}${top_mem name 1}${alignr}${top_mem mem 1}%
${offset 745}${font Ubuntu:size=10,weight:normal}${color3}${top_mem name 2}${alignr}${top_mem mem 2}%
${offset 745}${font Ubuntu:size=10,weight:normal}${color3}${top_mem name 3}${alignr}${top_mem mem 3}%
${offset 745}${font Ubuntu:size=10,weight:normal}${color1}${top_mem name 4}${alignr}${top_mem mem 4}%
${offset 745}${font Ubuntu:size=10,weight:normal}${color1}${top_mem name 4}${alignr}${top_mem mem 5}%
# Showing disk partitions: root, home and Data
${voffset -338}
${offset 180}${font Ubuntu:size=10,weight:bold}${color2}DISCOS ${voffset -20}${diskiograph 33,121 666666 666666}
${voffset -32}
${offset 180}${font Ubuntu:size=9,weight:bold}${color1}Free: ${color2}${font Ubuntu:size=9,weight:normal}${fs_free /}${font Ubuntu:size=9,weight:bold} ${color1}Used: ${color2}${font Ubuntu:size=9,weight:normal}${fs_used /}
${offset 180}${font Ubuntu:size=9,weight:bold}${color1}Free: ${color2}${font Ubuntu:size=9,weight:normal}${fs_free /home}${font Ubuntu:size=9,weight:bold} ${color1}Used: ${color2}${font Ubuntu:size=9,weight:normal}${fs_used /home}
${offset 180}${font Ubuntu:size=9,weight:bold}${color1}Free: ${color2}${font Ubuntu:size=9,weight:normal}${fs_free /mnt}${font Ubuntu:size=9,weight:bold} ${color1}Used: ${color2}${font Ubuntu:size=9,weight:normal}${fs_used /mnt}
# Network data (my desktop have only LAN). ETHERNET ring is mostly useless but looks pretty, main info is in the graphs
${offset 180}${font Ubuntu:size=10,weight:bold}${color2}RED
${voffset 50}
${offset 180}${color1}${font Ubuntu:size=9,weight:bold}Up: ${font Ubuntu:size=9,weight:normal}$color2${upspeed wlan0} / ${totalup wlan0}
${offset 180}${voffset -80}${upspeedgraph wlan0 40,183 4B1B0C FF5C2B }
${voffset 80}
${offset 180}${color1}${font Ubuntu:size=9,weight:bold}Down: ${font Ubuntu:size=9,weight:normal}$color2${downspeed wlan0} / ${totaldown wlan0}
${voffset -80}
${offset 180}${downspeedgraph wlan0 40,183 324D23 77B753 }
${offset 40}${font Ubuntu:size=10,weight:bold}${color2}BATERÍA
${offset 40}${battery BAT0} ${color1} ${battery_time}${if_match ${battery_percent BAT0} >= 80}${color 77B753}${endif}${if_match ${battery_percent BAT0} <= 79}${color CDC959}${endif}${if_match ${battery_percent BAT0} <= 49}${color FF5C2B}${endif}${if_match ${battery_percent BAT0} <= 19}${color B32319}${endif}
${offset 40}${battery_bar 10,203 BAT0}
${offset 400}${voffset -230}${color2}CONEXIÓN
${offset 420}${color1}IP local: ${color2}${addr wlan0}
${offset 420}${color1}IP externa: ${color2}${execi 3600 wget -O - http://ip.tupeux.com | tail}
${offset 420}${color1}ESSID: ${color2}${wireless_essid wlan0} ${wireless_link_qual_perc wlan0}%
${offset 400}${color2}MOC:
${offset 420}${color1}Artista: ${color2}${exec mocp -Q %artist}
${offset 420}${color1}Album: ${color2}${exec mocp -Q %album}
${offset 420}${color1}Canción: ${color2}${exec mocp -Q %song}
${voffset -380}
${offset 400}${color2}CALENDARIO
${offset 410}${font Monospace:size=12}${color1}${exec cal| head -n -6 | tail -n -1}
${offset 410}${font Monospace:size=12}${color2}${exec cal| head -n -5 | tail -n -1}
${offset 410}${font Monospace:size=12}${color2}${exec cal| head -n -4 | tail -n -1}
${offset 410}${font Monospace:size=12}${color2}${exec cal| head -n -3 | tail -n -1}
${offset 410}${font Monospace:size=12}${color2}${exec cal| head -n -2 | tail -n -1}
${offset 410}${font Monospace:size=12}${color2}${exec cal| head -n -1 | tail -n -1}
~/.conky/conky_rings.lua
--==============================================================================
-- seamod_rings.lua
--
-- Date : 05/02/2012
-- Author : SeaJey -> También lo he modificado ligeramente.
-- Version : v0.1
-- License : Distributed under the terms of GNU GPL version 2 or later
--
-- This version is a modification of lunatico_rings.lua wich is modification of conky_orange.lua
--
-- conky_orange.lua: http://gnome-look.org/content/show.php?content=137503&forumpage=0
-- lunatico_rings.lua: http://gnome-look.org/content/show.php?content=142884
--==============================================================================
require 'cairo'
--------------------------------------------------------------------------------
-- clock DATA
-- HOURS
clock_h = {
{
name='time', arg='%H', max_value=12,
x=930, y=145,
graph_radius=53,
graph_thickness=3,
graph_unit_angle=30, graph_unit_thickness=30,
graph_bg_colour=0xffffff, graph_bg_alpha=0.0,
graph_fg_colour=0xFFFFFF, graph_fg_alpha=0.3,
txt_radius=34,
txt_weight=1, txt_size=10.0,
txt_fg_colour=0xFFFFFF, txt_fg_alpha=0.6,
graduation_radius=53,
graduation_thickness=6, graduation_mark_thickness=2,
graduation_unit_angle=30,
graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
},
}
-- MINUTES
clock_m = {
{
name='time', arg='%M', max_value=60,
x=930, y=145,
graph_radius=57,
graph_thickness=2,
graph_unit_angle=6, graph_unit_thickness=6,
graph_bg_colour=0xffffff, graph_bg_alpha=0.1,
graph_fg_colour=0xFFFFFF, graph_fg_alpha=0.3,
txt_radius=70,
txt_weight=0, txt_size=9.0,
txt_fg_colour=0xFFFFFF, txt_fg_alpha=0.6,
graduation_radius=57,
graduation_thickness=0, graduation_mark_thickness=2,
graduation_unit_angle=30,
graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
},
}
-- SECONDS
clock_s = {
{
name='time', arg='%S', max_value=60,
x=930, y=145,
graph_radius=50,
graph_thickness=2,
graph_unit_angle=6, graph_unit_thickness=2,
graph_bg_colour=0xffffff, graph_bg_alpha=0.0,
graph_fg_colour=0xFFFFFF, graph_fg_alpha=0.2,
txt_radius=40,
txt_weight=0, txt_size=12.0,
txt_fg_colour=0xFFFFFF, txt_fg_alpha=0.3,
graduation_radius=0,
graduation_thickness=0, graduation_mark_thickness=0,
graduation_unit_angle=0,
graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.0,
},
}
--------------------------------------------------------------------------------
-- gauge DATA
gauge = {
{
name='cpu', arg='cpu0', max_value=100,
x=730, y=230,
graph_radius=54,
graph_thickness=5,
graph_start_angle=180,
graph_unit_angle=2.7, graph_unit_thickness=2.7,
graph_bg_colour=0xffffff, graph_bg_alpha=0.1,
graph_fg_colour=0xFFFFFF, graph_fg_alpha=0.3,
hand_fg_colour=0xEF5A29, hand_fg_alpha=1.0,
txt_radius=64,
txt_weight=0, txt_size=9.0,
txt_fg_colour=0xEF5A29, txt_fg_alpha=1.0,
graduation_radius=28,
graduation_thickness=0, graduation_mark_thickness=1,
graduation_unit_angle=27,
graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
caption='',
caption_weight=1, caption_size=9.0,
caption_fg_colour=0xFFFFFF, caption_fg_alpha=0.3,
},
{
name='cpu', arg='cpu1', max_value=100,
x=730, y=230,
graph_radius=48,
graph_thickness=5,
graph_start_angle=180,
graph_unit_angle=2.7, graph_unit_thickness=2.7,
graph_bg_colour=0xffffff, graph_bg_alpha=0.1,
graph_fg_colour=0xFFFFFF, graph_fg_alpha=0.3,
hand_fg_colour=0xEF5A29, hand_fg_alpha=1.0,
txt_radius=40,
txt_weight=0, txt_size=9.0,
txt_fg_colour=0xEF5A29, txt_fg_alpha=1.0,
graduation_radius=28,
graduation_thickness=0, graduation_mark_thickness=1,
graduation_unit_angle=27,
graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
caption='',
caption_weight=1, caption_size=9.0,
caption_fg_colour=0xFFFFFF, caption_fg_alpha=0.3,
},
{
name='memperc', arg='', max_value=100,
x=730, y=410,
graph_radius=48,
graph_thickness=5,
graph_start_angle=180,
graph_unit_angle=2.7, graph_unit_thickness=2.7,
graph_bg_colour=0xffffff, graph_bg_alpha=0.1,
graph_fg_colour=0xFFFFFF, graph_fg_alpha=0.3,
hand_fg_colour=0xEF5A29, hand_fg_alpha=1.0,
txt_radius=40,
txt_weight=0, txt_size=9.0,
txt_fg_colour=0xEF5A29, txt_fg_alpha=1.0,
graduation_radius=23,
graduation_thickness=0, graduation_mark_thickness=2,
graduation_unit_angle=27,
graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.5,
caption='',
caption_weight=1, caption_size=10.0,
caption_fg_colour=0xFFFFFF, caption_fg_alpha=0.3,
},
{
name='swapperc', arg='', max_value=100,
x=730, y=410,
graph_radius=54,
graph_thickness=5,
graph_start_angle=180,
graph_unit_angle=2.7, graph_unit_thickness=2.7,
graph_bg_colour=0xffffff, graph_bg_alpha=0.1,
graph_fg_colour=0xFFFFFF, graph_fg_alpha=0.3,
hand_fg_colour=0xEF5A29, hand_fg_alpha=1.0,
txt_radius=64,
txt_weight=0, txt_size=9.0,
txt_fg_colour=0xEF5A29, txt_fg_alpha=1.0,
graduation_radius=23,
graduation_thickness=0, graduation_mark_thickness=2,
graduation_unit_angle=27,
graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.5,
caption='',
caption_weight=1, caption_size=10.0,
caption_fg_colour=0xFFFFFF, caption_fg_alpha=0.3,
},
{
name='fs_used_perc', arg='/mnt', max_value=100,
x=125, y=230,
graph_radius=54,
graph_thickness=7,
graph_start_angle=180,
graph_unit_angle=2.7, graph_unit_thickness=2.7,
graph_bg_colour=0xffffff, graph_bg_alpha=0.1,
graph_fg_colour=0xFFFFFF, graph_fg_alpha=0.3,
hand_fg_colour=0xEF5A29, hand_fg_alpha=1.0,
txt_radius=64,
txt_weight=0, txt_size=9.0,
txt_fg_colour=0xEF5A29, txt_fg_alpha=1.0,
graduation_radius=23,
graduation_thickness=0, graduation_mark_thickness=2,
graduation_unit_angle=27,
graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
caption='Mount',
caption_weight=1, caption_size=12.0,
caption_fg_colour=0xFFFFFF, caption_fg_alpha=0.5,
},
{
name='fs_used_perc', arg='/home/', max_value=100,
x=125, y=230,
graph_radius=42,
graph_thickness=7,
graph_start_angle=180,
graph_unit_angle=2.7, graph_unit_thickness=2.7,
graph_bg_colour=0xffffff, graph_bg_alpha=0.1,
graph_fg_colour=0xFFFFFF, graph_fg_alpha=0.3,
hand_fg_colour=0xEF5A29, hand_fg_alpha=1.0,
txt_radius=32,
txt_weight=0, txt_size=9.0,
txt_fg_colour=0xEF5A29, txt_fg_alpha=1.0,
graduation_radius=23,
graduation_thickness=0, graduation_mark_thickness=2,
graduation_unit_angle=27,
graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
caption='Home',
caption_weight=1, caption_size=12.0,
caption_fg_colour=0xFFFFFF, caption_fg_alpha=0.5,
},
{
name='fs_used_perc', arg='/', max_value=100,
x=125, y=230,
graph_radius=30,
graph_thickness=7,
graph_start_angle=180,
graph_unit_angle=2.7, graph_unit_thickness=2.7,
graph_bg_colour=0xffffff, graph_bg_alpha=0.1,
graph_fg_colour=0xFFFFFF, graph_fg_alpha=0.3,
hand_fg_colour=0xEF5A29, hand_fg_alpha=1.0,
txt_radius=22,
txt_weight=0, txt_size=9.0,
txt_fg_colour=0xEF5A29, txt_fg_alpha=1.0,
graduation_radius=23,
graduation_thickness=0, graduation_mark_thickness=2,
graduation_unit_angle=27,
graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
caption='Root',
caption_weight=1, caption_size=12.0,
caption_fg_colour=0xFFFFFF, caption_fg_alpha=0.5,
},
{
name='downspeedf', arg='wlan0', max_value=100,
x=125, y=410,
graph_radius=54,
graph_thickness=7,
graph_start_angle=180,
graph_unit_angle=2.7, graph_unit_thickness=2.7,
graph_bg_colour=0xffffff, graph_bg_alpha=0.1,
graph_fg_colour=0xFFFFFF, graph_fg_alpha=0.3,
hand_fg_colour=0xEF5A29, hand_fg_alpha=0,
txt_radius=64,
txt_weight=0, txt_size=9.0,
txt_fg_colour=0xEF5A29, txt_fg_alpha=1.0,
graduation_radius=28,
graduation_thickness=0, graduation_mark_thickness=1,
graduation_unit_angle=27,
graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
caption='Down',
caption_weight=1, caption_size=12.0,
caption_fg_colour=0xFFFFFF, caption_fg_alpha=0.5,
},
{
name='upspeedf', arg='wlan0', max_value=100,
x=125, y=410,
graph_radius=42,
graph_thickness=7,
graph_start_angle=180,
graph_unit_angle=2.7, graph_unit_thickness=2.7,
graph_bg_colour=0xffffff, graph_bg_alpha=0.1,
graph_fg_colour=0xFFFFFF, graph_fg_alpha=0.3,
hand_fg_colour=0xEF5A29, hand_fg_alpha=0,
txt_radius=30,
txt_weight=0, txt_size=9.0,
txt_fg_colour=0xEF5A29, txt_fg_alpha=1.0,
graduation_radius=28,
graduation_thickness=0, graduation_mark_thickness=1,
graduation_unit_angle=27,
graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
caption='Up',
caption_weight=1, caption_size=12.0,
caption_fg_colour=0xFFFFFF, caption_fg_alpha=0.5,
},
}
-------------------------------------------------------------------------------
-- draw_clock_ring
-- displays clock
--
function draw_clock_ring(display, data, value)
local max_value = data['max_value']
local x, y = data['x'], data['y']
local graph_radius = data['graph_radius']
local graph_thickness, graph_unit_thickness = data['graph_thickness'], data['graph_unit_thickness']
local graph_unit_angle = data['graph_unit_angle']
local graph_bg_colour, graph_bg_alpha = data['graph_bg_colour'], data['graph_bg_alpha']
local graph_fg_colour, graph_fg_alpha = data['graph_fg_colour'], data['graph_fg_alpha']
-- background ring
cairo_arc(display, x, y, graph_radius, 0, 2 * math.pi)
cairo_set_source_rgba(display, rgb_to_r_g_b(graph_bg_colour, graph_bg_alpha))
cairo_set_line_width(display, graph_thickness)
cairo_stroke(display)
-- arc of value
local val = (value % max_value)
local i = 1
while i <= val do
cairo_arc(display, x, y, graph_radius,( ((graph_unit_angle * i) - graph_unit_thickness)*(2*math.pi/360) )-(math.pi/2),((graph_unit_angle * i) * (2*math.pi/360))-(math.pi/2))
cairo_set_source_rgba(display,rgb_to_r_g_b(graph_fg_colour,graph_fg_alpha))
cairo_stroke(display)
i = i + 1
end
local angle = (graph_unit_angle * i) - graph_unit_thickness
-- graduations marks
local graduation_radius = data['graduation_radius']
local graduation_thickness, graduation_mark_thickness = data['graduation_thickness'], data['graduation_mark_thickness']
local graduation_unit_angle = data['graduation_unit_angle']
local graduation_fg_colour, graduation_fg_alpha = data['graduation_fg_colour'], data['graduation_fg_alpha']
if graduation_radius > 0 and graduation_thickness > 0 and graduation_unit_angle > 0 then
local nb_graduation = 360 / graduation_unit_angle
local i = 1
while i <= nb_graduation do
cairo_set_line_width(display, graduation_thickness)
cairo_arc(display, x, y, graduation_radius, (((graduation_unit_angle * i)-(graduation_mark_thickness/2))*(2*math.pi/360))-(math.pi/2),(((graduation_unit_angle * i)+(graduation_mark_thickness/2))*(2*math.pi/360))-(math.pi/2))
cairo_set_source_rgba(display,rgb_to_r_g_b(graduation_fg_colour,graduation_fg_alpha))
cairo_stroke(display)
cairo_set_line_width(display, graph_thickness)
i = i + 1
end
end
-- text
local txt_radius = data['txt_radius']
local txt_weight, txt_size = data['txt_weight'], data['txt_size']
local txt_fg_colour, txt_fg_alpha = data['txt_fg_colour'], data['txt_fg_alpha']
local movex = txt_radius * (math.cos((angle * 2 * math.pi / 360)-(math.pi/2)))
local movey = txt_radius * (math.sin((angle * 2 * math.pi / 360)-(math.pi/2)))
cairo_select_font_face (display, "ubuntu", CAIRO_FONT_SLANT_NORMAL, txt_weight);
cairo_set_font_size (display, txt_size);
cairo_set_source_rgba (display, rgb_to_r_g_b(txt_fg_colour, txt_fg_alpha));
cairo_move_to (display, x + movex - (txt_size / 2), y + movey + 3);
cairo_show_text (display, value);
cairo_stroke (display);
end
-------------------------------------------------------------------------------
-- rgb_to_r_g_b
-- converts color in hexa to decimal
--
function rgb_to_r_g_b(colour, alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
-------------------------------------------------------------------------------
-- angle_to_position
-- convert degree to rad and rotate (0 degree is top/north)
--
function angle_to_position(start_angle, current_angle)
local pos = current_angle + start_angle
return ( ( pos * (2 * math.pi / 360) ) - (math.pi / 2) )
end
-------------------------------------------------------------------------------
-- draw_gauge_ring
-- displays gauges
--
function draw_gauge_ring(display, data, value)
local max_value = data['max_value']
local x, y = data['x'], data['y']
local graph_radius = data['graph_radius']
local graph_thickness, graph_unit_thickness = data['graph_thickness'], data['graph_unit_thickness']
local graph_start_angle = data['graph_start_angle']
local graph_unit_angle = data['graph_unit_angle']
local graph_bg_colour, graph_bg_alpha = data['graph_bg_colour'], data['graph_bg_alpha']
local graph_fg_colour, graph_fg_alpha = data['graph_fg_colour'], data['graph_fg_alpha']
local hand_fg_colour, hand_fg_alpha = data['hand_fg_colour'], data['hand_fg_alpha']
local graph_end_angle = (max_value * graph_unit_angle) % 360
-- background ring
cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, 0), angle_to_position(graph_start_angle, graph_end_angle))
cairo_set_source_rgba(display, rgb_to_r_g_b(graph_bg_colour, graph_bg_alpha))
cairo_set_line_width(display, graph_thickness)
cairo_stroke(display)
-- arc of value
local val = value % (max_value + 1)
local start_arc = 0
local stop_arc = 0
local i = 1
while i <= val do
start_arc = (graph_unit_angle * i) - graph_unit_thickness
stop_arc = (graph_unit_angle * i)
cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc))
cairo_set_source_rgba(display, rgb_to_r_g_b(graph_fg_colour, graph_fg_alpha))
cairo_stroke(display)
i = i + 1
end
local angle = start_arc
-- hand
start_arc = (graph_unit_angle * val) - (graph_unit_thickness * 2)
stop_arc = (graph_unit_angle * val)
cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc))
cairo_set_source_rgba(display, rgb_to_r_g_b(hand_fg_colour, hand_fg_alpha))
cairo_stroke(display)
-- graduations marks
local graduation_radius = data['graduation_radius']
local graduation_thickness, graduation_mark_thickness = data['graduation_thickness'], data['graduation_mark_thickness']
local graduation_unit_angle = data['graduation_unit_angle']
local graduation_fg_colour, graduation_fg_alpha = data['graduation_fg_colour'], data['graduation_fg_alpha']
if graduation_radius > 0 and graduation_thickness > 0 and graduation_unit_angle > 0 then
local nb_graduation = graph_end_angle / graduation_unit_angle
local i = 0
while i < nb_graduation do
cairo_set_line_width(display, graduation_thickness)
start_arc = (graduation_unit_angle * i) - (graduation_mark_thickness / 2)
stop_arc = (graduation_unit_angle * i) + (graduation_mark_thickness / 2)
cairo_arc(display, x, y, graduation_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc))
cairo_set_source_rgba(display,rgb_to_r_g_b(graduation_fg_colour,graduation_fg_alpha))
cairo_stroke(display)
cairo_set_line_width(display, graph_thickness)
i = i + 1
end
end
-- text
local txt_radius = data['txt_radius']
local txt_weight, txt_size = data['txt_weight'], data['txt_size']
local txt_fg_colour, txt_fg_alpha = data['txt_fg_colour'], data['txt_fg_alpha']
local movex = txt_radius * math.cos(angle_to_position(graph_start_angle, angle))
local movey = txt_radius * math.sin(angle_to_position(graph_start_angle, angle))
cairo_select_font_face (display, "ubuntu", CAIRO_FONT_SLANT_NORMAL, txt_weight)
cairo_set_font_size (display, txt_size)
cairo_set_source_rgba (display, rgb_to_r_g_b(txt_fg_colour, txt_fg_alpha))
cairo_move_to (display, x + movex - (txt_size / 2), y + movey + 3)
cairo_show_text (display, value)
cairo_stroke (display)
-- caption
local caption = data['caption']
local caption_weight, caption_size = data['caption_weight'], data['caption_size']
local caption_fg_colour, caption_fg_alpha = data['caption_fg_colour'], data['caption_fg_alpha']
local tox = graph_radius * (math.cos((graph_start_angle * 2 * math.pi / 360)-(math.pi/2)))
local toy = graph_radius * (math.sin((graph_start_angle * 2 * math.pi / 360)-(math.pi/2)))
cairo_select_font_face (display, "ubuntu", CAIRO_FONT_SLANT_NORMAL, caption_weight);
cairo_set_font_size (display, caption_size)
cairo_set_source_rgba (display, rgb_to_r_g_b(caption_fg_colour, caption_fg_alpha))
cairo_move_to (display, x + tox + 5, y + toy + 1)
-- bad hack but not enough time !
if graph_start_angle < 105 then
cairo_move_to (display, x + tox - 30, y + toy + 1)
end
cairo_show_text (display, caption)
cairo_stroke (display)
end
-------------------------------------------------------------------------------
-- go_clock_rings
-- loads data and displays clock
--
function go_clock_rings(display)
local function load_clock_rings(display, data)
local str, value = '', 0
str = string.format('${%s %s}',data['name'], data['arg'])
str = conky_parse(str)
value = tonumber(str)
draw_clock_ring(display, data, value)
end
for i in pairs(clock_h) do
load_clock_rings(display, clock_h[i])
end
for i in pairs(clock_m) do
load_clock_rings(display, clock_m[i])
end
for i in pairs(clock_s) do
load_clock_rings(display, clock_s[i])
end
end
-------------------------------------------------------------------------------
-- go_gauge_rings
-- loads data and displays gauges
--
function go_gauge_rings(display)
local function load_gauge_rings(display, data)
local str, value = '', 0
str = string.format('${%s %s}',data['name'], data['arg'])
str = conky_parse(str)
value = tonumber(str)
draw_gauge_ring(display, data, value)
end
for i in pairs(gauge) do
load_gauge_rings(display, gauge[i])
end
end
-------------------------------------------------------------------------------
-- MAIN
function conky_main()
if conky_window == nil then
return
end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local display = cairo_create(cs)
local updates = conky_parse('${updates}')
update_num = tonumber(updates)
if update_num > 5 then
go_clock_rings(display)
go_gauge_rings(display)
end
cairo_surface_destroy(cs)
cairo_destroy(display)
end
Está montado sobre matchbox-desktop ya que no hay un escritorio propiamente dicho. Ctrl-D y lo tenemos todo a mano, más el task-switcher, Alt-Tab también funciona pero en la carpeta "Active Tasks" tenemos a la vista todas las ventanas abiertas ya que no nos caben en el panel. Tiembla un poquillo al cambia de carpeta,
Me está dando trabajo el jodío, pero está quedando muy cómodo,
lunes, 1 de julio de 2013
Archivos de configuración de matchbox
~/.matchbox/session
#!/bin/sh
#matchbox-desktop --icon-size 24 --icon-padding 24 &
synclient tapbutton1=1
setxkbmap es &
sleep 2 && xfce4-panel --disable-wm-check --sm-client-disable &
#sleep 2 && matchbox-panel --orientation north &
sleep 2 && dbus-launch tomboy &
sleep 2 && orage &
sleep 2 && wicd-client -t &
fbsetbg /usr/share/backgrounds/gnome/Aqua.jpg &
exec matchbox-window-manager -use_dialog_mode free -use_titlebar no $@~/.matchbox/kdbconfig #
# This is an example keyboard config file for matchbox
#
# You can edit this file or change per user by copying to
# ~/.matchbox/kbdconfig
#
# Se the matchbox manual for more info ( http://projects.o-hand.com/matchbox )
### Window operation short cuts
<Alt>n=next
<Alt>p=prev
<Alt>c=close
<Alt>d=desktop
<Alt>m=!matchbox-remote -mbmenu
### App launching.
<alt>g=!/usr/bin/geany
<alt>r=!/usr/bin/roxterm
### windows style key shortcuts
<alt>Tab=next
<alt><shift>Tab=prev
<alt>space=taskmenu
<alt>escape=!matchbox-remote -mbmenu
f11=fullscreen
### super should be a 'window' key, uncomment '#' if you have one.
#<super>d=desktop
#<super>r=!xterm
#<super>e=!!nautilus
### Special keys, likely probably only available on extended keyboards.
#App=!matchbox-remote -mbmenu
#Menu=!matchbox-remote -mbmenu
~/.matchbox/keyboard.xml<?xml version="1.0" encoding="UTF-8"?>
<keyboard>
<options>
<!-- not yet implemented -->
</options>
<layout id="keyboard-es">
<!--
<row>
<key>
<default display="ヂ" />
</key>
<key>
<default display="Ӫ" />
</key>
<key width="1500">
<default display="Ω" />
</key>
<space width="1500" />
<key fill="true">
<default display="⠿" />
</key>
</row>
-->
<row>
<space width="500" extended="true"/>
<key fill="true">
<default display="Esc" action="escape" />
</key>
<!--
<key>
<default display="image:/usr/share/pixmaps/sync_icon.png" action="a"/>
</key>
-->
<key>
<default display="º" />
<shifted display="ª" />
<mod1 display="\" />
</key>
<key>
<default display="1" />
<shifted display="!" />
<mod1 display="|" />
</key>
<key>
<default display="2" />
<shifted display='"' />
<mod1 display="@" />
</key>
<key>
<default display="3" />
<shifted display="·" />
<mod1 display="@" />
</key>
<key>
<default display="4" />
<shifted display="$" />
<mod1 display="~" />
</key>
<key>
<default display="5" />
<shifted display="%" />
<mod1 display="½" />
</key>
<key>
<default display="6" />
<!-- shifted display="&" / -->
<mod1 display="¬" />
</key>
<key>
<default display="7" />
<shifted display="/" />
<mod1 display="{" />
</key>
<key>
<default display="8" />
<shifted display="(" />
<mod1 display="[" />
</key>
<key>
<default display="9" />
<shifted display=")" />
<mod1 display="]" />
</key>
<key>
<default display="0" />
<shifted display="=" />
<mod1 display="}" />
</key>
<key>
<default display="'" />
<shifted display="?" />
<mod1 display="\" />
</key>
<key>
<default display="¡" />
<shifted display="¿" />
<mod1 display="~" />
</key>
<key fill="true">
<!-- <default display="⌫" action="backspace"/> -->
<default display="Bksp" action="backspace"/>
</key>
<space width="500" extended="true"/>
<key width="4000" extended="true">
<default display="Home" action="home"/>
</key>
<key width="4000" extended="true">
<default display="PgUp" action="pageup"/>
</key>
<space width="500" extended="true"/>
</row>
<row>
<space width="500" extended="true"/>
<key fill="true">
<!-- <default display="↹" action="tab"/> -->
<default display="Tab" action="tab"/>
</key>
<key obey-caps='true'>
<default display="q" />
<shifted display="Q" />
<mod1 display="@" />
</key>
<key obey-caps='true'>
<default display="w" />
<shifted display="W" />
<mod1 display="ł" />
</key>
<key obey-caps='true'>
<mod1 display="€" />
<default display="e" />
<shifted display="E" />
</key>
<key obey-caps='true'>
<default display="r" />
<shifted display="R" />
<mod1 display="¶" />
</key>
<key obey-caps='true'>
<default display="t" />
<shifted display="T" />
<mod1 display="ŧ" />
</key>
<key obey-caps='true'>
<default display="y" />
<shifted display="Y" />
<mod1 display="←" />
</key>
<key obey-caps='true'>
<default display="u" />
<shifted display="U" />
<mod1 display="↓" />
</key>
<key obey-caps='true'>
<default display="i" />
<shifted display="I" />
<mod1 display="→" />
</key>
<key obey-caps='true'>
<default display="o" />
<shifted display="O" />
<mod1 display="ø" />
</key>
<key obey-caps='true'>
<default display="p" />
<shifted display="P" />
<mod1 display="þ" />
</key>
<key>
<default display="`" />
<shifted display="^" />
<mod1 display="[" />
</key>
<key>
<default display="+" />
<shifted display="*" />
<mod1 display="]" />
</key>
<key fill="true">
<default display="ç" />
<shifted display="Ç" />
<mod1 display="}" />
</key>
<space width="500" extended="true"/>
<key width="4000" extended="true">
<default display="End" action="end"/>
</key>
<key width="4000" extended="true">
<default display="PgDn" action="pagedown"/>
</key>
<space width="500" extended="true"/>
</row>
<row>
<space width="500" extended="true"/>
<key fill="true">
<default display="Caps" action="modifier:caps"/>
</key>
<key obey-caps='true'>
<default display="a" />
<shifted display="A" />
<mod1 display="æ" />
</key>
<key obey-caps='true'>
<default display="s" />
<shifted display="S" />
<mod1 display="ß" />
</key>
<key obey-caps='true'>
<default display="d" />
<shifted display="D" />
<mod1 display="ð" />
</key>
<key obey-caps='true'>
<default display="f" />
<shifted display="F" />
<mod1 display="đ" />
</key>
<key obey-caps='true'>
<default display="g" />
<shifted display="G" />
<mod1 display="ŋ" />
</key>
<key obey-caps='true'>
<default display="h" />
<shifted display="H" />
<mod1 display="ħ" />
</key>
<key obey-caps='true'>
<default display="j" />
<shifted display="J" />
<mod1 display="j" />
</key>
<key obey-caps='true'>
<default display="k" />
<shifted display="K" />
<mod1 display="ĸ" />
</key>
<key obey-caps='true'>
<default display="l" />
<shifted display="L" />
<mod1 display="ł" />
</key>
<key obey-caps='true'>
<default display="ñ" />
<shifted display="Ñ" />
<mod1 display="~" />
</key>
<key>
<default display="´" />
<shifted display="¨" />
<mod1 display="{" />
</key>
<key fill="true">
<!-- <default display="◀┛" action="return"/> -->
<default display="Ret" action="return"/>
</key>
<space width="500" extended="true"/>
<space width="4000" extended="true" />
<space width="4000" extended="true" />
<space width="500" extended="true"/>
</row>
<row>
<space width="500" extended="true"/>
<key fill="true">
<default display="Shift" action="modifier:shift"/>
</key>
<key obey-caps='true'>
<default display="<" />
<shifted display=">" />
<mod1 display="|" />
</key>
<key obey-caps='true'>
<default display="z" />
<shifted display="Z" />
<mod1 display="«" />
</key>
<key obey-caps='true'>
<default display="x" />
<shifted display="X" />
<mod1 display="»" />
</key>
<key obey-caps='true'>
<default display="c" />
<shifted display="C" />
<mod1 display="¢" />
</key>
<key obey-caps='true'>
<default display="v" />
<shifted display="V" />
<mod1 display="“" />
</key>
<key obey-caps='true'>
<default display="b" />
<shifted display="B" />
<mod1 display="”" />
</key>
<key obey-caps='true'>
<default display="n" />
<shifted display="N" />
<mod1 display="n" />
</key>
<key obey-caps='true'>
<default display="m" />
<shifted display="M" />
<mod1 display="µ" />
</key>
<key>
<default display="," />
<shifted display=";" />
</key>
<key>
<default display="." />
<shifted display=":" />
<mod1 display="·" />
</key>
<key>
<default display="-" />
<shifted display="_" />
<mod1 display="̣" />
</key>
<key fill="true">
<default display="Shift" action="modifier:shift"/>
</key>
<space width="500" extended="true"/>
<space width="4000" extended="true" />
<space width="4000" extended="true" />
<space width="500" extended="true"/>
</row>
<row>
<space width="500" extended="true"/>
<key>
<default display="äëö" action="modifier:mod1"/>
</key>
<key fill="true">
<default display="Ctrl" action="modifier:ctrl"/>
</key>
<key>
<default display="Alt" action="modifier:alt"/>
</key>
<key width="12000">
<default display=" " action="space" />
</key>
<key>
<default display="AltGr" action="modifier:mod1" />
</key>
<key>
<default display="↑" action="up" />
</key>
<key>
<default display="↓" action="down" />
</key>
<key>
<default display="←" action="left" />
</key>
<key>
<default display="→" action="right" />
</key>
<space width="500" extended="true"/>
<space width="4000" extended="true" />
<space width="4000" extended="true" />
<space width="500" extended="true"/>
</row>
</layout>
</keyboard>
Y queda pues muy requetebién, aprovechando la pantalla.
lunes, 17 de junio de 2013
Montar particiones minix
A la vista de esto (http://minix1.woodhull.com/faq/mxfromlx.html).
he corrido esto
he hecho "la cuenta la vieja"
y luego he ejecutado esto otro
y esto
No me ha llevado nada más que toda la tarde. XD
#!/bin/sh
# mxmount
# asw 21.12.97
# >Hi,
# >
# > I tried to mount a Minix partition(/dev/hda2 in Linux,
# >/dev/hd2 in Minix) as a Minix file system in Linux with command,
# >
# >mount -t minix /dev/hda2 /mnt
# >
# >but failed. My Minix is installed from Tanenbaum's 1997 book CD.
# >
# > Then I investigated how Minix file system is installed. I
# >found that the Minix primary partition(/dev/hd2) consists of 2
# >subpartitions(/dev/hd2a and /dev/hd2c) which are separately mounted as
# >/ and /usr. I guess that Linux mount cannot resolve such partition
# >organization.
# >
#
#
# Well, yes and no. There was a discussion on this topic a while ago in this
# newsgroup. You can set things up so linux can "see" minix logical partitions
# by treating the entire minix partition as a file and mounting it on the
# loop device. A loop device is a driver that allows the linux kernel to treat
# a file as a filessytem -- quite handy in certain situations. Support for
# the loop device must be selected during make config. It has been available
# since 2.0.0.
#
# The following is a shell script I use to make my minix filesystem with
# its two logical subpartitions available from minix. (I also have two
# other minix partitions which are not sub-partitioned.) It gives the main
# idea-- you will need to adapt it for your own situation of course:
#
# (Terry's original script begins here)
#
# Mounts minix directorys so that they can be accessed from linux
# Based on tips from Alan M. Alpert as posted on comp.os.minix
# (More on loopback under linux)
# setup loop back devices. I guess the 512 offset in the first one
# gets us past the boot sector. This is for the first (minix) logical
# partition in /dev/hda3 ( = minix's /dev/hd3a ). The second one is
# for the second logical partition in /dev/hda3 which begins at 512 +
# 1440 x 1024 = 1475072 -- since there are 1440 blocks in the first
# logical partition.
# Terry's example:
# /sbin/losetup /dev/loop0 /dev/hda3 -o 512
# /sbin/losetup /dev/loop1 /dev/hda3 -o 1475072
# asw system: minix root is hd4a at offset 512
# usr is hd4c at 512 + 2x1024x1440=2949632. The "2x" is needed
# because there are two 1440 block subpartitions before the usr partition
/sbin/losetup /dev/loop0 /dev/hda4 -o 512
/sbin/losetup /dev/loop1 /dev/hda4 -o 2949632
# mount the minix root fs on /minix
/bin/mount -t minix /dev/loop0 /minix
# mount the minix usr fs on /minix/usr
/bin/mount -t minix /dev/loop1 /minix/usrhe corrido esto
root@debian:/home/jorge# fdisk /dev/sda3
Command (m for help): p
Disk /dev/sda3: 4235 MB, 4235309056 bytes
255 heads, 63 sectors/track, 514 cylinders, total 8272088 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/sda3p1 * 250836276 250869043 16384 81 Minix / old Linux
/dev/sda3p2 250869044 254965043 2048000 81 Minix / old Linux
/dev/sda3p3 254965044 259108362 2071659+ 81 Minix / old Linux
Command (m for help): he hecho "la cuenta la vieja"
>>> 16384*1024+512
16777728
>>> (16384+2048000)*1024+512
2113929728
>>> exit(0)y luego he ejecutado esto otro
root@debian:/home/jorge# /sbin/losetup /dev/loop0 /dev/sda3 -o 512
root@debian:/home/jorge# /sbin/losetup /dev/loop1 /dev/sda3 -o 16777728
root@debian:/home/jorge# /sbin/losetup /dev/loop2 /dev/sda3 -o 2113929728y esto
root@debian:/home/jorge# mount -t minix /dev/loop0 /mnt/MINIX/
root@debian:/home/jorge# mount -t minix /dev/loop1 /mnt/MINIX/home
root@debian:/home/jorge# mount -t minix /dev/loop2 /mnt/MINIX/usrNo me ha llevado nada más que toda la tarde. XD
Suscribirse a:
Entradas (Atom)











