On Wed, 2 Oct 2024 10:18:59 -0500
izzy Meyer <izder...@disroot.org> (by way of izzy Meyer
<izder...@disroot.org>) wrote:

> Accidentally didn't include ports@ in the To: line. Re-sending.
> 
> On Wed, 02 Oct 2024 07:12:31 -0400
> David Anthony <d...@silentsystems.org> wrote:
> 
> > Thank you for the suggestions, misc. 
> > 
> > xset -dpms did not seem to work
> > xset s noblank seems to partially work. Instead of my screen going
> > black - it now goes white-greyish
> > 
> > Nonetheless the screen is now covered and whichever applications I
> > was using are no longer visible due to the screen being blanked out
> > Does anyone have further suggestions?
> >  
> 
> 
> Let me just copy-paste the macro I wrote in common lisp for my StumpWM
> Config. I think you are looking for a couple things:
> 
> Try these:
> 
> $ xset s noblank (disables screen blanking)
> $ xset s off (disables automatic screen turnoff)
> $ xset -dpms (disables automatic screen power saving)
> 
> This is the toggle macro system I hacked together in common lisp. IDK
> how much lisp you know, so might be useful for reference for CWM? IDK
> ymmv.
> 
> (defun make-toggle-function (command-pair &optional (inverse nil))
>   "Returns a function that toggles between executing the first and
> second command in COMMAND-PAIR. If INVERSE is true, the initial state
> is considered 'on'. The command is executed in a separate thread."
>   (let ((state inverse))  ; Initially 'on' if inverse is true,
> otherwise 'off' (lambda ()
>       (setf state (not state))
>       (let ((command (if state (first command-pair) (second
> command-pair)))) (bt:make-thread
>          (lambda ()
>            (run-shell-command-safely command))
>          :name (format nil "Toggle-Thread-~A" command))
>         state))))
> 
> (defmacro define-toggle-command (name commands inverse description)
>   "Defines a StumpWM command that toggles a set of commands and
> displays the current state." (let ((commands-var (gensym
> "COMMANDS-"))) `(progn
>        (defparameter ,commands-var ',commands)
>        (let ((toggle-functions (mapcar (lambda (pair)
> (make-toggle-function pair ,inverse)) ,commands-var)))
>          (defcommand ,name () ()
>            ,description
>            (let ((new-states (mapcar #'funcall toggle-functions)))
>              (message ,(format nil "~a mode: ~~a" (string-capitalize
> (symbol-name name))) (if (some #'identity new-states) "Enabled"
> "Disabled"))))))))
> 
> ;;;
> ;; The commands
> ;;;
> 
> ;; toggles
> (define-toggle-command toggle-powersave
>     (("xset s on" "xset s off")
>      ("xset s blank" "xset s noblank")
>      ("xset +dpms" "xset -dpms"))
>     t
>     "Toggle power-saving mode and display the current state.")
> 
> 
> Peace-
> 

Ignore this, wrong list. Sorry

-- 
-iz (they/them)

> i like to say mundane things, 
> there are too many uninteresting things 
> that go unnoticed.

izder456 (dot) neocities (dot) org

Attachment: pgpBJQGcpT4H8.pgp
Description: OpenPGP digital signature

Reply via email to