summaryrefslogtreecommitdiff
path: root/.config/emacs/modules/bd--buffers.el
diff options
context:
space:
mode:
Diffstat (limited to '.config/emacs/modules/bd--buffers.el')
-rw-r--r--.config/emacs/modules/bd--buffers.el60
1 files changed, 43 insertions, 17 deletions
diff --git a/.config/emacs/modules/bd--buffers.el b/.config/emacs/modules/bd--buffers.el
index 45a161f..a8e3cbe 100644
--- a/.config/emacs/modules/bd--buffers.el
+++ b/.config/emacs/modules/bd--buffers.el
@@ -3,22 +3,7 @@
;;; Code:
-(defun split-and-follow ()
- (interactive)
- (delete-other-windows)
- (split-window-horizontally)
- (split-window-horizontally)
- (balance-windows)
- (other-window -1)
- (follow-mode 1))
-
-(defun set-frame-alpha (value)
- "Sets the transparency of the frame background. 0=transparent/100=opaque."
- (interactive "nTransparency Value (30 - 100 opaque): ")
- (setq value (max 30 (min value 100)))
- (set-frame-parameter (selected-frame) 'alpha `(,value . ,value))
- (message "Alpha set to %d" value))
-(add-to-list 'default-frame-alist '(alpha . (92 . 92)))
+(require 'transient)
(use-package autorevert
:init
@@ -46,5 +31,46 @@
)))
+(add-to-list 'default-frame-alist '(alpha . (92 . 92)))
+
+(defun bd/layout--do-with-haste (f)
+ (let* ((args (transient-args 'bd/layout-dispatcher))
+ (haste (if (member "haste" args) 3 1)))
+ (funcall f haste)))
+(transient-define-prefix bd/layout-dispatcher ()
+ ["Dispatcher > Layout\n"
+ ["Infixes"
+ ("s" "haste" "haste")]]
+ [["Commands"
+ ("-" "text decrease"
+ (lambda () (interactive) (bd/layout--do-with-haste #'text-scale-decrease))
+ :transient t)
+ ("=" "text increase"
+ (lambda () (interactive) (bd/layout--do-with-haste #'text-scale-increase))
+ :transient t)
+ ("b" "narrow"
+ (lambda () (interactive) (bd/layout--do-with-haste #'shrink-window-horizontally))
+ :transient t)
+ ("f" "widen"
+ (lambda () (interactive) (bd/layout--do-with-haste #'enlarge-window-horizontally))
+ :transient t)
+ ("p" "shrink"
+ (lambda () (interactive) (bd/layout--do-with-haste #'shrink-window))
+ :transient t)
+ ("n" "enlarge"
+ (lambda () (interactive) (bd/layout--do-with-haste #'enlarge-window))
+ :transient t)
+ ("|" "balance" balance-windows)]
+ [""
+ ("N" "shift down" windmove-swap-states-down :transient t)
+ ("P" "shift up" windmove-swap-states-up :transient t)
+ ("F" "shift right" windmove-swap-states-right :transient t)
+ ("B" "shift left" windmove-swap-states-left :transient t)]
+ [""
+ ("a" "alpha" bd/set-frame-alpha)
+ ("w" "wallpaper" bd/set-bg)]])
+(keymap-global-set "C-c w" #'bd/layout-dispatcher)
+
+
(provide 'bd--buffers)
-;;; bd-buffers ends here
+;;; bd--buffers.el ends here