diff options
author | jao <jao@gnu.org> | 2022-09-23 01:01:41 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2022-09-23 01:04:05 +0100 |
commit | 98a50e654992a3797f3b433747cc5644b696c544 (patch) | |
tree | d08e1ace3b086a0438597ac6cedf3fdea6c8003e | |
parent | 2f261498cd5abb2e0b7b5add67a22cc65194c2aa (diff) | |
download | elibs-98a50e654992a3797f3b433747cc5644b696c544.tar.gz elibs-98a50e654992a3797f3b433747cc5644b696c544.tar.bz2 |
moving code around, weely
-rw-r--r-- | init.el | 69 |
1 files changed, 32 insertions, 37 deletions
@@ -347,6 +347,37 @@ 'vertical-border (make-glyph-code ?│))) +;;;; transparency +(defvar jao-transparent-only-bg (> emacs-major-version 28)) + +(defvar jao-frames-default-alpha + (cond ((eq window-system 'pgtk) 85) + (jao-transparent-only-bg 88) + (t 85))) + +(defvar jao-transparent-frame (< jao-frames-default-alpha 100)) + +(defun jao-alpha-parameters (&optional level) + (let ((level (or level jao-frames-default-alpha))) + (if jao-transparent-only-bg + `((alpha-background . ,level) (alpha)) + `((alpha . ,(cons level level)) (alpha-background))))) + +(defun jao-set-transparency (&optional level all) + (interactive "nOpacity (0-100): ") + (let ((level (or level jao-frames-default-alpha))) + (setq jao-transparent-frame (< level 100)) + (if all + (modify-all-frames-parameters (jao-alpha-parameters level)) + (modify-frame-parameters nil (jao-alpha-parameters level))))) + +(defun jao-toggle-transparency (&optional all) + (interactive "P") + (let ((level (if jao-transparent-frame 100 jao-frames-default-alpha))) + (jao-set-transparency level all))) + +(jao-set-transparency) + ;;;; themes (defun jao-colors-scheme-dark-p () (equal "dark" (getenv "JAO_COLOR_SCHEME"))) @@ -375,9 +406,7 @@ (load-theme theme t) (modify-all-frames-parameters `((font . ,jao-themes-default-face))))) -(unless (eq window-system 'pgtk) (jao-themes-setup)) - -(global-font-lock-mode 1) +(jao-themes-setup) ;;; Help system ;;;; Help buffers and shortcuts @@ -3016,35 +3045,6 @@ (global-set-key (kbd "s-m") #'jao-transient-media) ;;; Graphical window system -;;;; transparency -(defvar jao-transparent-only-bg (> emacs-major-version 28)) - -(defvar jao-frames-default-alpha - (cond ((eq window-system 'pgtk) 80) - (jao-transparent-only-bg 88) - (t 85))) - -(defvar jao-transparent-frame (< jao-frames-default-alpha 100)) - -(defun jao-alpha-parameters (&optional level) - (let ((level (or level jao-frames-default-alpha))) - (if jao-transparent-only-bg - `((alpha-background . ,level) (alpha)) - `((alpha . ,(cons level level)) (alpha-background))))) - -(defun jao-set-transparency (&optional level all) - (interactive "nOpacity (0-100): ") - (let ((level (or level jao-frames-default-alpha))) - (setq jao-transparent-frame (< level 100)) - (if all - (modify-all-frames-parameters (jao-alpha-parameters level)) - (modify-frame-parameters nil (jao-alpha-parameters level))))) - -(defun jao-toggle-transparency (&optional all) - (interactive "P") - (let ((level (if jao-transparent-frame 100 jao-frames-default-alpha))) - (jao-set-transparency level all))) - ;;;; x11 utils (defun jao-xdotool (arg-or-wait &rest args) (apply 'jao-shell-exec* @@ -3074,8 +3074,6 @@ (setq jao-exwm-enabled t) (display-time-mode -1) (exwm-enable) - (setq jao-frames-default-alpha 88) - (jao-set-transparency) (x-change-window-property "_XMONAD_TRAYPAD" "" nil nil nil nil 0) (if (> emacs-major-version 28) (xmobar-mode 1) @@ -3091,7 +3089,6 @@ (setq jao-wallpaper-random-wake t) (setq jao-mode-line-in-minibuffer nil) (display-battery-mode -1) - (jao-set-transparency) (jao-trisect) (message "Welcome to xmonad")) @@ -3105,8 +3102,6 @@ (defun jao-wayland-enable () (interactive) (defalias 'x-change-window-property #'ignore) - (when (eq 'pgtk window-system) (jao-set-transparency 85)) - (jao-themes-setup) (jao-trisect) (message "Welcome to wayland")) |