vnc.lisp 778 B

1234567891011121314151617181920212223
  1. (in-package :stumpwm)
  2. (defun vnc-command (port &key (host "127.0.0.1") (view-only nil))
  3. (join `("vncviewer"
  4. "-AutoSelect=0"
  5. "-PreferredEncoding=Raw"
  6. "-FullColor=1"
  7. "-NoJPEG=1"
  8. "-CompressLevel=0"
  9. "-passwd" ,(concat (getenv "HOME") "/.vnc/passwd")
  10. ,@(if view-only '("-ViewOnly") '())
  11. ,(concat host ":" (write-to-string port)))))
  12. (defcommand vnc (display) ((:string "display: "))
  13. (run-shell-command (vnc-command (parse-integer display))))
  14. (defcommand vnc-readonly (display) ((:string "display: "))
  15. (run-shell-command (vnc-command (parse-integer display)
  16. :view-only t)))
  17. (defcommand vnc-magnolia () ()
  18. (run-shell-command "exec vncviewer localhost:59555"))