From 2d7ea3e25e4f23013d1bdda23328acf4d10617df Mon Sep 17 00:00:00 2001 From: Philippe Brochard Date: Fri, 5 Mar 2010 23:24:50 +0100 Subject: [PATCH] contrib/reboot-halt.lisp: Do nothing on the first menu entry --- TODO | 7 +++++++ contrib/reboot-halt.lisp | 12 +++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/TODO b/TODO index 40d913d..0a5e78d 100644 --- a/TODO +++ b/TODO @@ -9,6 +9,13 @@ Should handle these soon. - Remote access to the clfswm REPL [Philippe] this can be done with net.lisp or via xprop (ie the Stumpwm way). + Protocol: + - start-server => create a new file /tmp/clfswm-server-port with right (rw-------) + and place a key which change on each connection. + - client must read this file and send the key before using the command line. + - server change its key when the connection is done. + - add a minimal cript in the protocol (for example a rotN) with N coded in the key. + MAYBE diff --git a/contrib/reboot-halt.lisp b/contrib/reboot-halt.lisp index a4c3058..086c3e6 100644 --- a/contrib/reboot-halt.lisp +++ b/contrib/reboot-halt.lisp @@ -40,12 +40,20 @@ (defun do-with-terminal (command) (do-shell (format nil "xterm -e '~A'" command))) - ;;(do-shell (format nil "xterm -e 'echo ~A; sleep 3'" command))) ;; test +;;(do-shell (format nil "xterm -e 'echo ~A; sleep 3'" command))) ;; test + +(defun do-nothing () + "Do nothing" + ()) (defun do-suspend () "Suspend the computer to RAM" (do-with-terminal "sudo pm-suspend")) +(defun do-hibernate () + "Suspend the computer to DISK" + (do-with-terminal "sudo pm-hibernate")) + (defun do-reboot () "Reboot the computer" (do-with-terminal "sudo reboot")) @@ -56,7 +64,9 @@ (unless (find-menu 'reboot-halt-menu) (add-sub-menu 'clfswm-menu "Pause" 'reboot-halt-menu "Suspend/Reboot/Halt menu") + (add-menu-key 'reboot-halt-menu "-" 'do-nothing) (add-menu-key 'reboot-halt-menu "s" 'do-suspend) + (add-menu-key 'reboot-halt-menu "d" 'do-hibernate) (add-menu-key 'reboot-halt-menu "r" 'do-reboot) (add-menu-key 'reboot-halt-menu "h" 'do-halt)) -- 2.11.4.GIT