Por fin, gracias a un blog que leí por ahí :) me di cuenta lo que faltaba en mi .emacs para que funcione cedet, ede, semantic y todo eso (que sirve para que te revise si el código está bien en sintaxis, autocompletado, etc)

primero, verificar tener cedet-common instalado... y quizá cedet-contrib

La parte en mi .emacs para que eso funcione la copié textual del blog ya mencionado y funcionó (otro día lo pulo :)


(require 'cedet)
(global-ede-mode 1)

;; smart completion - disabled
(require 'semantic-ia) ;; nil t

;; additional options
(require 'semantic-sb)
(require 'semanticdb)

;; * This turns on which-func support (Plus all other code helpers), remove if not X server
;; (semantic-load-enable-minimum-features)
;;(semantic-load-enable-code-helpers) ;; It is nice but i really dislike completion splitting window in 2
(semantic-load-enable-excessive-code-helpers)
;; (semantic-load-enable-gaudy-code-helpers)
(setq senator-minor-mode-name "SN")

;; Be careful to add lines for semantic-idle because weird tooltip box appears again :(
(global-semantic-idle-summary-mode 1) ;Display a tag summary of the lexical token under the cursor.
(global-semantic-show-unmatched-syntax-mode 1)

;; Add menu to navigate faster between tokens
(add-hook 'semantic-init-hooks (lambda ()
(imenu-add-to-menubar "TAGS")))

;; Enable semantic cache, search functions only first time
(global-semanticdb-minor-mode 1)

(defun semanticdb-cache-directory-p(directory)
(cond
((search "/ArraySaver/" directory) nil)
((search "@@" directory) t)
(t nil)))

(add-hook 'semanticdb-project-predicate-functions 'semanticdb-cache-directory-p)

(setq semanticdb-default-save-directory "~/.emacs.d/semantic")

For da record :)

Happy Hacking!

]]>

Cedet y esas cosas en Emacs, y en Debian...

August 31, 2010 by Tomás Solar Castro   comments (0) - Visitas: 998

emacs, cedet, semantic, debian

Por fin, gracias a un blog que leí por ahí :) me di cuenta lo que faltaba en mi .emacs para que funcione cedet, ede, semantic y todo eso (que sirve para que te revise si el código está bien en sintaxis, autocompletado, etc)

primero, verificar tener cedet-common instalado... y quizá cedet-contrib

La parte en mi .emacs para que eso funcione la copié textual del blog ya mencionado y funcionó (otro día lo pulo :)

(require 'cedet)
(global-ede-mode 1)

;; smart completion - disabled
(require 'semantic-ia) ;; nil t

;; additional options
(require 'semantic-sb)
(require 'semanticdb)

;; * This turns on which-func support (Plus all other code helpers), remove if not X server
;; (semantic-load-enable-minimum-features)
;;(semantic-load-enable-code-helpers) ;; It is nice but i really dislike completion splitting window in 2
(semantic-load-enable-excessive-code-helpers)
;; (semantic-load-enable-gaudy-code-helpers)
(setq senator-minor-mode-name "SN")

;; Be careful to add lines for semantic-idle because weird tooltip box appears again :(
(global-semantic-idle-summary-mode 1) ;Display a tag summary of the lexical token under the cursor.
(global-semantic-show-unmatched-syntax-mode 1)

;; Add menu to navigate faster between tokens
(add-hook 'semantic-init-hooks (lambda ()
(imenu-add-to-menubar "TAGS")))

;; Enable semantic cache, search functions only first time
(global-semanticdb-minor-mode 1)

(defun semanticdb-cache-directory-p(directory)
(cond
((search "/ArraySaver/" directory) nil)
((search "@@" directory) t)
(t nil)))

(add-hook 'semanticdb-project-predicate-functions 'semanticdb-cache-directory-p)

(setq semanticdb-default-save-directory "~/.emacs.d/semantic")

For da record :)

Happy Hacking!

]]>
Por fin, gracias a un blog que leí por ahí :) me di cuenta lo que faltaba en mi .emacs para que funcione cedet, ede, semantic y todo eso (que sirve para que te revise si el código está bien en sintaxis, autocompletado, etc)

primero, verificar tener cedet-common instalado... y quizá cedet-contrib

La parte en mi .emacs para que eso funcione la copié textual del blog ya mencionado y funcionó (otro día lo pulo :)


(require 'cedet)
(global-ede-mode 1)

;; smart completion - disabled
(require 'semantic-ia) ;; nil t

;; additional options
(require 'semantic-sb)
(require 'semanticdb)

;; * This turns on which-func support (Plus all other code helpers), remove if not X server
;; (semantic-load-enable-minimum-features)
;;(semantic-load-enable-code-helpers) ;; It is nice but i really dislike completion splitting window in 2
(semantic-load-enable-excessive-code-helpers)
;; (semantic-load-enable-gaudy-code-helpers)
(setq senator-minor-mode-name "SN")

;; Be careful to add lines for semantic-idle because weird tooltip box appears again :(
(global-semantic-idle-summary-mode 1) ;Display a tag summary of the lexical token under the cursor.
(global-semantic-show-unmatched-syntax-mode 1)

;; Add menu to navigate faster between tokens
(add-hook 'semantic-init-hooks (lambda ()
(imenu-add-to-menubar "TAGS")))

;; Enable semantic cache, search functions only first time
(global-semanticdb-minor-mode 1)

(defun semanticdb-cache-directory-p(directory)
(cond
((search "/ArraySaver/" directory) nil)
((search "@@" directory) t)
(t nil)))

(add-hook 'semanticdb-project-predicate-functions 'semanticdb-cache-directory-p)

(setq semanticdb-default-save-directory "~/.emacs.d/semantic")

For da record :)

Happy Hacking!

]]>

Cedet y esas cosas en Emacs, y en Debian...

August 31, 2010 by Tomás Solar Castro   comments (0) - Visitas: 998

emacs, cedet, semantic, debian

Por fin, gracias a un blog que leí por ahí :) me di cuenta lo que faltaba en mi .emacs para que funcione cedet, ede, semantic y todo eso (que sirve para que te revise si el código está bien en sintaxis, autocompletado, etc)

primero, verificar tener cedet-common instalado... y quizá cedet-contrib

La parte en mi .emacs para que eso funcione la copié textual del blog ya mencionado y funcionó (otro día lo pulo :)

(require 'cedet)
(global-ede-mode 1)

;; smart completion - disabled
(require 'semantic-ia) ;; nil t

;; additional options
(require 'semantic-sb)
(require 'semanticdb)

;; * This turns on which-func support (Plus all other code helpers), remove if not X server
;; (semantic-load-enable-minimum-features)
;;(semantic-load-enable-code-helpers) ;; It is nice but i really dislike completion splitting window in 2
(semantic-load-enable-excessive-code-helpers)
;; (semantic-load-enable-gaudy-code-helpers)
(setq senator-minor-mode-name "SN")

;; Be careful to add lines for semantic-idle because weird tooltip box appears again :(
(global-semantic-idle-summary-mode 1) ;Display a tag summary of the lexical token under the cursor.
(global-semantic-show-unmatched-syntax-mode 1)

;; Add menu to navigate faster between tokens
(add-hook 'semantic-init-hooks (lambda ()
(imenu-add-to-menubar "TAGS")))

;; Enable semantic cache, search functions only first time
(global-semanticdb-minor-mode 1)

(defun semanticdb-cache-directory-p(directory)
(cond
((search "/ArraySaver/" directory) nil)
((search "@@" directory) t)
(t nil)))

(add-hook 'semanticdb-project-predicate-functions 'semanticdb-cache-directory-p)

(setq semanticdb-default-save-directory "~/.emacs.d/semantic")

For da record :)

Happy Hacking!

]]>
I have "repaired" the previous code, now using the args given by the widget itself.

Commented the tooltip, and using a vicious batwidget instead obvious.battery, showing up acpi information when the cursor gets over it.

baticon = widget({ type = "imagebox" })
--baticon_t = awful.tooltip({ objects = { baticon }, })
--baticon.image = image(beautiful.baticon_bat1)
vicious.register(baticon, vicious.widgets.bat, function (widget, args)
--                                                  baticon_t:set_text(args[1] .." ".. args[2].."% " .. args[3] )
                                                 
                                                  local battery_status = ""
                                                  battery_status = args[1]
                                                  if not battery_status then
                                                     baticon.image = image(beautiful.widget_baticon_ac)
                                                  elseif args[1] == "-" then --battery_status == "discharging" then

                                                     if args[2] > 95 and args[2] <= 100 then
                                                        baticon.image = image(beautiful.widget_baticon_bat1)
                                                     elseif args[2] > 90 and args[2] < 95 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat2)
                                                     elseif args[2] >= 80 and args[2] < 90 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat3)
                                                     elseif args[2] >= 70 and args[2] < 80 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat3)
                                                     elseif args[2] >= 60 and args[2] < 70 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat4)
                                                     elseif args[2] >= 50 and args[2] < 60 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat5)
                                                     elseif args[2] >= 40 and args[2] < 50 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat6)
                                                     elseif args[2] >= 30 and args[2] < 40 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat7)
                                                     elseif args[2] >= 20 and args[2] < 30 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat8)
                                                     elseif args[2] >= 10 and args[2] < 20 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat9)
                                                     elseif args[2] > 5 and args[2] < 10 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat10)

                                                     elseif args[2] <= 5 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat11)
                                                     end

                                                  elseif args[1] == "+" then--battery_status == "charging" then
                                                     if args[2] > 95 and args[2] <= 100 then
                                                        baticon.image = image(beautiful.widget_baticon_char1)
                                                     elseif args[2] > 90 and args[2] < 95 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char2)
                                                     elseif args[2] >= 80 and args[2] < 90 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char3)
                                                     elseif args[2] >= 70 and args[2] < 80 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char3)
                                                     elseif args[2] >= 60 and args[2] < 70 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char4)
                                                     elseif args[2] >= 50 and args[2] < 60 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char5)
                                                     elseif args[2] >= 40 and args[2] < 50 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char6)
                                                     elseif args[2] >= 30 and args[2] < 40 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char7)
                                                     elseif args[2] >= 20 and args[2] < 30 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char8)
                                                     elseif args[2] >= 10 and args[2] < 20 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char9)
                                                     elseif args[2] > 5 and args[2] < 10 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char10)

                                                     elseif args[2] <= 5 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char10)
                                                     end
                                                  elseif args[1] == "↯" then
                                                       baticon.image = image(beautiful.widget_baticon_ac)

                                                  end


                                                  if args[1] == "⌁" then --battery_present == '0' then
                                                       baticon.image = image(beautiful.widget_baticon_ac)
                                                    end
                                                   
                                                   

                                                 end,
                 1, "BAT0")


batwidget = widget({ type = "textbox" })
vicious.register(batwidget, vicious.widgets.bat, "$2% $3", 61, "BAT0")
batwidget:add_signal('mouse::enter', function()
                                        local fd = nil
                                        fd = io.popen("acpi -btai")
                                        local d = fd:read("*all"):gsub("\n+$", "")
                                        fd:close()
                                        batinfo = {
                                           naughty.notify({
                                                          text         = d
                                                          , timeout    = 0
                                                          , position   = "bottom_right"
                                                       })
                                        }
                                     end)

batwidget:add_signal('mouse::leave', function () naughty.destroy(batinfo[1]) end)

Hope this help.

Happy Hacking!

]]>

Battery icon with awesome vicious widget 2.0

June 1, 2010 by Tomás Solar Castro   comments (0) - Visitas: 3139

awesome, vicious, widget, icon, battery

I have "repaired" the previous code, now using the args given by the widget itself.

Commented the tooltip, and using a vicious batwidget instead obvious.battery, showing up acpi information when the cursor gets over it.

baticon = widget({ type = "imagebox" })
--baticon_t = awful.tooltip({ objects = { baticon }, })
--baticon.image = image(beautiful.baticon_bat1)
vicious.register(baticon, vicious.widgets.bat, function (widget, args)
--                                                  baticon_t:set_text(args[1] .." ".. args[2].."% " .. args[3] )
                                                 
                                                  local battery_status = ""
                                                  battery_status = args[1]
                                                  if not battery_status then
                                                     baticon.image = image(beautiful.widget_baticon_ac)
                                                  elseif args[1] == "-" then --battery_status == "discharging" then

                                                     if args[2] > 95 and args[2] <= 100 then
                                                        baticon.image = image(beautiful.widget_baticon_bat1)
                                                     elseif args[2] > 90 and args[2] < 95 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat2)
                                                     elseif args[2] >= 80 and args[2] < 90 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat3)
                                                     elseif args[2] >= 70 and args[2] < 80 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat3)
                                                     elseif args[2] >= 60 and args[2] < 70 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat4)
                                                     elseif args[2] >= 50 and args[2] < 60 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat5)
                                                     elseif args[2] >= 40 and args[2] < 50 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat6)
                                                     elseif args[2] >= 30 and args[2] < 40 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat7)
                                                     elseif args[2] >= 20 and args[2] < 30 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat8)
                                                     elseif args[2] >= 10 and args[2] < 20 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat9)
                                                     elseif args[2] > 5 and args[2] < 10 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat10)

                                                     elseif args[2] <= 5 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat11)
                                                     end

                                                  elseif args[1] == "+" then--battery_status == "charging" then
                                                     if args[2] > 95 and args[2] <= 100 then
                                                        baticon.image = image(beautiful.widget_baticon_char1)
                                                     elseif args[2] > 90 and args[2] < 95 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char2)
                                                     elseif args[2] >= 80 and args[2] < 90 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char3)
                                                     elseif args[2] >= 70 and args[2] < 80 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char3)
                                                     elseif args[2] >= 60 and args[2] < 70 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char4)
                                                     elseif args[2] >= 50 and args[2] < 60 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char5)
                                                     elseif args[2] >= 40 and args[2] < 50 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char6)
                                                     elseif args[2] >= 30 and args[2] < 40 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char7)
                                                     elseif args[2] >= 20 and args[2] < 30 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char8)
                                                     elseif args[2] >= 10 and args[2] < 20 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char9)
                                                     elseif args[2] > 5 and args[2] < 10 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char10)

                                                     elseif args[2] <= 5 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char10)
                                                     end
                                                  elseif args[1] == "↯" then
                                                       baticon.image = image(beautiful.widget_baticon_ac)

                                                  end

                                                  if args[1] == "⌁" then --battery_present == '0' then
                                                       baticon.image = image(beautiful.widget_baticon_ac)
                                                    end
                                                   
                                                   

                                                 end,
                 1, "BAT0")

batwidget = widget({ type = "textbox" })
vicious.register(batwidget, vicious.widgets.bat, "$2% $3", 61, "BAT0")
batwidget:add_signal('mouse::enter', function()
                                        local fd = nil
                                        fd = io.popen("acpi -btai")
                                        local d = fd:read("*all"):gsub("\n+$", "")
                                        fd:close()
                                        batinfo = {
                                           naughty.notify({
                                                          text         = d
                                                          , timeout    = 0
                                                          , position   = "bottom_right"
                                                       })
                                        }
                                     end)

batwidget:add_signal('mouse::leave', function () naughty.destroy(batinfo[1]) end)

Hope this help.

Happy Hacking!

]]>
I have "repaired" the previous code, now using the args given by the widget itself.

Commented the tooltip, and using a vicious batwidget instead obvious.battery, showing up acpi information when the cursor gets over it.

baticon = widget({ type = "imagebox" })
--baticon_t = awful.tooltip({ objects = { baticon }, })
--baticon.image = image(beautiful.baticon_bat1)
vicious.register(baticon, vicious.widgets.bat, function (widget, args)
--                                                  baticon_t:set_text(args[1] .." ".. args[2].."% " .. args[3] )
                                                 
                                                  local battery_status = ""
                                                  battery_status = args[1]
                                                  if not battery_status then
                                                     baticon.image = image(beautiful.widget_baticon_ac)
                                                  elseif args[1] == "-" then --battery_status == "discharging" then

                                                     if args[2] > 95 and args[2] <= 100 then
                                                        baticon.image = image(beautiful.widget_baticon_bat1)
                                                     elseif args[2] > 90 and args[2] < 95 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat2)
                                                     elseif args[2] >= 80 and args[2] < 90 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat3)
                                                     elseif args[2] >= 70 and args[2] < 80 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat3)
                                                     elseif args[2] >= 60 and args[2] < 70 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat4)
                                                     elseif args[2] >= 50 and args[2] < 60 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat5)
                                                     elseif args[2] >= 40 and args[2] < 50 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat6)
                                                     elseif args[2] >= 30 and args[2] < 40 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat7)
                                                     elseif args[2] >= 20 and args[2] < 30 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat8)
                                                     elseif args[2] >= 10 and args[2] < 20 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat9)
                                                     elseif args[2] > 5 and args[2] < 10 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat10)

                                                     elseif args[2] <= 5 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat11)
                                                     end

                                                  elseif args[1] == "+" then--battery_status == "charging" then
                                                     if args[2] > 95 and args[2] <= 100 then
                                                        baticon.image = image(beautiful.widget_baticon_char1)
                                                     elseif args[2] > 90 and args[2] < 95 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char2)
                                                     elseif args[2] >= 80 and args[2] < 90 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char3)
                                                     elseif args[2] >= 70 and args[2] < 80 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char3)
                                                     elseif args[2] >= 60 and args[2] < 70 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char4)
                                                     elseif args[2] >= 50 and args[2] < 60 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char5)
                                                     elseif args[2] >= 40 and args[2] < 50 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char6)
                                                     elseif args[2] >= 30 and args[2] < 40 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char7)
                                                     elseif args[2] >= 20 and args[2] < 30 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char8)
                                                     elseif args[2] >= 10 and args[2] < 20 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char9)
                                                     elseif args[2] > 5 and args[2] < 10 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char10)

                                                     elseif args[2] <= 5 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char10)
                                                     end
                                                  elseif args[1] == "↯" then
                                                       baticon.image = image(beautiful.widget_baticon_ac)

                                                  end


                                                  if args[1] == "⌁" then --battery_present == '0' then
                                                       baticon.image = image(beautiful.widget_baticon_ac)
                                                    end
                                                   
                                                   

                                                 end,
                 1, "BAT0")


batwidget = widget({ type = "textbox" })
vicious.register(batwidget, vicious.widgets.bat, "$2% $3", 61, "BAT0")
batwidget:add_signal('mouse::enter', function()
                                        local fd = nil
                                        fd = io.popen("acpi -btai")
                                        local d = fd:read("*all"):gsub("\n+$", "")
                                        fd:close()
                                        batinfo = {
                                           naughty.notify({
                                                          text         = d
                                                          , timeout    = 0
                                                          , position   = "bottom_right"
                                                       })
                                        }
                                     end)

batwidget:add_signal('mouse::leave', function () naughty.destroy(batinfo[1]) end)

Hope this help.

Happy Hacking!

]]>

Battery icon with awesome vicious widget 2.0

June 1, 2010 by Tomás Solar Castro   comments (0) - Visitas: 3139

awesome, vicious, widget, icon, battery

I have "repaired" the previous code, now using the args given by the widget itself.

Commented the tooltip, and using a vicious batwidget instead obvious.battery, showing up acpi information when the cursor gets over it.

baticon = widget({ type = "imagebox" })
--baticon_t = awful.tooltip({ objects = { baticon }, })
--baticon.image = image(beautiful.baticon_bat1)
vicious.register(baticon, vicious.widgets.bat, function (widget, args)
--                                                  baticon_t:set_text(args[1] .." ".. args[2].."% " .. args[3] )
                                                 
                                                  local battery_status = ""
                                                  battery_status = args[1]
                                                  if not battery_status then
                                                     baticon.image = image(beautiful.widget_baticon_ac)
                                                  elseif args[1] == "-" then --battery_status == "discharging" then

                                                     if args[2] > 95 and args[2] <= 100 then
                                                        baticon.image = image(beautiful.widget_baticon_bat1)
                                                     elseif args[2] > 90 and args[2] < 95 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat2)
                                                     elseif args[2] >= 80 and args[2] < 90 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat3)
                                                     elseif args[2] >= 70 and args[2] < 80 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat3)
                                                     elseif args[2] >= 60 and args[2] < 70 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat4)
                                                     elseif args[2] >= 50 and args[2] < 60 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat5)
                                                     elseif args[2] >= 40 and args[2] < 50 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat6)
                                                     elseif args[2] >= 30 and args[2] < 40 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat7)
                                                     elseif args[2] >= 20 and args[2] < 30 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat8)
                                                     elseif args[2] >= 10 and args[2] < 20 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat9)
                                                     elseif args[2] > 5 and args[2] < 10 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat10)

                                                     elseif args[2] <= 5 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat11)
                                                     end

                                                  elseif args[1] == "+" then--battery_status == "charging" then
                                                     if args[2] > 95 and args[2] <= 100 then
                                                        baticon.image = image(beautiful.widget_baticon_char1)
                                                     elseif args[2] > 90 and args[2] < 95 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char2)
                                                     elseif args[2] >= 80 and args[2] < 90 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char3)
                                                     elseif args[2] >= 70 and args[2] < 80 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char3)
                                                     elseif args[2] >= 60 and args[2] < 70 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char4)
                                                     elseif args[2] >= 50 and args[2] < 60 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char5)
                                                     elseif args[2] >= 40 and args[2] < 50 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char6)
                                                     elseif args[2] >= 30 and args[2] < 40 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char7)
                                                     elseif args[2] >= 20 and args[2] < 30 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char8)
                                                     elseif args[2] >= 10 and args[2] < 20 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char9)
                                                     elseif args[2] > 5 and args[2] < 10 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char10)

                                                     elseif args[2] <= 5 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char10)
                                                     end
                                                  elseif args[1] == "↯" then
                                                       baticon.image = image(beautiful.widget_baticon_ac)

                                                  end

                                                  if args[1] == "⌁" then --battery_present == '0' then
                                                       baticon.image = image(beautiful.widget_baticon_ac)
                                                    end
                                                   
                                                   

                                                 end,
                 1, "BAT0")

batwidget = widget({ type = "textbox" })
vicious.register(batwidget, vicious.widgets.bat, "$2% $3", 61, "BAT0")
batwidget:add_signal('mouse::enter', function()
                                        local fd = nil
                                        fd = io.popen("acpi -btai")
                                        local d = fd:read("*all"):gsub("\n+$", "")
                                        fd:close()
                                        batinfo = {
                                           naughty.notify({
                                                          text         = d
                                                          , timeout    = 0
                                                          , position   = "bottom_right"
                                                       })
                                        }
                                     end)

batwidget:add_signal('mouse::leave', function () naughty.destroy(batinfo[1]) end)

Hope this help.

Happy Hacking!

]]>
El código no es de los mejores, pero se ve bonito en la pantalla... hahaha

agreguen algo así en su rc.lua, y por supuesto, elijan uds mismos sus íconos :)

--iconos para baticon widget
beautiful.widget_baticon_bat1 = "/home/tom/.config/awesome/icons/battery/bat1.png"
beautiful.widget_baticon_bat2 = "/home/tom/.config/awesome/icons/battery/bat2.png"
beautiful.widget_baticon_bat3 = "/home/tom/.config/awesome/icons/battery/bat3.png"
beautiful.widget_baticon_bat4 = "/home/tom/.config/awesome/icons/battery/bat4.png"
beautiful.widget_baticon_bat5 = "/home/tom/.config/awesome/icons/battery/bat5.png"
beautiful.widget_baticon_bat6 = "/home/tom/.config/awesome/icons/battery/bat6.png"
beautiful.widget_baticon_bat7 = "/home/tom/.config/awesome/icons/battery/bat7.png"
beautiful.widget_baticon_bat8 = "/home/tom/.config/awesome/icons/battery/bat8.png"
beautiful.widget_baticon_bat9 = "/home/tom/.config/awesome/icons/battery/bat9.png"
beautiful.widget_baticon_bat10 = "/home/tom/.config/awesome/icons/battery/bat10.png"
beautiful.widget_baticon_bat11 = "/home/tom/.config/awesome/icons/battery/bat11.png"

beautiful.widget_baticon_char1 = "/home/tom/.config/awesome/icons/battery/char1.png"
beautiful.widget_baticon_char2 = "/home/tom/.config/awesome/icons/battery/char2.png"
beautiful.widget_baticon_char3 = "/home/tom/.config/awesome/icons/battery/char3.png"
beautiful.widget_baticon_char4 = "/home/tom/.config/awesome/icons/battery/char4.png"
beautiful.widget_baticon_char5 = "/home/tom/.config/awesome/icons/battery/char5.png"
beautiful.widget_baticon_char6 = "/home/tom/.config/awesome/icons/battery/char6.png"
beautiful.widget_baticon_char7 = "/home/tom/.config/awesome/icons/battery/char7.png"
beautiful.widget_baticon_char8 = "/home/tom/.config/awesome/icons/battery/char8.png"
beautiful.widget_baticon_char9 = "/home/tom/.config/awesome/icons/battery/char9.png"
beautiful.widget_baticon_char10 = "/home/tom/.config/awesome/icons/battery/char10.png"

beautiful.widget_baticon_ac = "/home/tom/.config/awesome/icons/battery/ac.png"


--iconos para baticon widget \o/
baticon = widget({ type = "imagebox" })
--baticon.image = image(beautiful.baticon_bat1)
vicious.register(baticon, vicious.widgets.bat, function (widget, args)
                                                  local battery_presentf = io.popen('cat /sys/class/power_supply/BAT0/present ')
                                                  local battery_present = battery_presentf:read("*all")
                                                  battery_presentf :close()

                                                  local rv = { }
                                                  local fd = io.popen( "acpi -b")
                                                  if not fd then return end

                                                  local line = fd:read("*l")
                                                  while line do
                                                     local data = line:match("Battery #?[0-9] *: ([^\n]*)")

                                                     rv.state = data:match("([%a]*),.*"):lower()
                                                     rv.charge = tonumber(data:match(".*, ([%d]?[%d]?[%d]%.?[%d]?[%d]?)%%"))
                                                     rv.time = data:match(".*, ([%d]?[%d]?:?[%d][%d]:[%d][%d])")

                                                     if not rv.state:match("unknown") then break end
                                                     line = fd:read("*l")
                                                  end

                                                  fd:close()


                                                  local battery_status = ""
                                                  battery_status = rv.state
                                                  if battery_status == "discharging" then

                                                     if rv.charge > 95 and rv.charge <= 100 then
                                                        baticon.image = image(beautiful.widget_baticon_bat1)
                                                     elseif rv.charge > 90 and rv.charge < 95 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat2)
                                                     elseif rv.charge >= 80 and rv.charge < 90 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat3)
                                                     elseif rv.charge >= 70 and rv.charge < 80 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat3)
                                                     elseif rv.charge >= 60 and rv.charge < 70 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat4)
                                                     elseif rv.charge >= 50 and rv.charge < 60 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat5)
                                                     elseif rv.charge >= 40 and rv.charge < 50 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat6)
                                                     elseif rv.charge >= 30 and rv.charge < 40 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat7)
                                                     elseif rv.charge >= 20 and rv.charge < 30 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat8)
                                                     elseif rv.charge >= 10 and rv.charge < 20 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat9)
                                                     elseif rv.charge > 5 and rv.charge < 10 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat10)

                                                     elseif rv.charge <= 5 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat11)
                                                     end

                                                  elseif battery_status == "charging" then
                                                     if rv.charge > 95 and rv.charge <= 100 then
                                                        baticon.image = image(beautiful.widget_baticon_char1)
                                                     elseif rv.charge > 90 and rv.charge < 95 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char2)
                                                     elseif rv.charge >= 80 and rv.charge < 90 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char3)
                                                     elseif rv.charge >= 70 and rv.charge < 80 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char3)
                                                     elseif rv.charge >= 60 and rv.charge < 70 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char4)
                                                     elseif rv.charge >= 50 and rv.charge < 60 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char5)
                                                     elseif rv.charge >= 40 and rv.charge < 50 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char6)
                                                     elseif rv.charge >= 30 and rv.charge < 40 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char7)
                                                     elseif rv.charge >= 20 and rv.charge < 30 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char8)
                                                     elseif rv.charge >= 10 and rv.charge < 20 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char9)
                                                     elseif rv.charge > 5 and rv.charge < 10 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char10)

                                                     elseif rv.charge <= 5 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char10)
                                                     end


                                                  end


                                                    if battery_present == '0' then
                                                       baticon.image = image(beautiful.widget_baticon_ac)
                                                    end
                                                   
                                                   

                                                 end,
                 1, "BAT0")

y así se ve: (abajo, lo primero que está a la derecha)

Happy Hacking!

]]>

Battery icon with awesome vicious widget

May 18, 2010 by Tomás Solar Castro   comments (0) - Visitas: 3451

vicious, widget, icon, battery, awesome

El código no es de los mejores, pero se ve bonito en la pantalla... hahaha

agreguen algo así en su rc.lua, y por supuesto, elijan uds mismos sus íconos :)

--iconos para baticon widget
beautiful.widget_baticon_bat1 = "/home/tom/.config/awesome/icons/battery/bat1.png"
beautiful.widget_baticon_bat2 = "/home/tom/.config/awesome/icons/battery/bat2.png"
beautiful.widget_baticon_bat3 = "/home/tom/.config/awesome/icons/battery/bat3.png"
beautiful.widget_baticon_bat4 = "/home/tom/.config/awesome/icons/battery/bat4.png"
beautiful.widget_baticon_bat5 = "/home/tom/.config/awesome/icons/battery/bat5.png"
beautiful.widget_baticon_bat6 = "/home/tom/.config/awesome/icons/battery/bat6.png"
beautiful.widget_baticon_bat7 = "/home/tom/.config/awesome/icons/battery/bat7.png"
beautiful.widget_baticon_bat8 = "/home/tom/.config/awesome/icons/battery/bat8.png"
beautiful.widget_baticon_bat9 = "/home/tom/.config/awesome/icons/battery/bat9.png"
beautiful.widget_baticon_bat10 = "/home/tom/.config/awesome/icons/battery/bat10.png"
beautiful.widget_baticon_bat11 = "/home/tom/.config/awesome/icons/battery/bat11.png"

beautiful.widget_baticon_char1 = "/home/tom/.config/awesome/icons/battery/char1.png"
beautiful.widget_baticon_char2 = "/home/tom/.config/awesome/icons/battery/char2.png"
beautiful.widget_baticon_char3 = "/home/tom/.config/awesome/icons/battery/char3.png"
beautiful.widget_baticon_char4 = "/home/tom/.config/awesome/icons/battery/char4.png"
beautiful.widget_baticon_char5 = "/home/tom/.config/awesome/icons/battery/char5.png"
beautiful.widget_baticon_char6 = "/home/tom/.config/awesome/icons/battery/char6.png"
beautiful.widget_baticon_char7 = "/home/tom/.config/awesome/icons/battery/char7.png"
beautiful.widget_baticon_char8 = "/home/tom/.config/awesome/icons/battery/char8.png"
beautiful.widget_baticon_char9 = "/home/tom/.config/awesome/icons/battery/char9.png"
beautiful.widget_baticon_char10 = "/home/tom/.config/awesome/icons/battery/char10.png"

beautiful.widget_baticon_ac = "/home/tom/.config/awesome/icons/battery/ac.png"

--iconos para baticon widget \o/
baticon = widget({ type = "imagebox" })
--baticon.image = image(beautiful.baticon_bat1)
vicious.register(baticon, vicious.widgets.bat, function (widget, args)
                                                  local battery_presentf = io.popen('cat /sys/class/power_supply/BAT0/present ')
                                                  local battery_present = battery_presentf:read("*all")
                                                  battery_presentf :close()

                                                  local rv = { }
                                                  local fd = io.popen( "acpi -b")
                                                  if not fd then return end

                                                  local line = fd:read("*l")
                                                  while line do
                                                     local data = line:match("Battery #?[0-9] *: ([^\n]*)")

                                                     rv.state = data:match("([%a]*),.*"):lower()
                                                     rv.charge = tonumber(data:match(".*, ([%d]?[%d]?[%d]%.?[%d]?[%d]?)%%"))
                                                     rv.time = data:match(".*, ([%d]?[%d]?:?[%d][%d]:[%d][%d])")

                                                     if not rv.state:match("unknown") then break end
                                                     line = fd:read("*l")
                                                  end

                                                  fd:close()

                                                  local battery_status = ""
                                                  battery_status = rv.state
                                                  if battery_status == "discharging" then

                                                     if rv.charge > 95 and rv.charge <= 100 then
                                                        baticon.image = image(beautiful.widget_baticon_bat1)
                                                     elseif rv.charge > 90 and rv.charge < 95 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat2)
                                                     elseif rv.charge >= 80 and rv.charge < 90 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat3)
                                                     elseif rv.charge >= 70 and rv.charge < 80 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat3)
                                                     elseif rv.charge >= 60 and rv.charge < 70 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat4)
                                                     elseif rv.charge >= 50 and rv.charge < 60 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat5)
                                                     elseif rv.charge >= 40 and rv.charge < 50 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat6)
                                                     elseif rv.charge >= 30 and rv.charge < 40 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat7)
                                                     elseif rv.charge >= 20 and rv.charge < 30 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat8)
                                                     elseif rv.charge >= 10 and rv.charge < 20 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat9)
                                                     elseif rv.charge > 5 and rv.charge < 10 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat10)

                                                     elseif rv.charge <= 5 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat11)
                                                     end

                                                  elseif battery_status == "charging" then
                                                     if rv.charge > 95 and rv.charge <= 100 then
                                                        baticon.image = image(beautiful.widget_baticon_char1)
                                                     elseif rv.charge > 90 and rv.charge < 95 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char2)
                                                     elseif rv.charge >= 80 and rv.charge < 90 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char3)
                                                     elseif rv.charge >= 70 and rv.charge < 80 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char3)
                                                     elseif rv.charge >= 60 and rv.charge < 70 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char4)
                                                     elseif rv.charge >= 50 and rv.charge < 60 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char5)
                                                     elseif rv.charge >= 40 and rv.charge < 50 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char6)
                                                     elseif rv.charge >= 30 and rv.charge < 40 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char7)
                                                     elseif rv.charge >= 20 and rv.charge < 30 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char8)
                                                     elseif rv.charge >= 10 and rv.charge < 20 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char9)
                                                     elseif rv.charge > 5 and rv.charge < 10 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char10)

                                                     elseif rv.charge <= 5 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char10)
                                                     end

                                                  end

                                                    if battery_present == '0' then
                                                       baticon.image = image(beautiful.widget_baticon_ac)
                                                    end
                                                   
                                                   

                                                 end,
                 1, "BAT0")

y así se ve: (abajo, lo primero que está a la derecha)

Happy Hacking!

]]>
El código no es de los mejores, pero se ve bonito en la pantalla... hahaha

agreguen algo así en su rc.lua, y por supuesto, elijan uds mismos sus íconos :)

--iconos para baticon widget
beautiful.widget_baticon_bat1 = "/home/tom/.config/awesome/icons/battery/bat1.png"
beautiful.widget_baticon_bat2 = "/home/tom/.config/awesome/icons/battery/bat2.png"
beautiful.widget_baticon_bat3 = "/home/tom/.config/awesome/icons/battery/bat3.png"
beautiful.widget_baticon_bat4 = "/home/tom/.config/awesome/icons/battery/bat4.png"
beautiful.widget_baticon_bat5 = "/home/tom/.config/awesome/icons/battery/bat5.png"
beautiful.widget_baticon_bat6 = "/home/tom/.config/awesome/icons/battery/bat6.png"
beautiful.widget_baticon_bat7 = "/home/tom/.config/awesome/icons/battery/bat7.png"
beautiful.widget_baticon_bat8 = "/home/tom/.config/awesome/icons/battery/bat8.png"
beautiful.widget_baticon_bat9 = "/home/tom/.config/awesome/icons/battery/bat9.png"
beautiful.widget_baticon_bat10 = "/home/tom/.config/awesome/icons/battery/bat10.png"
beautiful.widget_baticon_bat11 = "/home/tom/.config/awesome/icons/battery/bat11.png"

beautiful.widget_baticon_char1 = "/home/tom/.config/awesome/icons/battery/char1.png"
beautiful.widget_baticon_char2 = "/home/tom/.config/awesome/icons/battery/char2.png"
beautiful.widget_baticon_char3 = "/home/tom/.config/awesome/icons/battery/char3.png"
beautiful.widget_baticon_char4 = "/home/tom/.config/awesome/icons/battery/char4.png"
beautiful.widget_baticon_char5 = "/home/tom/.config/awesome/icons/battery/char5.png"
beautiful.widget_baticon_char6 = "/home/tom/.config/awesome/icons/battery/char6.png"
beautiful.widget_baticon_char7 = "/home/tom/.config/awesome/icons/battery/char7.png"
beautiful.widget_baticon_char8 = "/home/tom/.config/awesome/icons/battery/char8.png"
beautiful.widget_baticon_char9 = "/home/tom/.config/awesome/icons/battery/char9.png"
beautiful.widget_baticon_char10 = "/home/tom/.config/awesome/icons/battery/char10.png"

beautiful.widget_baticon_ac = "/home/tom/.config/awesome/icons/battery/ac.png"


--iconos para baticon widget \o/
baticon = widget({ type = "imagebox" })
--baticon.image = image(beautiful.baticon_bat1)
vicious.register(baticon, vicious.widgets.bat, function (widget, args)
                                                  local battery_presentf = io.popen('cat /sys/class/power_supply/BAT0/present ')
                                                  local battery_present = battery_presentf:read("*all")
                                                  battery_presentf :close()

                                                  local rv = { }
                                                  local fd = io.popen( "acpi -b")
                                                  if not fd then return end

                                                  local line = fd:read("*l")
                                                  while line do
                                                     local data = line:match("Battery #?[0-9] *: ([^\n]*)")

                                                     rv.state = data:match("([%a]*),.*"):lower()
                                                     rv.charge = tonumber(data:match(".*, ([%d]?[%d]?[%d]%.?[%d]?[%d]?)%%"))
                                                     rv.time = data:match(".*, ([%d]?[%d]?:?[%d][%d]:[%d][%d])")

                                                     if not rv.state:match("unknown") then break end
                                                     line = fd:read("*l")
                                                  end

                                                  fd:close()


                                                  local battery_status = ""
                                                  battery_status = rv.state
                                                  if battery_status == "discharging" then

                                                     if rv.charge > 95 and rv.charge <= 100 then
                                                        baticon.image = image(beautiful.widget_baticon_bat1)
                                                     elseif rv.charge > 90 and rv.charge < 95 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat2)
                                                     elseif rv.charge >= 80 and rv.charge < 90 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat3)
                                                     elseif rv.charge >= 70 and rv.charge < 80 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat3)
                                                     elseif rv.charge >= 60 and rv.charge < 70 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat4)
                                                     elseif rv.charge >= 50 and rv.charge < 60 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat5)
                                                     elseif rv.charge >= 40 and rv.charge < 50 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat6)
                                                     elseif rv.charge >= 30 and rv.charge < 40 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat7)
                                                     elseif rv.charge >= 20 and rv.charge < 30 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat8)
                                                     elseif rv.charge >= 10 and rv.charge < 20 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat9)
                                                     elseif rv.charge > 5 and rv.charge < 10 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat10)

                                                     elseif rv.charge <= 5 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat11)
                                                     end

                                                  elseif battery_status == "charging" then
                                                     if rv.charge > 95 and rv.charge <= 100 then
                                                        baticon.image = image(beautiful.widget_baticon_char1)
                                                     elseif rv.charge > 90 and rv.charge < 95 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char2)
                                                     elseif rv.charge >= 80 and rv.charge < 90 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char3)
                                                     elseif rv.charge >= 70 and rv.charge < 80 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char3)
                                                     elseif rv.charge >= 60 and rv.charge < 70 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char4)
                                                     elseif rv.charge >= 50 and rv.charge < 60 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char5)
                                                     elseif rv.charge >= 40 and rv.charge < 50 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char6)
                                                     elseif rv.charge >= 30 and rv.charge < 40 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char7)
                                                     elseif rv.charge >= 20 and rv.charge < 30 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char8)
                                                     elseif rv.charge >= 10 and rv.charge < 20 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char9)
                                                     elseif rv.charge > 5 and rv.charge < 10 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char10)

                                                     elseif rv.charge <= 5 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char10)
                                                     end


                                                  end


                                                    if battery_present == '0' then
                                                       baticon.image = image(beautiful.widget_baticon_ac)
                                                    end
                                                   
                                                   

                                                 end,
                 1, "BAT0")

y así se ve: (abajo, lo primero que está a la derecha)

Happy Hacking!

]]>

Battery icon with awesome vicious widget

May 18, 2010 by Tomás Solar Castro   comments (0) - Visitas: 3452

vicious, widget, icon, battery, awesome

El código no es de los mejores, pero se ve bonito en la pantalla... hahaha

agreguen algo así en su rc.lua, y por supuesto, elijan uds mismos sus íconos :)

--iconos para baticon widget
beautiful.widget_baticon_bat1 = "/home/tom/.config/awesome/icons/battery/bat1.png"
beautiful.widget_baticon_bat2 = "/home/tom/.config/awesome/icons/battery/bat2.png"
beautiful.widget_baticon_bat3 = "/home/tom/.config/awesome/icons/battery/bat3.png"
beautiful.widget_baticon_bat4 = "/home/tom/.config/awesome/icons/battery/bat4.png"
beautiful.widget_baticon_bat5 = "/home/tom/.config/awesome/icons/battery/bat5.png"
beautiful.widget_baticon_bat6 = "/home/tom/.config/awesome/icons/battery/bat6.png"
beautiful.widget_baticon_bat7 = "/home/tom/.config/awesome/icons/battery/bat7.png"
beautiful.widget_baticon_bat8 = "/home/tom/.config/awesome/icons/battery/bat8.png"
beautiful.widget_baticon_bat9 = "/home/tom/.config/awesome/icons/battery/bat9.png"
beautiful.widget_baticon_bat10 = "/home/tom/.config/awesome/icons/battery/bat10.png"
beautiful.widget_baticon_bat11 = "/home/tom/.config/awesome/icons/battery/bat11.png"

beautiful.widget_baticon_char1 = "/home/tom/.config/awesome/icons/battery/char1.png"
beautiful.widget_baticon_char2 = "/home/tom/.config/awesome/icons/battery/char2.png"
beautiful.widget_baticon_char3 = "/home/tom/.config/awesome/icons/battery/char3.png"
beautiful.widget_baticon_char4 = "/home/tom/.config/awesome/icons/battery/char4.png"
beautiful.widget_baticon_char5 = "/home/tom/.config/awesome/icons/battery/char5.png"
beautiful.widget_baticon_char6 = "/home/tom/.config/awesome/icons/battery/char6.png"
beautiful.widget_baticon_char7 = "/home/tom/.config/awesome/icons/battery/char7.png"
beautiful.widget_baticon_char8 = "/home/tom/.config/awesome/icons/battery/char8.png"
beautiful.widget_baticon_char9 = "/home/tom/.config/awesome/icons/battery/char9.png"
beautiful.widget_baticon_char10 = "/home/tom/.config/awesome/icons/battery/char10.png"

beautiful.widget_baticon_ac = "/home/tom/.config/awesome/icons/battery/ac.png"

--iconos para baticon widget \o/
baticon = widget({ type = "imagebox" })
--baticon.image = image(beautiful.baticon_bat1)
vicious.register(baticon, vicious.widgets.bat, function (widget, args)
                                                  local battery_presentf = io.popen('cat /sys/class/power_supply/BAT0/present ')
                                                  local battery_present = battery_presentf:read("*all")
                                                  battery_presentf :close()

                                                  local rv = { }
                                                  local fd = io.popen( "acpi -b")
                                                  if not fd then return end

                                                  local line = fd:read("*l")
                                                  while line do
                                                     local data = line:match("Battery #?[0-9] *: ([^\n]*)")

                                                     rv.state = data:match("([%a]*),.*"):lower()
                                                     rv.charge = tonumber(data:match(".*, ([%d]?[%d]?[%d]%.?[%d]?[%d]?)%%"))
                                                     rv.time = data:match(".*, ([%d]?[%d]?:?[%d][%d]:[%d][%d])")

                                                     if not rv.state:match("unknown") then break end
                                                     line = fd:read("*l")
                                                  end

                                                  fd:close()

                                                  local battery_status = ""
                                                  battery_status = rv.state
                                                  if battery_status == "discharging" then

                                                     if rv.charge > 95 and rv.charge <= 100 then
                                                        baticon.image = image(beautiful.widget_baticon_bat1)
                                                     elseif rv.charge > 90 and rv.charge < 95 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat2)
                                                     elseif rv.charge >= 80 and rv.charge < 90 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat3)
                                                     elseif rv.charge >= 70 and rv.charge < 80 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat3)
                                                     elseif rv.charge >= 60 and rv.charge < 70 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat4)
                                                     elseif rv.charge >= 50 and rv.charge < 60 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat5)
                                                     elseif rv.charge >= 40 and rv.charge < 50 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat6)
                                                     elseif rv.charge >= 30 and rv.charge < 40 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat7)
                                                     elseif rv.charge >= 20 and rv.charge < 30 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat8)
                                                     elseif rv.charge >= 10 and rv.charge < 20 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat9)
                                                     elseif rv.charge > 5 and rv.charge < 10 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat10)

                                                     elseif rv.charge <= 5 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_bat11)
                                                     end

                                                  elseif battery_status == "charging" then
                                                     if rv.charge > 95 and rv.charge <= 100 then
                                                        baticon.image = image(beautiful.widget_baticon_char1)
                                                     elseif rv.charge > 90 and rv.charge < 95 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char2)
                                                     elseif rv.charge >= 80 and rv.charge < 90 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char3)
                                                     elseif rv.charge >= 70 and rv.charge < 80 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char3)
                                                     elseif rv.charge >= 60 and rv.charge < 70 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char4)
                                                     elseif rv.charge >= 50 and rv.charge < 60 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char5)
                                                     elseif rv.charge >= 40 and rv.charge < 50 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char6)
                                                     elseif rv.charge >= 30 and rv.charge < 40 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char7)
                                                     elseif rv.charge >= 20 and rv.charge < 30 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char8)
                                                     elseif rv.charge >= 10 and rv.charge < 20 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char9)
                                                     elseif rv.charge > 5 and rv.charge < 10 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char10)

                                                     elseif rv.charge <= 5 then
                                                    
                                                        baticon.image = image(beautiful.widget_baticon_char10)
                                                     end

                                                  end

                                                    if battery_present == '0' then
                                                       baticon.image = image(beautiful.widget_baticon_ac)
                                                    end
                                                   
                                                   

                                                 end,
                 1, "BAT0")

y así se ve: (abajo, lo primero que está a la derecha)

Happy Hacking!

]]>

mpdwidget = widget({ type = 'textbox' })
vicious.register(mpdwidget, vicious.widgets.mpd,
    function (widget, args)
       local status = ""
       if     args["{state}"] == "Stop"  then status = "Stopped"
       elseif args["{state}"] == "Play"  then status = "Playing"
       elseif args["{state}"] == "Pause" then status = "Paused"
       end
       return '<span color="white">MPD:</span> '.. status
    end)

mpdwidget:add_signal('mouse::enter', function ()
                                        local statf = io.popen('mpc -f "\n[[Artist: %artist% \nAlbum:  %album% \nTrack: %track%]\nTitle:  %title%]|[%file%]" ')
                                        local stat = statf:read("*all")
                                        statf :close()
                                        naughty.notify({ title      = "Now Playing"
                                                         , text       = stat
                                                         , timeout    = 5
                                                         , position   = "top_right"
                                                      })
                                     end)

mpdwidget:buttons({
                     button({ }, 1, function () awful.util.spawn("mpc toggle") end),
                     button({ }, 2, function () awful.util.spawn("mpc stop") end),
                     button({ }, 3, function () awful.util.spawn(terminal .. " -e ncmpcpp") end),
                     button({ }, 4, function () awful.util.spawn("mpc prev") end),
                     button({ }, 5, function () awful.util.spawn("mpc next") end)
                    
    })

 

Espero que les sirva :)

Saludos!

Happy Hacking!

]]>

Widget MPD en awesome :)

May 14, 2010 by Tomás Solar Castro   comments (0) - Visitas: 3145

vicious, awesome, tip, mpd, widget

mpdwidget = widget({ type = 'textbox' })
vicious.register(mpdwidget, vicious.widgets.mpd,
    function (widget, args)
       local status = ""
       if     args["{state}"] == "Stop"  then status = "Stopped"
       elseif args["{state}"] == "Play"  then status = "Playing"
       elseif args["{state}"] == "Pause" then status = "Paused"
       end
       return '<span color="white">MPD:</span> '.. status
    end)

mpdwidget:add_signal('mouse::enter', function ()
                                        local statf = io.popen('mpc -f "\n[[Artist: %artist% \nAlbum:  %album% \nTrack: %track%]\nTitle:  %title%]|[%file%]" ')
                                        local stat = statf:read("*all")
                                        statf :close()
                                        naughty.notify({ title      = "Now Playing"
                                                         , text       = stat
                                                         , timeout    = 5
                                                         , position   = "top_right"
                                                      })
                                     end)

mpdwidget:buttons({
                     button({ }, 1, function () awful.util.spawn("mpc toggle") end),
                     button({ }, 2, function () awful.util.spawn("mpc stop") end),
                     button({ }, 3, function () awful.util.spawn(terminal .. " -e ncmpcpp") end),
                     button({ }, 4, function () awful.util.spawn("mpc prev") end),
                     button({ }, 5, function () awful.util.spawn("mpc next") end)
                    
    })

 

Espero que les sirva :)

Saludos!

Happy Hacking!

]]>

mpdwidget = widget({ type = 'textbox' })
vicious.register(mpdwidget, vicious.widgets.mpd,
    function (widget, args)
       local status = ""
       if     args["{state}"] == "Stop"  then status = "Stopped"
       elseif args["{state}"] == "Play"  then status = "Playing"
       elseif args["{state}"] == "Pause" then status = "Paused"
       end
       return '<span color="white">MPD:</span> '.. status
    end)

mpdwidget:add_signal('mouse::enter', function ()
                                        local statf = io.popen('mpc -f "\n[[Artist: %artist% \nAlbum:  %album% \nTrack: %track%]\nTitle:  %title%]|[%file%]" ')
                                        local stat = statf:read("*all")
                                        statf :close()
                                        naughty.notify({ title      = "Now Playing"
                                                         , text       = stat
                                                         , timeout    = 5
                                                         , position   = "top_right"
                                                      })
                                     end)

mpdwidget:buttons({
                     button({ }, 1, function () awful.util.spawn("mpc toggle") end),
                     button({ }, 2, function () awful.util.spawn("mpc stop") end),
                     button({ }, 3, function () awful.util.spawn(terminal .. " -e ncmpcpp") end),
                     button({ }, 4, function () awful.util.spawn("mpc prev") end),
                     button({ }, 5, function () awful.util.spawn("mpc next") end)
                    
    })

 

Espero que les sirva :)

Saludos!

Happy Hacking!

]]>

Widget MPD en awesome :)

May 14, 2010 by Tomás Solar Castro   comments (0) - Visitas: 3145

vicious, awesome, tip, mpd, widget

mpdwidget = widget({ type = 'textbox' })
vicious.register(mpdwidget, vicious.widgets.mpd,
    function (widget, args)
       local status = ""
       if     args["{state}"] == "Stop"  then status = "Stopped"
       elseif args["{state}"] == "Play"  then status = "Playing"
       elseif args["{state}"] == "Pause" then status = "Paused"
       end
       return '<span color="white">MPD:</span> '.. status
    end)

mpdwidget:add_signal('mouse::enter', function ()
                                        local statf = io.popen('mpc -f "\n[[Artist: %artist% \nAlbum:  %album% \nTrack: %track%]\nTitle:  %title%]|[%file%]" ')
                                        local stat = statf:read("*all")
                                        statf :close()
                                        naughty.notify({ title      = "Now Playing"
                                                         , text       = stat
                                                         , timeout    = 5
                                                         , position   = "top_right"
                                                      })
                                     end)

mpdwidget:buttons({
                     button({ }, 1, function () awful.util.spawn("mpc toggle") end),
                     button({ }, 2, function () awful.util.spawn("mpc stop") end),
                     button({ }, 3, function () awful.util.spawn(terminal .. " -e ncmpcpp") end),
                     button({ }, 4, function () awful.util.spawn("mpc prev") end),
                     button({ }, 5, function () awful.util.spawn("mpc next") end)
                    
    })

 

Espero que les sirva :)

Saludos!

Happy Hacking!

]]>
== Take your freedom back, with Linux 2.6.33-libre

Cyberspace, March 1, 2010---Linux hasn't been Free Software since
1996, when Mr Torvalds accepted the first pieces of non-Free Software
in the distributions of Linux he has published since 1991.  Over these
years, while this kernel grew by a factor of 14, the amount of
non-Free firmware required by Linux drivers grew by an alarming factor
of 83.  We, Free Software users, need to join forces to reverse this
trend, and part of the solution is Linux-libre, whose release
2.6.33-libre was recently published by FSFLA, bringing with it
freedom, major improvements and plans for the future.


== History

All firmware in Linux 1.3.0 was Free Software.  Whatever little
relevance the GNU/Linux operating system had back in 1995 was enough
for a few hardware vendors to disclose the details of their hardware
or even offer all the software needed to make it work under terms that
respected users' essential freedoms.  They knew Linux, already
licensed under the GNU GPLv2, wouldn't have drivers for their
components otherwise.

Over the year that followed, Mr Torvalds changed his stance, and
started accepting binary-only firmware in Linux.  Because of this
decision, GNU/Linux ceased to be an incentive for hardware vendors to
respect users' essential freedoms.  Since the Linux developers
forfeited the defenses provided by the GPL, nearly all of the vendors
decided to keep only to themselves the control over the ever-growing
computers that passed for peripherals.

Some 143KB of object code disguised as source code were present in the
4.7MB compressed tarball of Linux 2.0, released in June, 1996.  Some 6
years later, there were 1.3MB of non-Free firmware hiding in the 26MB
compressed tarball of Linux 2.4.19.  In 2.6.33, all of these pieces
and them some, adding up to 2MB, lie in a subtree created some two
years ago to hold firmware in Linux.  Another 650KB still disguised as
sources were recently added to the staging subtree, and another 9.2MB
(duplicates removed) live in a separate archive, created to eventually
replace the firmware subtree in Linux.


== Perspective

The largest single piece of non-Free firmware in the linux-firmware
repository weights 1.25MB today.  In the 1980s, half as many bytes
were held as enough memory for any application in a personal computer.
It was then that Richard Stallman started working on GNU, when entire
operating systems were smaller than that.  He realized that users
should be entitled to the four essential freedoms over all the
software that ran on computers, even when they were far less powerful
than today's peripherals.

We have achieved that, a Free operating system for general-purpose
personal computers, but it lasted for only a few years.  The kernel
that provided the piece that was missing in the GNU operating system
hasn't been Free Software for more than a decade, and it requests
users to install a growing number of non-Free programs that are not
included in it.


== Progress

We welcome, applaud and thank the various recent efforts that resulted
in Free firmware for various devices: Atheros contributed Free
firmware for its ar5k and ar9k wireless networking cards; experts in
reverse engineering developed Free firmware for some of Broadcom's b43
wireless networking cards; others developed the Free nouveau driver
for nVidia video cards, and, more recently, completed the task with
Free firmware for them, unfortunately a bit too late for the final
pieces to make 2.6.33.

However, just like RMS, we realized that developing Free Software
isn't enough to establish freedom for the users of GNU/Linux.  We also
need to educate them to value their freedom, and to recognize and
reject non-Free Software.  Otherwise the products that require users
to give up their freedom would continue to find willing customers.

A few years ago, the Free Software community realized that Linux was
no longer Free Software, and started various efforts to fix this
problem.  One of them, born nameless within gNewSense, was named
Linux-libre within BLAG.  Once we took responsibility for it, in
addition to removing the non-Free components from Linux, we replace
the requests for non-Free firmware with messages that inform users
that the hardware in question is a trap.

Our hope is that more users will use this Free version of Linux,
present in various GNU/Linux-libre distributions, to find out about
hardware components that do not respect their freedoms, then tell
vendors how unhappy they are, and use their freedom and power of
choice to support vendors that do respect their customers.

Large businesses, governments or lots of users working together,
applying a little pressure at the right spot of vendors' pockets, can
often get them to change their minds and voluntarily respect
customers' freedom.  Failing that, we can still help, participating in
or funding reverse engineering efforts.  The manufacturers that
voluntarily respect our freedom deserve the most appreciation, but a
product that works in freedom despite the efforts of the manufacturer
is much better than nothing.


== What's new in Linux 2.6.33-libre

We don't maintain the Linux-libre source files directly.  Instead we
maintain “deblobbing” scripts that clean Linux “sources”, thus
producing Linux-libre sources.  The main improvement in this
generation of Linux-libre, the fourth since we got involved, consisted
of making the deblobbing scripts more efficient.

As we accumulated thousands of patterns to recognize blobs, sequences
that look like blobs but that aren't, requests for non-Free firmware
external to Linux, and documentation that induces users to install it,
running the GNU sed script generated to locate and remove blobs became
too expensive for many users: in recent releases of Linux-libre, GNU
sed took some 15 seconds and more than 2GB of RAM to compile all the
patterns in the script.

The solution was to rewrite the main script in higher-level scripting
languages.  GNU awk reduced the start-up time to about 3 seconds, and
memory requirements dropped by an order of magnitude, but 3 seconds
multiplied by the 260 files that get cleaned up with this script to
form Linux-2.6.33-libre is a lot of time to waste.  Python and PERL
compile our huge collection of patterns in tenths of a second, while
reducing memory use by almost another order of magnitude.  However,
internal limits in PERL's pattern matching algorithm produce incorrect
results in deblob-check, so using it with PERL is not recommended for
now.

For deblob-main's cleaning-up of small files in Linux, Python was
determined to be fastest, which is why it is the new default.  For
verifying that a large tarball is clean, Python and PERL's run-time
jump to more than 90 minutes, up from 5 minutes with GNU awk and as
little as 3 minutes with GNU sed.  GNU awk comes ahead when listing
all the blobs in a Linux tarball, now with a long-wished feature:
printing before each blob the name of the file within the tarball that
contains it.

Future releases may be smarter in choosing suitable backend depending
on task and inputs.  For now, users of deblob-check should be aware of
the new flags: --use-python, --use-awk, --use-perl, and --use-sed, and
the corresponding environment variables PYTHON, AWK, PERL, and SED.

The lower memory footprint and CPU requirements for checking and
cleaning up individual files means it is again possible to clean up
Linux trees on the fly, which a number of users used to find valuable.

Over the next few days, we'll also roll out Linux-libre, generation 4,
for earlier Linux releases, fixing a few deblobbing errors in staging
drivers and catching a few more occurrences of non-Free blob names in
documentation and error messages.


== Request for comments

A number of our users have expressed legitimate dissatisfaction with a
consequence of the method we've used to stop the kernel from inducing
users to install non-Free firmware.  It is not our goal to prevent
users from loading or running non-Free firmware, but the only way we
thought of to avoid inducing users to run non-Free firmware had the
side effect of making it impossible to use the non-Free firmware just
by installing it.

In Linux, several drivers call request_firmware with a blob name.
This request is logged, including the blob name, and passed on to a
userland program, supposed to locate a firmware file with that name
and upload it to the kernel.  Given the logs, in addition to existing
and potential behavior of the userland program, this amounted to Linux
telling its user to install a specific non-Free program, which is
unacceptable.

Linux-libre releases since generation 2 replace the blob name with a
name that the firmware loader is unlikely to match, and that could be
recognized in userland to inform users about the lack of Free firmware
for some hardware component of the system.  We also reject whatever
response the firmware loader produces for such requests, to minimize
the risk of accidental matches and hardware damage.

We reasoned that anyone determined to use the firmware could still
build a module, or a complete kernel, that issues the request and uses
the response.  This possibility was considered too cumbersome by some.

Recently we came up with another way to achieve the goal of stopping
the kernel from inviting users into the trap of non-Free Software:
where Linux requests a firmware file that we know is non-Free, we
could anonymize the blob name with a unidirectional hash of its name
and a kernel build and/or session identifier, and issue a request for
a file named after the computed hash.

Given a suitable implementation of the userland firmware loader,
whatever pieces of firmware the user chose to install would still be
readily located and made available to the kernel.  However, because of
the unidirectional nature of the hash, a request for firmware that's
not installed won't steer users toward that firmware, because the hash
code won't immediately identify it.  Thus, if the user insists on
installing this firmware, Linux-libre will work with it, but it is
very unlikely anyone will install the firmware because of Linux-libre.

Join us at linux-libre@fsfla.org and let us know your suggestions,
other ways to address this issue, or your opinion about this plan and
whether it might be accepted upstream.  Feedback and help are welcome!

In the mean time, Be Free! with Linux 2.6.33-libre, and help us
reverse the growing dependency of Linux on non-Free firmware.


== About Linux-libre

Linux-libre is a project maintained by FSFLA, that releases cleaned-up
versions of Linux, suitable for use in distributions that comply with
the Free Software Distribution Guidelines published by the GNU
project, and by users who wish to run Free versions of Linux on their
GNU systems.  The project offers cleaning-up scripts and Freed
sources, binaries for some Free GNU/Linux-libre distributions, and
binaries to replace with minimal changes the kernels in non-Free
GNU/Linux distributions: Freed-ebian and Freed-ora, and artwork with
GNU and the Linux-libre mascot: Freedo, the clean, Free and
user-friendly light-blue penguin.  Learn more at our web site.
<br/>http://linux-libre.fsfla.org/
<br/>http://www.gnu.org/distros/


== About FSFLA

Free Software Foundation Latin America joined in 2005 the
international FSF network, previously formed by Free Software
Foundations in the United States, in Europe and in India.  These
sister organizations work in their corresponding geographies towards
promoting the same Free Software ideals and defending the same
freedoms for software users and developers, working locally but
cooperating globally.
<br/>http://www.fsfla.org/

----

Copyright 2010 FSFLA

Permission is granted to make and distribute verbatim copies of this
entire document without royalty, provided the copyright notice, the
document's official URL, and this permission notice are preserved.

Permission is also granted to make and distribute verbatim copies of
individual sections of this document worldwide without royalty
provided the copyright notice and the permission notice above are
preserved, and the document's official URL is preserved or replaced by
the individual section's official URL.

http://www.fsfla.org/anuncio/2010-03-linux-2.6.33-libre

]]>

Linux-libre 2.6.33 anouncement

May 14, 2010 by Tomás Solar Castro   comments (0) - Visitas: 2818

linux-libre, fsfla

== Take your freedom back, with Linux 2.6.33-libre

Cyberspace, March 1, 2010---Linux hasn't been Free Software since
1996, when Mr Torvalds accepted the first pieces of non-Free Software
in the distributions of Linux he has published since 1991.  Over these
years, while this kernel grew by a factor of 14, the amount of
non-Free firmware required by Linux drivers grew by an alarming factor
of 83.  We, Free Software users, need to join forces to reverse this
trend, and part of the solution is Linux-libre, whose release
2.6.33-libre was recently published by FSFLA, bringing with it
freedom, major improvements and plans for the future.

== History

All firmware in Linux 1.3.0 was Free Software.  Whatever little
relevance the GNU/Linux operating system had back in 1995 was enough
for a few hardware vendors to disclose the details of their hardware
or even offer all the software needed to make it work under terms that
respected users' essential freedoms.  They knew Linux, already
licensed under the GNU GPLv2, wouldn't have drivers for their
components otherwise.

Over the year that followed, Mr Torvalds changed his stance, and
started accepting binary-only firmware in Linux.  Because of this
decision, GNU/Linux ceased to be an incentive for hardware vendors to
respect users' essential freedoms.  Since the Linux developers
forfeited the defenses provided by the GPL, nearly all of the vendors
decided to keep only to themselves the control over the ever-growing
computers that passed for peripherals.

Some 143KB of object code disguised as source code were present in the
4.7MB compressed tarball of Linux 2.0, released in June, 1996.  Some 6
years later, there were 1.3MB of non-Free firmware hiding in the 26MB
compressed tarball of Linux 2.4.19.  In 2.6.33, all of these pieces
and them some, adding up to 2MB, lie in a subtree created some two
years ago to hold firmware in Linux.  Another 650KB still disguised as
sources were recently added to the staging subtree, and another 9.2MB
(duplicates removed) live in a separate archive, created to eventually
replace the firmware subtree in Linux.

== Perspective

The largest single piece of non-Free firmware in the linux-firmware
repository weights 1.25MB today.  In the 1980s, half as many bytes
were held as enough memory for any application in a personal computer.
It was then that Richard Stallman started working on GNU, when entire
operating systems were smaller than that.  He realized that users
should be entitled to the four essential freedoms over all the
software that ran on computers, even when they were far less powerful
than today's peripherals.

We have achieved that, a Free operating system for general-purpose
personal computers, but it lasted for only a few years.  The kernel
that provided the piece that was missing in the GNU operating system
hasn't been Free Software for more than a decade, and it requests
users to install a growing number of non-Free programs that are not
included in it.

== Progress

We welcome, applaud and thank the various recent efforts that resulted
in Free firmware for various devices: Atheros contributed Free
firmware for its ar5k and ar9k wireless networking cards; experts in
reverse engineering developed Free firmware for some of Broadcom's b43
wireless networking cards; others developed the Free nouveau driver
for nVidia video cards, and, more recently, completed the task with
Free firmware for them, unfortunately a bit too late for the final
pieces to make 2.6.33.

However, just like RMS, we realized that developing Free Software
isn't enough to establish freedom for the users of GNU/Linux.  We also
need to educate them to value their freedom, and to recognize and
reject non-Free Software.  Otherwise the products that require users
to give up their freedom would continue to find willing customers.

A few years ago, the Free Software community realized that Linux was
no longer Free Software, and started various efforts to fix this
problem.  One of them, born nameless within gNewSense, was named
Linux-libre within BLAG.  Once we took responsibility for it, in
addition to removing the non-Free components from Linux, we replace
the requests for non-Free firmware with messages that inform users
that the hardware in question is a trap.

Our hope is that more users will use this Free version of Linux,
present in various GNU/Linux-libre distributions, to find out about
hardware components that do not respect their freedoms, then tell
vendors how unhappy they are, and use their freedom and power of
choice to support vendors that do respect their customers.

Large businesses, governments or lots of users working together,
applying a little pressure at the right spot of vendors' pockets, can
often get them to change their minds and voluntarily respect
customers' freedom.  Failing that, we can still help, participating in
or funding reverse engineering efforts.  The manufacturers that
voluntarily respect our freedom deserve the most appreciation, but a
product that works in freedom despite the efforts of the manufacturer
is much better than nothing.

== What's new in Linux 2.6.33-libre

We don't maintain the Linux-libre source files directly.  Instead we
maintain “deblobbing” scripts that clean Linux “sources”, thus
producing Linux-libre sources.  The main improvement in this
generation of Linux-libre, the fourth since we got involved, consisted
of making the deblobbing scripts more efficient.

As we accumulated thousands of patterns to recognize blobs, sequences
that look like blobs but that aren't, requests for non-Free firmware
external to Linux, and documentation that induces users to install it,
running the GNU sed script generated to locate and remove blobs became
too expensive for many users: in recent releases of Linux-libre, GNU
sed took some 15 seconds and more than 2GB of RAM to compile all the
patterns in the script.

The solution was to rewrite the main script in higher-level scripting
languages.  GNU awk reduced the start-up time to about 3 seconds, and
memory requirements dropped by an order of magnitude, but 3 seconds
multiplied by the 260 files that get cleaned up with this script to
form Linux-2.6.33-libre is a lot of time to waste.  Python and PERL
compile our huge collection of patterns in tenths of a second, while
reducing memory use by almost another order of magnitude.  However,
internal limits in PERL's pattern matching algorithm produce incorrect
results in deblob-check, so using it with PERL is not recommended for
now.

For deblob-main's cleaning-up of small files in Linux, Python was
determined to be fastest, which is why it is the new default.  For
verifying that a large tarball is clean, Python and PERL's run-time
jump to more than 90 minutes, up from 5 minutes with GNU awk and as
little as 3 minutes with GNU sed.  GNU awk comes ahead when listing
all the blobs in a Linux tarball, now with a long-wished feature:
printing before each blob the name of the file within the tarball that
contains it.

Future releases may be smarter in choosing suitable backend depending
on task and inputs.  For now, users of deblob-check should be aware of
the new flags: --use-python, --use-awk, --use-perl, and --use-sed, and
the corresponding environment variables PYTHON, AWK, PERL, and SED.

The lower memory footprint and CPU requirements for checking and
cleaning up individual files means it is again possible to clean up
Linux trees on the fly, which a number of users used to find valuable.

Over the next few days, we'll also roll out Linux-libre, generation 4,
for earlier Linux releases, fixing a few deblobbing errors in staging
drivers and catching a few more occurrences of non-Free blob names in
documentation and error messages.

== Request for comments

A number of our users have expressed legitimate dissatisfaction with a
consequence of the method we've used to stop the kernel from inducing
users to install non-Free firmware.  It is not our goal to prevent
users from loading or running non-Free firmware, but the only way we
thought of to avoid inducing users to run non-Free firmware had the
side effect of making it impossible to use the non-Free firmware just
by installing it.

In Linux, several drivers call request_firmware with a blob name.
This request is logged, including the blob name, and passed on to a
userland program, supposed to locate a firmware file with that name
and upload it to the kernel.  Given the logs, in addition to existing
and potential behavior of the userland program, this amounted to Linux
telling its user to install a specific non-Free program, which is
unacceptable.

Linux-libre releases since generation 2 replace the blob name with a
name that the firmware loader is unlikely to match, and that could be
recognized in userland to inform users about the lack of Free firmware
for some hardware component of the system.  We also reject whatever
response the firmware loader produces for such requests, to minimize
the risk of accidental matches and hardware damage.

We reasoned that anyone determined to use the firmware could still
build a module, or a complete kernel, that issues the request and uses
the response.  This possibility was considered too cumbersome by some.

Recently we came up with another way to achieve the goal of stopping
the kernel from inviting users into the trap of non-Free Software:
where Linux requests a firmware file that we know is non-Free, we
could anonymize the blob name with a unidirectional hash of its name
and a kernel build and/or session identifier, and issue a request for
a file named after the computed hash.

Given a suitable implementation of the userland firmware loader,
whatever pieces of firmware the user chose to install would still be
readily located and made available to the kernel.  However, because of
the unidirectional nature of the hash, a request for firmware that's
not installed won't steer users toward that firmware, because the hash
code won't immediately identify it.  Thus, if the user insists on
installing this firmware, Linux-libre will work with it, but it is
very unlikely anyone will install the firmware because of Linux-libre.

Join us at linux-libre@fsfla.org and let us know your suggestions,
other ways to address this issue, or your opinion about this plan and
whether it might be accepted upstream.  Feedback and help are welcome!

In the mean time, Be Free! with Linux 2.6.33-libre, and help us
reverse the growing dependency of Linux on non-Free firmware.

== About Linux-libre

Linux-libre is a project maintained by FSFLA, that releases cleaned-up
versions of Linux, suitable for use in distributions that comply with
the Free Software Distribution Guidelines published by the GNU
project, and by users who wish to run Free versions of Linux on their
GNU systems.  The project offers cleaning-up scripts and Freed
sources, binaries for some Free GNU/Linux-libre distributions, and
binaries to replace with minimal changes the kernels in non-Free
GNU/Linux distributions: Freed-ebian and Freed-ora, and artwork with
GNU and the Linux-libre mascot: Freedo, the clean, Free and
user-friendly light-blue penguin.  Learn more at our web site.
<br/>http://linux-libre.fsfla.org/
<br/>http://www.gnu.org/distros/

== About FSFLA

Free Software Foundation Latin America joined in 2005 the
international FSF network, previously formed by Free Software
Foundations in the United States, in Europe and in India.  These
sister organizations work in their corresponding geographies towards
promoting the same Free Software ideals and defending the same
freedoms for software users and developers, working locally but
cooperating globally.
<br/>http://www.fsfla.org/

----

Copyright 2010 FSFLA

Permission is granted to make and distribute verbatim copies of this
entire document without royalty, provided the copyright notice, the
document's official URL, and this permission notice are preserved.

Permission is also granted to make and distribute verbatim copies of
individual sections of this document worldwide without royalty
provided the copyright notice and the permission notice above are
preserved, and the document's official URL is preserved or replaced by
the individual section's official URL.

http://www.fsfla.org/anuncio/2010-03-linux-2.6.33-libre

]]>
== Take your freedom back, with Linux 2.6.33-libre

Cyberspace, March 1, 2010---Linux hasn't been Free Software since
1996, when Mr Torvalds accepted the first pieces of non-Free Software
in the distributions of Linux he has published since 1991.  Over these
years, while this kernel grew by a factor of 14, the amount of
non-Free firmware required by Linux drivers grew by an alarming factor
of 83.  We, Free Software users, need to join forces to reverse this
trend, and part of the solution is Linux-libre, whose release
2.6.33-libre was recently published by FSFLA, bringing with it
freedom, major improvements and plans for the future.


== History

All firmware in Linux 1.3.0 was Free Software.  Whatever little
relevance the GNU/Linux operating system had back in 1995 was enough
for a few hardware vendors to disclose the details of their hardware
or even offer all the software needed to make it work under terms that
respected users' essential freedoms.  They knew Linux, already
licensed under the GNU GPLv2, wouldn't have drivers for their
components otherwise.

Over the year that followed, Mr Torvalds changed his stance, and
started accepting binary-only firmware in Linux.  Because of this
decision, GNU/Linux ceased to be an incentive for hardware vendors to
respect users' essential freedoms.  Since the Linux developers
forfeited the defenses provided by the GPL, nearly all of the vendors
decided to keep only to themselves the control over the ever-growing
computers that passed for peripherals.

Some 143KB of object code disguised as source code were present in the
4.7MB compressed tarball of Linux 2.0, released in June, 1996.  Some 6
years later, there were 1.3MB of non-Free firmware hiding in the 26MB
compressed tarball of Linux 2.4.19.  In 2.6.33, all of these pieces
and them some, adding up to 2MB, lie in a subtree created some two
years ago to hold firmware in Linux.  Another 650KB still disguised as
sources were recently added to the staging subtree, and another 9.2MB
(duplicates removed) live in a separate archive, created to eventually
replace the firmware subtree in Linux.


== Perspective

The largest single piece of non-Free firmware in the linux-firmware
repository weights 1.25MB today.  In the 1980s, half as many bytes
were held as enough memory for any application in a personal computer.
It was then that Richard Stallman started working on GNU, when entire
operating systems were smaller than that.  He realized that users
should be entitled to the four essential freedoms over all the
software that ran on computers, even when they were far less powerful
than today's peripherals.

We have achieved that, a Free operating system for general-purpose
personal computers, but it lasted for only a few years.  The kernel
that provided the piece that was missing in the GNU operating system
hasn't been Free Software for more than a decade, and it requests
users to install a growing number of non-Free programs that are not
included in it.


== Progress

We welcome, applaud and thank the various recent efforts that resulted
in Free firmware for various devices: Atheros contributed Free
firmware for its ar5k and ar9k wireless networking cards; experts in
reverse engineering developed Free firmware for some of Broadcom's b43
wireless networking cards; others developed the Free nouveau driver
for nVidia video cards, and, more recently, completed the task with
Free firmware for them, unfortunately a bit too late for the final
pieces to make 2.6.33.

However, just like RMS, we realized that developing Free Software
isn't enough to establish freedom for the users of GNU/Linux.  We also
need to educate them to value their freedom, and to recognize and
reject non-Free Software.  Otherwise the products that require users
to give up their freedom would continue to find willing customers.

A few years ago, the Free Software community realized that Linux was
no longer Free Software, and started various efforts to fix this
problem.  One of them, born nameless within gNewSense, was named
Linux-libre within BLAG.  Once we took responsibility for it, in
addition to removing the non-Free components from Linux, we replace
the requests for non-Free firmware with messages that inform users
that the hardware in question is a trap.

Our hope is that more users will use this Free version of Linux,
present in various GNU/Linux-libre distributions, to find out about
hardware components that do not respect their freedoms, then tell
vendors how unhappy they are, and use their freedom and power of
choice to support vendors that do respect their customers.

Large businesses, governments or lots of users working together,
applying a little pressure at the right spot of vendors' pockets, can
often get them to change their minds and voluntarily respect
customers' freedom.  Failing that, we can still help, participating in
or funding reverse engineering efforts.  The manufacturers that
voluntarily respect our freedom deserve the most appreciation, but a
product that works in freedom despite the efforts of the manufacturer
is much better than nothing.


== What's new in Linux 2.6.33-libre

We don't maintain the Linux-libre source files directly.  Instead we
maintain “deblobbing” scripts that clean Linux “sources”, thus
producing Linux-libre sources.  The main improvement in this
generation of Linux-libre, the fourth since we got involved, consisted
of making the deblobbing scripts more efficient.

As we accumulated thousands of patterns to recognize blobs, sequences
that look like blobs but that aren't, requests for non-Free firmware
external to Linux, and documentation that induces users to install it,
running the GNU sed script generated to locate and remove blobs became
too expensive for many users: in recent releases of Linux-libre, GNU
sed took some 15 seconds and more than 2GB of RAM to compile all the
patterns in the script.

The solution was to rewrite the main script in higher-level scripting
languages.  GNU awk reduced the start-up time to about 3 seconds, and
memory requirements dropped by an order of magnitude, but 3 seconds
multiplied by the 260 files that get cleaned up with this script to
form Linux-2.6.33-libre is a lot of time to waste.  Python and PERL
compile our huge collection of patterns in tenths of a second, while
reducing memory use by almost another order of magnitude.  However,
internal limits in PERL's pattern matching algorithm produce incorrect
results in deblob-check, so using it with PERL is not recommended for
now.

For deblob-main's cleaning-up of small files in Linux, Python was
determined to be fastest, which is why it is the new default.  For
verifying that a large tarball is clean, Python and PERL's run-time
jump to more than 90 minutes, up from 5 minutes with GNU awk and as
little as 3 minutes with GNU sed.  GNU awk comes ahead when listing
all the blobs in a Linux tarball, now with a long-wished feature:
printing before each blob the name of the file within the tarball that
contains it.

Future releases may be smarter in choosing suitable backend depending
on task and inputs.  For now, users of deblob-check should be aware of
the new flags: --use-python, --use-awk, --use-perl, and --use-sed, and
the corresponding environment variables PYTHON, AWK, PERL, and SED.

The lower memory footprint and CPU requirements for checking and
cleaning up individual files means it is again possible to clean up
Linux trees on the fly, which a number of users used to find valuable.

Over the next few days, we'll also roll out Linux-libre, generation 4,
for earlier Linux releases, fixing a few deblobbing errors in staging
drivers and catching a few more occurrences of non-Free blob names in
documentation and error messages.


== Request for comments

A number of our users have expressed legitimate dissatisfaction with a
consequence of the method we've used to stop the kernel from inducing
users to install non-Free firmware.  It is not our goal to prevent
users from loading or running non-Free firmware, but the only way we
thought of to avoid inducing users to run non-Free firmware had the
side effect of making it impossible to use the non-Free firmware just
by installing it.

In Linux, several drivers call request_firmware with a blob name.
This request is logged, including the blob name, and passed on to a
userland program, supposed to locate a firmware file with that name
and upload it to the kernel.  Given the logs, in addition to existing
and potential behavior of the userland program, this amounted to Linux
telling its user to install a specific non-Free program, which is
unacceptable.

Linux-libre releases since generation 2 replace the blob name with a
name that the firmware loader is unlikely to match, and that could be
recognized in userland to inform users about the lack of Free firmware
for some hardware component of the system.  We also reject whatever
response the firmware loader produces for such requests, to minimize
the risk of accidental matches and hardware damage.

We reasoned that anyone determined to use the firmware could still
build a module, or a complete kernel, that issues the request and uses
the response.  This possibility was considered too cumbersome by some.

Recently we came up with another way to achieve the goal of stopping
the kernel from inviting users into the trap of non-Free Software:
where Linux requests a firmware file that we know is non-Free, we
could anonymize the blob name with a unidirectional hash of its name
and a kernel build and/or session identifier, and issue a request for
a file named after the computed hash.

Given a suitable implementation of the userland firmware loader,
whatever pieces of firmware the user chose to install would still be
readily located and made available to the kernel.  However, because of
the unidirectional nature of the hash, a request for firmware that's
not installed won't steer users toward that firmware, because the hash
code won't immediately identify it.  Thus, if the user insists on
installing this firmware, Linux-libre will work with it, but it is
very unlikely anyone will install the firmware because of Linux-libre.

Join us at linux-libre@fsfla.org and let us know your suggestions,
other ways to address this issue, or your opinion about this plan and
whether it might be accepted upstream.  Feedback and help are welcome!

In the mean time, Be Free! with Linux 2.6.33-libre, and help us
reverse the growing dependency of Linux on non-Free firmware.


== About Linux-libre

Linux-libre is a project maintained by FSFLA, that releases cleaned-up
versions of Linux, suitable for use in distributions that comply with
the Free Software Distribution Guidelines published by the GNU
project, and by users who wish to run Free versions of Linux on their
GNU systems.  The project offers cleaning-up scripts and Freed
sources, binaries for some Free GNU/Linux-libre distributions, and
binaries to replace with minimal changes the kernels in non-Free
GNU/Linux distributions: Freed-ebian and Freed-ora, and artwork with
GNU and the Linux-libre mascot: Freedo, the clean, Free and
user-friendly light-blue penguin.  Learn more at our web site.
<br/>http://linux-libre.fsfla.org/
<br/>http://www.gnu.org/distros/


== About FSFLA

Free Software Foundation Latin America joined in 2005 the
international FSF network, previously formed by Free Software
Foundations in the United States, in Europe and in India.  These
sister organizations work in their corresponding geographies towards
promoting the same Free Software ideals and defending the same
freedoms for software users and developers, working locally but
cooperating globally.
<br/>http://www.fsfla.org/

----

Copyright 2010 FSFLA

Permission is granted to make and distribute verbatim copies of this
entire document without royalty, provided the copyright notice, the
document's official URL, and this permission notice are preserved.

Permission is also granted to make and distribute verbatim copies of
individual sections of this document worldwide without royalty
provided the copyright notice and the permission notice above are
preserved, and the document's official URL is preserved or replaced by
the individual section's official URL.

http://www.fsfla.org/anuncio/2010-03-linux-2.6.33-libre

]]>

Linux-libre 2.6.33 anouncement

May 14, 2010 by Tomás Solar Castro   comments (0) - Visitas: 2818

linux-libre, fsfla

== Take your freedom back, with Linux 2.6.33-libre

Cyberspace, March 1, 2010---Linux hasn't been Free Software since
1996, when Mr Torvalds accepted the first pieces of non-Free Software
in the distributions of Linux he has published since 1991.  Over these
years, while this kernel grew by a factor of 14, the amount of
non-Free firmware required by Linux drivers grew by an alarming factor
of 83.  We, Free Software users, need to join forces to reverse this
trend, and part of the solution is Linux-libre, whose release
2.6.33-libre was recently published by FSFLA, bringing with it
freedom, major improvements and plans for the future.

== History

All firmware in Linux 1.3.0 was Free Software.  Whatever little
relevance the GNU/Linux operating system had back in 1995 was enough
for a few hardware vendors to disclose the details of their hardware
or even offer all the software needed to make it work under terms that
respected users' essential freedoms.  They knew Linux, already
licensed under the GNU GPLv2, wouldn't have drivers for their
components otherwise.

Over the year that followed, Mr Torvalds changed his stance, and
started accepting binary-only firmware in Linux.  Because of this
decision, GNU/Linux ceased to be an incentive for hardware vendors to
respect users' essential freedoms.  Since the Linux developers
forfeited the defenses provided by the GPL, nearly all of the vendors
decided to keep only to themselves the control over the ever-growing
computers that passed for peripherals.

Some 143KB of object code disguised as source code were present in the
4.7MB compressed tarball of Linux 2.0, released in June, 1996.  Some 6
years later, there were 1.3MB of non-Free firmware hiding in the 26MB
compressed tarball of Linux 2.4.19.  In 2.6.33, all of these pieces
and them some, adding up to 2MB, lie in a subtree created some two
years ago to hold firmware in Linux.  Another 650KB still disguised as
sources were recently added to the staging subtree, and another 9.2MB
(duplicates removed) live in a separate archive, created to eventually
replace the firmware subtree in Linux.

== Perspective

The largest single piece of non-Free firmware in the linux-firmware
repository weights 1.25MB today.  In the 1980s, half as many bytes
were held as enough memory for any application in a personal computer.
It was then that Richard Stallman started working on GNU, when entire
operating systems were smaller than that.  He realized that users
should be entitled to the four essential freedoms over all the
software that ran on computers, even when they were far less powerful
than today's peripherals.

We have achieved that, a Free operating system for general-purpose
personal computers, but it lasted for only a few years.  The kernel
that provided the piece that was missing in the GNU operating system
hasn't been Free Software for more than a decade, and it requests
users to install a growing number of non-Free programs that are not
included in it.

== Progress

We welcome, applaud and thank the various recent efforts that resulted
in Free firmware for various devices: Atheros contributed Free
firmware for its ar5k and ar9k wireless networking cards; experts in
reverse engineering developed Free firmware for some of Broadcom's b43
wireless networking cards; others developed the Free nouveau driver
for nVidia video cards, and, more recently, completed the task with
Free firmware for them, unfortunately a bit too late for the final
pieces to make 2.6.33.

However, just like RMS, we realized that developing Free Software
isn't enough to establish freedom for the users of GNU/Linux.  We also
need to educate them to value their freedom, and to recognize and
reject non-Free Software.  Otherwise the products that require users
to give up their freedom would continue to find willing customers.

A few years ago, the Free Software community realized that Linux was
no longer Free Software, and started various efforts to fix this
problem.  One of them, born nameless within gNewSense, was named
Linux-libre within BLAG.  Once we took responsibility for it, in
addition to removing the non-Free components from Linux, we replace
the requests for non-Free firmware with messages that inform users
that the hardware in question is a trap.

Our hope is that more users will use this Free version of Linux,
present in various GNU/Linux-libre distributions, to find out about
hardware components that do not respect their freedoms, then tell
vendors how unhappy they are, and use their freedom and power of
choice to support vendors that do respect their customers.

Large businesses, governments or lots of users working together,
applying a little pressure at the right spot of vendors' pockets, can
often get them to change their minds and voluntarily respect
customers' freedom.  Failing that, we can still help, participating in
or funding reverse engineering efforts.  The manufacturers that
voluntarily respect our freedom deserve the most appreciation, but a
product that works in freedom despite the efforts of the manufacturer
is much better than nothing.

== What's new in Linux 2.6.33-libre

We don't maintain the Linux-libre source files directly.  Instead we
maintain “deblobbing” scripts that clean Linux “sources”, thus
producing Linux-libre sources.  The main improvement in this
generation of Linux-libre, the fourth since we got involved, consisted
of making the deblobbing scripts more efficient.

As we accumulated thousands of patterns to recognize blobs, sequences
that look like blobs but that aren't, requests for non-Free firmware
external to Linux, and documentation that induces users to install it,
running the GNU sed script generated to locate and remove blobs became
too expensive for many users: in recent releases of Linux-libre, GNU
sed took some 15 seconds and more than 2GB of RAM to compile all the
patterns in the script.

The solution was to rewrite the main script in higher-level scripting
languages.  GNU awk reduced the start-up time to about 3 seconds, and
memory requirements dropped by an order of magnitude, but 3 seconds
multiplied by the 260 files that get cleaned up with this script to
form Linux-2.6.33-libre is a lot of time to waste.  Python and PERL
compile our huge collection of patterns in tenths of a second, while
reducing memory use by almost another order of magnitude.  However,
internal limits in PERL's pattern matching algorithm produce incorrect
results in deblob-check, so using it with PERL is not recommended for
now.

For deblob-main's cleaning-up of small files in Linux, Python was
determined to be fastest, which is why it is the new default.  For
verifying that a large tarball is clean, Python and PERL's run-time
jump to more than 90 minutes, up from 5 minutes with GNU awk and as
little as 3 minutes with GNU sed.  GNU awk comes ahead when listing
all the blobs in a Linux tarball, now with a long-wished feature:
printing before each blob the name of the file within the tarball that
contains it.

Future releases may be smarter in choosing suitable backend depending
on task and inputs.  For now, users of deblob-check should be aware of
the new flags: --use-python, --use-awk, --use-perl, and --use-sed, and
the corresponding environment variables PYTHON, AWK, PERL, and SED.

The lower memory footprint and CPU requirements for checking and
cleaning up individual files means it is again possible to clean up
Linux trees on the fly, which a number of users used to find valuable.

Over the next few days, we'll also roll out Linux-libre, generation 4,
for earlier Linux releases, fixing a few deblobbing errors in staging
drivers and catching a few more occurrences of non-Free blob names in
documentation and error messages.

== Request for comments

A number of our users have expressed legitimate dissatisfaction with a
consequence of the method we've used to stop the kernel from inducing
users to install non-Free firmware.  It is not our goal to prevent
users from loading or running non-Free firmware, but the only way we
thought of to avoid inducing users to run non-Free firmware had the
side effect of making it impossible to use the non-Free firmware just
by installing it.

In Linux, several drivers call request_firmware with a blob name.
This request is logged, including the blob name, and passed on to a
userland program, supposed to locate a firmware file with that name
and upload it to the kernel.  Given the logs, in addition to existing
and potential behavior of the userland program, this amounted to Linux
telling its user to install a specific non-Free program, which is
unacceptable.

Linux-libre releases since generation 2 replace the blob name with a
name that the firmware loader is unlikely to match, and that could be
recognized in userland to inform users about the lack of Free firmware
for some hardware component of the system.  We also reject whatever
response the firmware loader produces for such requests, to minimize
the risk of accidental matches and hardware damage.

We reasoned that anyone determined to use the firmware could still
build a module, or a complete kernel, that issues the request and uses
the response.  This possibility was considered too cumbersome by some.

Recently we came up with another way to achieve the goal of stopping
the kernel from inviting users into the trap of non-Free Software:
where Linux requests a firmware file that we know is non-Free, we
could anonymize the blob name with a unidirectional hash of its name
and a kernel build and/or session identifier, and issue a request for
a file named after the computed hash.

Given a suitable implementation of the userland firmware loader,
whatever pieces of firmware the user chose to install would still be
readily located and made available to the kernel.  However, because of
the unidirectional nature of the hash, a request for firmware that's
not installed won't steer users toward that firmware, because the hash
code won't immediately identify it.  Thus, if the user insists on
installing this firmware, Linux-libre will work with it, but it is
very unlikely anyone will install the firmware because of Linux-libre.

Join us at linux-libre@fsfla.org and let us know your suggestions,
other ways to address this issue, or your opinion about this plan and
whether it might be accepted upstream.  Feedback and help are welcome!

In the mean time, Be Free! with Linux 2.6.33-libre, and help us
reverse the growing dependency of Linux on non-Free firmware.

== About Linux-libre

Linux-libre is a project maintained by FSFLA, that releases cleaned-up
versions of Linux, suitable for use in distributions that comply with
the Free Software Distribution Guidelines published by the GNU
project, and by users who wish to run Free versions of Linux on their
GNU systems.  The project offers cleaning-up scripts and Freed
sources, binaries for some Free GNU/Linux-libre distributions, and
binaries to replace with minimal changes the kernels in non-Free
GNU/Linux distributions: Freed-ebian and Freed-ora, and artwork with
GNU and the Linux-libre mascot: Freedo, the clean, Free and
user-friendly light-blue penguin.  Learn more at our web site.
<br/>http://linux-libre.fsfla.org/
<br/>http://www.gnu.org/distros/

== About FSFLA

Free Software Foundation Latin America joined in 2005 the
international FSF network, previously formed by Free Software
Foundations in the United States, in Europe and in India.  These
sister organizations work in their corresponding geographies towards
promoting the same Free Software ideals and defending the same
freedoms for software users and developers, working locally but
cooperating globally.
<br/>http://www.fsfla.org/

----

Copyright 2010 FSFLA

Permission is granted to make and distribute verbatim copies of this
entire document without royalty, provided the copyright notice, the
document's official URL, and this permission notice are preserved.

Permission is also granted to make and distribute verbatim copies of
individual sections of this document worldwide without royalty
provided the copyright notice and the permission notice above are
preserved, and the document's official URL is preserved or replaced by
the individual section's official URL.

http://www.fsfla.org/anuncio/2010-03-linux-2.6.33-libre

]]>
Basta agregar os.setlocale("es_CL.UTF-8") en alguna línea del rc.lua, quizás después de modkey = "Mod4", pero NO en la primera línea :)

Obviamente puedes poner tu locale en vez de es_CL.UTF-8

Saludos!

]]>

Localización en awesome!

April 28, 2010 by Tomás Solar Castro   comments (0) - Visitas: 2712

locale, tip, awesome

Basta agregar os.setlocale("es_CL.UTF-8") en alguna línea del rc.lua, quizás después de modkey = "Mod4", pero NO en la primera línea :)

Obviamente puedes poner tu locale en vez de es_CL.UTF-8

Saludos!

]]>
Basta agregar os.setlocale("es_CL.UTF-8") en alguna línea del rc.lua, quizás después de modkey = "Mod4", pero NO en la primera línea :)

Obviamente puedes poner tu locale en vez de es_CL.UTF-8

Saludos!

]]>

Localización en awesome!

April 28, 2010 by Tomás Solar Castro   comments (0) - Visitas: 2712

locale, tip, awesome

Basta agregar os.setlocale("es_CL.UTF-8") en alguna línea del rc.lua, quizás después de modkey = "Mod4", pero NO en la primera línea :)

Obviamente puedes poner tu locale en vez de es_CL.UTF-8

Saludos!

]]>
Metiéndome un poco en awesome, pude solucionar un tema que me tenía quemado hace rato: cuando abría el menú de los clientes con el botón derecho sobre la "barra de tareas", al hacer click en algún ítem se focalizaba pero no se veía, es decir, seguía sin verse.

Para que se sobreponga por sobre las demás ventanas (que para mí es obvio, no sé por qué no estaba así...) agregué a /directorio/donde/está/awesome/awful/menu.lua en la línea 285 c:raise(), después de capi.client.focus = c

--- Build a popup menu with running clients and shows it.
-- @param menu Menu table, see new() function for more informations
-- @param keygrabber A boolean enabling or not the keyboard navigation.
-- @return The menu.
function clients(menu, keygrabber)
local cls = capi.client.get()
local cls_t = {}
for k, c in pairs(cls) do
cls_t[#cls_t + 1] = { util.escape(c.name) or "",
function ()
if not c:isvisible() then
tags.viewmore(c:tags(), c.screen)
end
capi.client.focus = c -- esta línea es la 284
c:raise() -- esta línea la agregué para ver la ventana que seleccioné en este menú :)
end,
c.icon }
end

if not menu then
menu = {}
end

menu.items = cls_t

local m = new(menu)
m:show(keygrabber)
return m
end


Ahora me funciona un poco mejor mi awesome, para mi gusto :)

Y lo publiqué en http://awesome.naquadah.org/wiki/Awful.menu#Tips

Lo que todavía no puedo solucionar, es que cuando aparece una ventana nueva, se me focaliza y se me pone encima de todas, por lo que me interrumpe (esto tampoco sé por qué funciona así, es muy molesto!)

 

Saludos!

]]>

Tip awesome (awful library)

April 27, 2010 by Tomás Solar Castro   comments (0) - Visitas: 2639

awesome, awful, tip

Metiéndome un poco en awesome, pude solucionar un tema que me tenía quemado hace rato: cuando abría el menú de los clientes con el botón derecho sobre la "barra de tareas", al hacer click en algún ítem se focalizaba pero no se veía, es decir, seguía sin verse.

Para que se sobreponga por sobre las demás ventanas (que para mí es obvio, no sé por qué no estaba así...) agregué a /directorio/donde/está/awesome/awful/menu.lua en la línea 285 c:raise(), después de capi.client.focus = c

--- Build a popup menu with running clients and shows it.
-- @param menu Menu table, see new() function for more informations
-- @param keygrabber A boolean enabling or not the keyboard navigation.
-- @return The menu.
function clients(menu, keygrabber)
local cls = capi.client.get()
local cls_t = {}
for k, c in pairs(cls) do
cls_t[#cls_t + 1] = { util.escape(c.name) or "",
function ()
if not c:isvisible() then
tags.viewmore(c:tags(), c.screen)
end
capi.client.focus = c -- esta línea es la 284
c:raise() -- esta línea la agregué para ver la ventana que seleccioné en este menú :)
end,
c.icon }
end

if not menu then
menu = {}
end

menu.items = cls_t

local m = new(menu)
m:show(keygrabber)
return m
end

Ahora me funciona un poco mejor mi awesome, para mi gusto :)

Y lo publiqué en http://awesome.naquadah.org/wiki/Awful.menu#Tips

Lo que todavía no puedo solucionar, es que cuando aparece una ventana nueva, se me focaliza y se me pone encima de todas, por lo que me interrumpe (esto tampoco sé por qué funciona así, es muy molesto!)

 

Saludos!

]]>
Metiéndome un poco en awesome, pude solucionar un tema que me tenía quemado hace rato: cuando abría el menú de los clientes con el botón derecho sobre la "barra de tareas", al hacer click en algún ítem se focalizaba pero no se veía, es decir, seguía sin verse.

Para que se sobreponga por sobre las demás ventanas (que para mí es obvio, no sé por qué no estaba así...) agregué a /directorio/donde/está/awesome/awful/menu.lua en la línea 285 c:raise(), después de capi.client.focus = c

--- Build a popup menu with running clients and shows it.
-- @param menu Menu table, see new() function for more informations
-- @param keygrabber A boolean enabling or not the keyboard navigation.
-- @return The menu.
function clients(menu, keygrabber)
local cls = capi.client.get()
local cls_t = {}
for k, c in pairs(cls) do
cls_t[#cls_t + 1] = { util.escape(c.name) or "",
function ()
if not c:isvisible() then
tags.viewmore(c:tags(), c.screen)
end
capi.client.focus = c -- esta línea es la 284
c:raise() -- esta línea la agregué para ver la ventana que seleccioné en este menú :)
end,
c.icon }
end

if not menu then
menu = {}
end

menu.items = cls_t

local m = new(menu)
m:show(keygrabber)
return m
end


Ahora me funciona un poco mejor mi awesome, para mi gusto :)

Y lo publiqué en http://awesome.naquadah.org/wiki/Awful.menu#Tips

Lo que todavía no puedo solucionar, es que cuando aparece una ventana nueva, se me focaliza y se me pone encima de todas, por lo que me interrumpe (esto tampoco sé por qué funciona así, es muy molesto!)

 

Saludos!

]]>

Tip awesome (awful library)

April 27, 2010 by Tomás Solar Castro   comments (0) - Visitas: 2639

awesome, awful, tip

Metiéndome un poco en awesome, pude solucionar un tema que me tenía quemado hace rato: cuando abría el menú de los clientes con el botón derecho sobre la "barra de tareas", al hacer click en algún ítem se focalizaba pero no se veía, es decir, seguía sin verse.

Para que se sobreponga por sobre las demás ventanas (que para mí es obvio, no sé por qué no estaba así...) agregué a /directorio/donde/está/awesome/awful/menu.lua en la línea 285 c:raise(), después de capi.client.focus = c

--- Build a popup menu with running clients and shows it.
-- @param menu Menu table, see new() function for more informations
-- @param keygrabber A boolean enabling or not the keyboard navigation.
-- @return The menu.
function clients(menu, keygrabber)
local cls = capi.client.get()
local cls_t = {}
for k, c in pairs(cls) do
cls_t[#cls_t + 1] = { util.escape(c.name) or "",
function ()
if not c:isvisible() then
tags.viewmore(c:tags(), c.screen)
end
capi.client.focus = c -- esta línea es la 284
c:raise() -- esta línea la agregué para ver la ventana que seleccioné en este menú :)
end,
c.icon }
end

if not menu then
menu = {}
end

menu.items = cls_t

local m = new(menu)
m:show(keygrabber)
return m
end

Ahora me funciona un poco mejor mi awesome, para mi gusto :)

Y lo publiqué en http://awesome.naquadah.org/wiki/Awful.menu#Tips

Lo que todavía no puedo solucionar, es que cuando aparece una ventana nueva, se me focaliza y se me pone encima de todas, por lo que me interrumpe (esto tampoco sé por qué funciona así, es muy molesto!)

 

Saludos!

]]>

Este año el FLISoL Santiago se llevará a cabo en la Universidad de
Santiago de Chile, el sábado 29 de mayo.

Están abiertas las plazas para inscribirse como charlista, con talleres,
stands para organizaciones/instituciones/empresas auspiciadoras y como
instalador@s.

Los formularios de inscripción están en las siguientes direcciones:

Postulación de Charlas
http://santiago.flisol.cl/como-participar/postulacion-de-charlas/

Postulación de Talleres
http://santiago.flisol.cl/como-participar/postulacion-de-talleres/

Postulación de stands
http://santiago.flisol.cl/como-participar/postulacion-de-stands/

Inscripción instaladores
http://santiago.flisol.cl/como-participar/inscripcion-instaladores/

¡L@s invitamos a ser parte de este único evento latinoamericano!

Nota: para las charlas y talleres hay plazo de postulación hasta el 30
de abril.

En dudas y consultas escribir a coordinacion@santiago.flisol.cl .

¡Saludos!

]]>

Abiertas las postulaciones para FLISOL Santiago 2010

April 13, 2010 by Tomás Solar Castro   comments (0) - Visitas: 2599

flisol, santiago, 2010, chile

Este año el FLISoL Santiago se llevará a cabo en la Universidad de
Santiago de Chile, el sábado 29 de mayo.

Están abiertas las plazas para inscribirse como charlista, con talleres,
stands para organizaciones/instituciones/empresas auspiciadoras y como
instalador@s.

Los formularios de inscripción están en las siguientes direcciones:

Postulación de Charlas
http://santiago.flisol.cl/como-participar/postulacion-de-charlas/

Postulación de Talleres
http://santiago.flisol.cl/como-participar/postulacion-de-talleres/

Postulación de stands
http://santiago.flisol.cl/como-participar/postulacion-de-stands/

Inscripción instaladores
http://santiago.flisol.cl/como-participar/inscripcion-instaladores/

¡L@s invitamos a ser parte de este único evento latinoamericano!

Nota: para las charlas y talleres hay plazo de postulación hasta el 30
de abril.

En dudas y consultas escribir a coordinacion@santiago.flisol.cl .

¡Saludos!

]]>

Este año el FLISoL Santiago se llevará a cabo en la Universidad de
Santiago de Chile, el sábado 29 de mayo.

Están abiertas las plazas para inscribirse como charlista, con talleres,
stands para organizaciones/instituciones/empresas auspiciadoras y como
instalador@s.

Los formularios de inscripción están en las siguientes direcciones:

Postulación de Charlas
http://santiago.flisol.cl/como-participar/postulacion-de-charlas/

Postulación de Talleres
http://santiago.flisol.cl/como-participar/postulacion-de-talleres/

Postulación de stands
http://santiago.flisol.cl/como-participar/postulacion-de-stands/

Inscripción instaladores
http://santiago.flisol.cl/como-participar/inscripcion-instaladores/

¡L@s invitamos a ser parte de este único evento latinoamericano!

Nota: para las charlas y talleres hay plazo de postulación hasta el 30
de abril.

En dudas y consultas escribir a coordinacion@santiago.flisol.cl .

¡Saludos!

]]>

Abiertas las postulaciones para FLISOL Santiago 2010

April 13, 2010 by Tomás Solar Castro   comments (0) - Visitas: 2599

flisol, santiago, 2010, chile

Este año el FLISoL Santiago se llevará a cabo en la Universidad de
Santiago de Chile, el sábado 29 de mayo.

Están abiertas las plazas para inscribirse como charlista, con talleres,
stands para organizaciones/instituciones/empresas auspiciadoras y como
instalador@s.

Los formularios de inscripción están en las siguientes direcciones:

Postulación de Charlas
http://santiago.flisol.cl/como-participar/postulacion-de-charlas/

Postulación de Talleres
http://santiago.flisol.cl/como-participar/postulacion-de-talleres/

Postulación de stands
http://santiago.flisol.cl/como-participar/postulacion-de-stands/

Inscripción instaladores
http://santiago.flisol.cl/como-participar/inscripcion-instaladores/

¡L@s invitamos a ser parte de este único evento latinoamericano!

Nota: para las charlas y talleres hay plazo de postulación hasta el 30
de abril.

En dudas y consultas escribir a coordinacion@santiago.flisol.cl .

¡Saludos!

]]>
Para conectarme a IRC con ERC, uso lo siguiente en mi .emacs (además de lo que puse en las publicaciones anteriores):

;; Load ERC
(require 'erc)
(erc-spelling-mode 1)
;; Load authentication info from an external source.  Put sensitive
;; passwords and the like in here.
(load "~/.emacs.d/erc-auth")
 
;; Join channels whenever connecting to Freenode.
(setq erc-autojoin-channels-alist '(("freenode.net" "#parabola" "#fsfla" )))
;; Interpret mIRC-style color commands in IRC chats
(setq erc-interpret-mirc-color t)
     
;; Kill buffers for channels after /part
(setq erc-kill-buffer-on-part t)
;; Kill buffers for private queries after quitting the server
(setq erc-kill-queries-on-quit t)
;; Kill buffers for server messages after quitting the server
(setq erc-kill-server-buffer-on-quit t)

Y en el archivo ~/.emacs.d/erc-auth tengo:

;; C-c e f.  FREENODE
(global-set-key "\C-cef" (lambda () (interactive)
           (erc :server "irc.freenode.net" :port "6667"
            :full-name "tsolar" :nick "tsolar"
            :password "mipwd")
           (erc :server "irc.radiognu.org" :port "6667"
            :full-name "tsolar" :nick "tsolar"
            :password "mipwd")))

Obviamente, hay que reemplazar "mipwd" por la contraseña propia :)

Luego de agregar estas configs, basta con hacer C-c e f y cargará los servers y canales que hayamos puesto :)

Happy Hacking!

]]>

Mi config para ERC

April 7, 2010 by Tomás Solar Castro   comments (0) - Visitas: 2483

erc, emacs

Para conectarme a IRC con ERC, uso lo siguiente en mi .emacs (además de lo que puse en las publicaciones anteriores):

;; Load ERC
(require 'erc)
(erc-spelling-mode 1)
;; Load authentication info from an external source.  Put sensitive
;; passwords and the like in here.
(load "~/.emacs.d/erc-auth")
 
;; Join channels whenever connecting to Freenode.
(setq erc-autojoin-channels-alist '(("freenode.net" "#parabola" "#fsfla" )))
;; Interpret mIRC-style color commands in IRC chats
(setq erc-interpret-mirc-color t)
     
;; Kill buffers for channels after /part
(setq erc-kill-buffer-on-part t)
;; Kill buffers for private queries after quitting the server
(setq erc-kill-queries-on-quit t)
;; Kill buffers for server messages after quitting the server
(setq erc-kill-server-buffer-on-quit t)

Y en el archivo ~/.emacs.d/erc-auth tengo:

;; C-c e f.  FREENODE
(global-set-key "\C-cef" (lambda () (interactive)
           (erc :server "irc.freenode.net" :port "6667"
            :full-name "tsolar" :nick "tsolar"
            :password "mipwd")
           (erc :server "irc.radiognu.org" :port "6667"
            :full-name "tsolar" :nick "tsolar"
            :password "mipwd")))

Obviamente, hay que reemplazar "mipwd" por la contraseña propia :)

Luego de agregar estas configs, basta con hacer C-c e f y cargará los servers y canales que hayamos puesto :)

Happy Hacking!

]]>
Para conectarme a IRC con ERC, uso lo siguiente en mi .emacs (además de lo que puse en las publicaciones anteriores):

;; Load ERC
(require 'erc)
(erc-spelling-mode 1)
;; Load authentication info from an external source.  Put sensitive
;; passwords and the like in here.
(load "~/.emacs.d/erc-auth")
 
;; Join channels whenever connecting to Freenode.
(setq erc-autojoin-channels-alist '(("freenode.net" "#parabola" "#fsfla" )))
;; Interpret mIRC-style color commands in IRC chats
(setq erc-interpret-mirc-color t)
     
;; Kill buffers for channels after /part
(setq erc-kill-buffer-on-part t)
;; Kill buffers for private queries after quitting the server
(setq erc-kill-queries-on-quit t)
;; Kill buffers for server messages after quitting the server
(setq erc-kill-server-buffer-on-quit t)

Y en el archivo ~/.emacs.d/erc-auth tengo:

;; C-c e f.  FREENODE
(global-set-key "\C-cef" (lambda () (interactive)
           (erc :server "irc.freenode.net" :port "6667"
            :full-name "tsolar" :nick "tsolar"
            :password "mipwd")
           (erc :server "irc.radiognu.org" :port "6667"
            :full-name "tsolar" :nick "tsolar"
            :password "mipwd")))

Obviamente, hay que reemplazar "mipwd" por la contraseña propia :)

Luego de agregar estas configs, basta con hacer C-c e f y cargará los servers y canales que hayamos puesto :)

Happy Hacking!

]]>

Mi config para ERC

April 7, 2010 by Tomás Solar Castro   comments (0) - Visitas: 2483

erc, emacs

Para conectarme a IRC con ERC, uso lo siguiente en mi .emacs (además de lo que puse en las publicaciones anteriores):

;; Load ERC
(require 'erc)
(erc-spelling-mode 1)
;; Load authentication info from an external source.  Put sensitive
;; passwords and the like in here.
(load "~/.emacs.d/erc-auth")
 
;; Join channels whenever connecting to Freenode.
(setq erc-autojoin-channels-alist '(("freenode.net" "#parabola" "#fsfla" )))
;; Interpret mIRC-style color commands in IRC chats
(setq erc-interpret-mirc-color t)
     
;; Kill buffers for channels after /part
(setq erc-kill-buffer-on-part t)
;; Kill buffers for private queries after quitting the server
(setq erc-kill-queries-on-quit t)
;; Kill buffers for server messages after quitting the server
(setq erc-kill-server-buffer-on-quit t)

Y en el archivo ~/.emacs.d/erc-auth tengo:

;; C-c e f.  FREENODE
(global-set-key "\C-cef" (lambda () (interactive)
           (erc :server "irc.freenode.net" :port "6667"
            :full-name "tsolar" :nick "tsolar"
            :password "mipwd")
           (erc :server "irc.radiognu.org" :port "6667"
            :full-name "tsolar" :nick "tsolar"
            :password "mipwd")))

Obviamente, hay que reemplazar "mipwd" por la contraseña propia :)

Luego de agregar estas configs, basta con hacer C-c e f y cargará los servers y canales que hayamos puesto :)

Happy Hacking!

]]>

Marcas de tiempo en ERC

April 7, 2010 by Tomás Solar Castro   comments (1) - Visitas: 2439

erc, timestamps, emacs

Las marcas de tiempo, o timestamps, en ERC, por defecto son algo molestas o confusas, así que me tomé la libertad de modificar un poco lo que sale en el wiki de emacs y puse lo siguiente:

;; timestamps                                                                                    
(make-variable-buffer-local
 (defvar erc-last-datestamp nil))

(defun ks-timestamp (string)
  (erc-insert-timestamp-left string)
  (let ((datestamp (erc-format-timestamp (current-time) erc-datestamp-format)))
    (unless (string= datestamp erc-last-datestamp)
      (erc-insert-timestamp-left datestamp)
      (setq erc-last-datestamp datestamp))))
   
(setq erc-timestamp-only-if-changed-flag t
      erc-timestamp-format "%H:%M:%S "
      erc-datestamp-format "=== [%Y-%m-%d %a] ===\n" ; mandatory ascii art                         
      erc-fill-prefix      "         "
      erc-insert-timestamp-function 'ks-timestamp)

y ahora se ve así:

 

Happy hacking!

Me gusta mucho. Trato de usarlo.

Gracias