init-sunrise.el 1004 B

1234567891011121314151617181920212223242526272829303132
  1. (use-package sunrise-commander
  2. :defer t
  3. :config
  4. (setq sr-cursor-follows-mouse nil)
  5. ;; I want to be able to open a file on mouse click right?
  6. ;;(define-key sr-mode-map [mouse-1] nil)
  7. ;; stop point from following mouse movements
  8. (define-key sr-mode-map [mouse-movement] nil)
  9. ;;tweak faces for paths
  10. (set-face-attribute 'sr-active-path-face nil
  11. :background "black")
  12. (set-face-attribute 'sr-passive-path-face nil
  13. :background "black"))
  14. ;;advise sunrise to save frame arrangement
  15. ;;requires frame-cmds packagee
  16. (defun bjm-sc-save-frame ()
  17. "Save frame configuration and then maximise frame for sunrise commander."
  18. (save-frame-config)
  19. (maximize-frame))
  20. (advice-add 'sunrise :before #'bjm-sc-save-frame)
  21. (defun bjm-sc-restore-frame ()
  22. "Restore frame configuration saved prior to launching sunrise commander."
  23. (interactive)
  24. (jump-to-frame-config-register))
  25. (advice-add 'sr-quit :after #'bjm-sc-restore-frame)
  26. (provide 'init-sunrise)