theme.lisp 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. (in-package :stumpwm)
  2. ;;;
  3. ;;; Background
  4. ;;;
  5. (defcommand xplanet () ()
  6. (run-shell-command "xplanet -center '+960+540' -fov 1"))
  7. (defcommand xplanet-file () ()
  8. (run-shell-command "xplanet -num_times 1 -output /tmp/xplanet.png; feh --bg-center /tmp/xplanet.png"))
  9. (defcommand set-background-dark () ()
  10. (run-shell-command "xsetroot -solid black"))
  11. (defcommand wallpaper () ()
  12. (run-shell-command (format nil "sxiv ~a/archive/src/wallpapers"
  13. (getenv "HOME"))))
  14. (defcommand refcard-stumpwm () ()
  15. (run-shell-command "bash -ic 'stumpwm-refcard wallpaper'"))
  16. ;;;
  17. ;;; Wrappers
  18. ;;;
  19. (set-msg-border-width 4)
  20. (setf *ignore-wm-inc-hints* t)
  21. (setf *window-border-style* :thin)
  22. (setf *window-format* "%m%n%s %c %50t")
  23. (setf *suppress-window-placement-indicator* t)
  24. (setf *float-window-border* 3)
  25. (setf *float-window-title-height* 3)
  26. (defparameter dark-theme nil)
  27. (defcommand toggle-theme () ()
  28. (if dark-theme
  29. (progn (setq *mode-line-border-color* "#d3d3d3"
  30. *mode-line-foreground-color* "#000000"
  31. *mode-line-background-color* "#d3d3d3")
  32. (set-win-bg-color "#000000")
  33. (set-unfocus-color "#000000")
  34. (set-fg-color "#000000")
  35. (set-bg-color "#d3d3d3")
  36. (set-focus-color "#66cdaa")
  37. (set-border-color "#66cdaa")
  38. (set-float-focus-color "#66cdaa")
  39. (sb-posix:setenv "GTK_THEME" "Adwaita:light" 1)
  40. (setq dark-theme nil))
  41. (progn (setq *mode-line-border-color* "#000000"
  42. *mode-line-foreground-color* "#ffffff"
  43. *mode-line-background-color* "#000000")
  44. (set-win-bg-color "#000000")
  45. (set-unfocus-color "#000000")
  46. (set-fg-color "#ffffff")
  47. (set-bg-color "#000000")
  48. (set-focus-color "#0a420a")
  49. (set-border-color "#0a420a")
  50. (set-float-focus-color "#0a420a")
  51. (sb-posix:setenv "GTK_THEME" "Adwaita:dark" 1)
  52. (setq dark-theme t))))
  53. (toggle-theme)
  54. (setq *suppress-frame-indicator* t)
  55. (defcommand current-theme () ()
  56. (if dark-theme "dark" "light"))
  57. (add-hook *focus-frame-hook*
  58. (lambda (current-frame last-frame)
  59. (redisplay)))
  60. ;;;
  61. ;;; Windows
  62. ;;;
  63. (defcommand toggle-window-borders () ()
  64. (if (or (= *maxsize-border-width* 3)
  65. (= *message-window-y-padding* 3)
  66. (= *normal-border-width* 3)
  67. (= *transient-border-width* 3))
  68. (progn (setf *maxsize-border-width* 0)
  69. (setf *message-window-y-padding* 0)
  70. (setf *normal-border-width* 0)
  71. (setf *transient-border-width* 0)
  72. (setq *suppress-frame-indicator* nil)
  73. (setf *float-window-border* 0)
  74. (setf *float-window-title-height* 0))
  75. (progn (setf *maxsize-border-width* 3)
  76. (setf *message-window-y-padding* 3)
  77. (setf *normal-border-width* 3)
  78. (setf *transient-border-width* 3)
  79. (setq *suppress-frame-indicator* t)
  80. (setf *float-window-border* 3)
  81. (setf *float-window-title-height* 3))))
  82. ;;;
  83. ;;; Fonts
  84. ;;;
  85. (require :ttf-fonts)
  86. (setf xft:*font-dirs* '("/run/current-system/profile/share/fonts/"))
  87. (setf clx-truetype:+font-cache-filename+ (concat (getenv "HOME") "/.fonts/font-cache.sexp"))
  88. (xft:cache-fonts)
  89. ;; Thanks: https://github.com/jamesmccabe/stumpwm-demo-config/blob/master/init.lisp
  90. (set-font (list (make-instance 'xft:font
  91. :family "DejaVu Sans Mono"
  92. :subfamily "Book"
  93. :size 11)
  94. (make-instance 'xft:font
  95. :family "FontAwesome"
  96. :subfamily "Regular"
  97. :size 11)))
  98. ;; (set-font "9x15bold")
  99. ;;;
  100. ;;; GTK
  101. ;;;
  102. (sb-posix:setenv "GTK_THEME" "Adwaita:dark" 1)
  103. (defcommand xcompmgr () ()
  104. (run-shell-command "xcompmgr -c -C -t-5 -l-5 -r10 -o.55"))
  105. (defcommand picom () ()
  106. (run-shell-command "picom -cCGfF -o 0.38 -O 200 -I 200 -t 0 -l 0 -r 3 -D2 -m 0.88"))