From pbrochard at common-lisp.net Fri Mar 5 21:27:11 2010 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Fri, 05 Mar 2010 16:27:11 -0500 Subject: [clfswm-cvs] r273 - in clfswm: . contrib Message-ID: Author: pbrochard Date: Fri Mar 5 16:27:11 2010 New Revision: 273 Log: contrib/reboot-halt.lisp: Do nothing on the first menu entry Modified: clfswm/TODO clfswm/contrib/reboot-halt.lisp Modified: clfswm/TODO ============================================================================== --- clfswm/TODO (original) +++ clfswm/TODO Fri Mar 5 16:27:11 2010 @@ -9,6 +9,13 @@ - 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 Modified: clfswm/contrib/reboot-halt.lisp ============================================================================== --- clfswm/contrib/reboot-halt.lisp (original) +++ clfswm/contrib/reboot-halt.lisp Fri Mar 5 16:27:11 2010 @@ -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))