From ce576a9b17e8bfcdf4fb41df2e3cf50da4e5e78a Mon Sep 17 00:00:00 2001 From: Sameer Rahmani Date: Thu, 21 Oct 2021 19:08:29 +0100 Subject: [PATCH] Add the monitor function --- config/fg42.user.v3.el | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/config/fg42.user.v3.el b/config/fg42.user.v3.el index 34a2746..603617a 100644 --- a/config/fg42.user.v3.el +++ b/config/fg42.user.v3.el @@ -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