stumpwm-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [STUMP] /proc/acpi/thermal_zone/ has gone in Linux kernel 2.6.37


From: Vitaly Mayatskikh
Subject: Re: [STUMP] /proc/acpi/thermal_zone/ has gone in Linux kernel 2.6.37
Date: Sun, 13 Mar 2011 09:46:15 -0400
User-agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/23.3 Mule/6.0 (HANACHIRUSATO)

At Fri, 11 Mar 2011 22:27:01 +0800, Desmond O. Chang wrote:

> > After upgrade of my Archlinux to kernel 2.6.37 I noticed that
> > /proc/acpi/thermal_zone/ is no longer exist. This patch hopefully
> > fixes it, but I don't have old kernel with /proc/acpi/thermal_zone/
> > enabled. StumpWM fellows, who still have this directory, please, test
> > the patch.
> 
> Your patch doesn't work in clisp on my laptop.

Thanks for report! Can you try this patch?

diff --git a/contrib/cpu.lisp b/contrib/cpu.lisp
index 4fb60b2..b5e6842 100644
--- a/contrib/cpu.lisp
+++ b/contrib/cpu.lisp
@@ -128,7 +128,13 @@ utilization."
 
 (defvar *acpi-thermal-zone*
   (let ((proc-dir (list-directory #P"/proc/acpi/thermal_zone/"))
-        (sys-dir (list-directory #P"/sys/class/thermal/")))
+        (sys-dir (sort
+                  (remove-if-not
+                   (lambda (x)
+                     (when (cl-ppcre:scan "^.*/thermal_zone\\d+/" (namestring 
x))
+                       x))
+                   (list-directory #P"/sys/class/thermal/"))
+                  #'string< :key #'namestring)))
     (cond
       (proc-dir
        (cons :procfs
@@ -136,7 +142,7 @@ utilization."
                             :name "temperature")))
       (sys-dir
        (cons :sysfs
-             (make-pathname :directory (pathname-directory (car (last 
sys-dir)))
+             (make-pathname :directory (pathname-directory (first sys-dir))
                             :name "temp"))))))
 
 (defun fmt-cpu-temp (ml)
diff --git a/contrib/mpd.lisp b/contrib/mpd.lisp
index 3bbb8ac..335a459 100644
--- a/contrib/mpd.lisp
+++ b/contrib/mpd.lisp
@@ -812,6 +812,14 @@ Passed an argument of zero and if crossfade is on, toggles 
crossfade off."
 (defcommand mpd-search-genre (what) ((:rest "Search genre: "))
   (mpd-send-command (format nil "search genre \"~a\"" what)))
 
+;;seek command
+(defcommand mpd-seek-at (percent)
+  ((:rest "Seek to a given position: "))
+  (mpd-format-command "seekid ~d ~d"
+     (parse-integer (assoc-value :id *mpd-current-song*))
+     (round (* 0.01 (parse-integer percent)
+              (parse-integer (assoc-value :time *mpd-current-song*))))))
+
 (defvar *mpd-search-map* nil)
 (defvar *mpd-browse-map* nil)
 (defvar *mpd-add-map* nil)
@@ -865,4 +873,9 @@ Passed an argument of zero and if crossfade is on, toggles 
crossfade off."
              (kbd "b") '*mpd-browse-map*
              (kbd "A") '*mpd-add-map*)
 
+
+(loop for i from 0 below 10 do
+     (define-key *mpd-map* (kbd (format nil "~d" i))
+       (format nil "mpd-seek-at ~d" (* i 10))))
+
 ;;; End of file

-- 
wbr, Vitaly



reply via email to

[Prev in Thread] Current Thread [Next in Thread]