Add the monitor function
This commit is contained in:
parent
a2e82aff2d
commit
ce576a9b17
|
@ -43,6 +43,10 @@
|
|||
(require 'cubes/terraform)
|
||||
|
||||
;; ============== MY STUFF ==============================
|
||||
|
||||
(setq max-specpdl-size 13000)
|
||||
(setq max-lisp-eval-depth 10000)
|
||||
|
||||
(custom-set-faces
|
||||
'(mini-modeline-mode-line
|
||||
((((background light))
|
||||
|
@ -50,7 +54,7 @@
|
|||
(t
|
||||
: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")
|
||||
|
@ -114,6 +118,39 @@
|
|||
:background "#6272a4" :height 0.1 :box nil))))
|
||||
(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
|
||||
(fg42/merge-with-default-flags
|
||||
wm
|
||||
|
|
Loading…
Reference in New Issue