settings.lisp 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. ;;; settings.lisp --- General settings: variables, hooks, ...
  2. ;; Copyright © 2013–2017 Alex Kost <alezost@gmail.com>
  3. ;; This program is free software; you can redistribute it and/or modify
  4. ;; it under the terms of the GNU General Public License as published by
  5. ;; the Free Software Foundation, either version 3 of the License, or
  6. ;; (at your option) any later version.
  7. ;;
  8. ;; This program is distributed in the hope that it will be useful,
  9. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. ;; GNU General Public License for more details.
  12. ;;
  13. ;; You should have received a copy of the GNU General Public License
  14. ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. ;;; Code:
  16. (in-package :stumpwm)
  17. ;;; Windows, frames and groups
  18. ;; Name the default group.
  19. (setf (group-name (car (screen-groups (current-screen))))
  20. "tile1")
  21. (gnewbg "tile2")
  22. (gnewbg-float "float")
  23. (defvar al/frames1 nil)
  24. (defun al/make-frames1 ()
  25. "Return a frame layout (list of frames) for `al/frames1'."
  26. (let* ((screen (current-screen))
  27. (s-width (screen-width screen))
  28. (s-height (screen-height screen))
  29. (f0-width (/ s-width 2))
  30. (f0-height (* 3 (/ f0-width 4)))
  31. (f0 (make-frame
  32. :number 0
  33. :x 0 :y 0
  34. :width f0-width
  35. :height f0-height))
  36. (f1 (make-frame
  37. :number 1
  38. :x 0 :y f0-height
  39. :width f0-width
  40. :height (- s-height f0-height)))
  41. (f2 (make-frame
  42. :number 2
  43. :x f0-width :y 0
  44. :width (- s-width f0-width)
  45. :height s-height)))
  46. (list f0 f2 f1)))
  47. (defcommand al/frames1 (&optional (populatep t)) ()
  48. "Show layout of 3 frames with one frame having 4/3 ratio."
  49. (al/set-frames (or al/frames1
  50. (setf al/frames1 (al/make-frames1)))
  51. populatep))
  52. ;;; Keyboard layouts
  53. (layout-set 0)
  54. (layout-enable-per-window)
  55. ;;; Misc
  56. (setf *top-level-error-action* :message)
  57. ;; Original `send-fake-key' sends only "press" event.
  58. (setf (symbol-function 'send-fake-key)
  59. (lambda (win key) (al/send-key key win)))
  60. (push '(:class "Conkeror") *deny-raise-request*)
  61. (push '(:class "libreoffice-writer") *deny-raise-request*)
  62. (al/banish-pointer)
  63. ;; (setf *debug-level* 10) ; show all debug info
  64. ;;; settings.lisp ends here