Add the monitor function
This commit is contained in:
parent
a2e82aff2d
commit
ce576a9b17
|
@ -43,6 +43,10 @@
|
||||||
(require 'cubes/terraform)
|
(require 'cubes/terraform)
|
||||||
|
|
||||||
;; ============== MY STUFF ==============================
|
;; ============== MY STUFF ==============================
|
||||||
|
|
||||||
|
(setq max-specpdl-size 13000)
|
||||||
|
(setq max-lisp-eval-depth 10000)
|
||||||
|
|
||||||
(custom-set-faces
|
(custom-set-faces
|
||||||
'(mini-modeline-mode-line
|
'(mini-modeline-mode-line
|
||||||
((((background light))
|
((((background light))
|
||||||
|
@ -50,7 +54,7 @@
|
||||||
(t
|
(t
|
||||||
:background "#bd93f9" :height 0.1 :box nil))))
|
:background "#bd93f9" :height 0.1 :box nil))))
|
||||||
|
|
||||||
(defvar global-font-size 12)
|
(defvar global-font-size 11)
|
||||||
|
|
||||||
|
|
||||||
(setq lsp-clients-clangd-executable "/home/lxsameer/usr/lib/llvm-13rc2/bin/clangd")
|
(setq lsp-clients-clangd-executable "/home/lxsameer/usr/lib/llvm-13rc2/bin/clangd")
|
||||||
|
@ -114,6 +118,39 @@
|
||||||
:background "#6272a4" :height 0.1 :box nil))))
|
:background "#6272a4" :height 0.1 :box nil))))
|
||||||
(fg42/wm-cube :number-of-workspaces 9)
|
(fg42/wm-cube :number-of-workspaces 9)
|
||||||
|
|
||||||
|
(defvar monitors
|
||||||
|
'(:hdmi-only
|
||||||
|
("--output HDMI-1 --primary"
|
||||||
|
"--output eDP-1 --off")
|
||||||
|
:hdmi-main
|
||||||
|
("--output HDMI-1 --primary"
|
||||||
|
"--output eDP-1 --mode 1920x1080 --left-of HDMI-1")
|
||||||
|
:edp-only
|
||||||
|
("--output eDP-1 --mode 1920x1080"
|
||||||
|
"--output HDMI-1 --off")))
|
||||||
|
|
||||||
|
(require 'seq)
|
||||||
|
(defun monitor-profiles ()
|
||||||
|
(mapcar
|
||||||
|
#'car
|
||||||
|
(seq-partition monitors 2)))
|
||||||
|
|
||||||
|
(defun monitor (mon)
|
||||||
|
(interactive
|
||||||
|
(list (completing-read
|
||||||
|
"Monitor Profole: "
|
||||||
|
(monitor-profiles))))
|
||||||
|
|
||||||
|
(let ((cmd (mapconcat (lambda (x) (format "xrandr %s" x))
|
||||||
|
(plist-get monitors (intern (format "%s" mon)))
|
||||||
|
" && ")))
|
||||||
|
(message "Setting monitor profile: %s" cmd)
|
||||||
|
(async-shell-command cmd "*xrandr*")))
|
||||||
|
|
||||||
|
(comment
|
||||||
|
;; how to run it via elisp
|
||||||
|
(monitor :hdmi-only))
|
||||||
|
|
||||||
(use-flags
|
(use-flags
|
||||||
(fg42/merge-with-default-flags
|
(fg42/merge-with-default-flags
|
||||||
wm
|
wm
|
||||||
|
|
Loading…
Reference in New Issue