Start specific frames in external monitor (if present)

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Start specific frames in external monitor (if present)

Shakthi Kannan-3

I use the following to start Emacs and Chrome in separate frames in
the Default group on a laptop running Ubuntu 14.10 and stumpwm-0.9.8.

=== ~/.stumpwmrc ===

;; Emacs
(defvar *emacs-command* nil
  "Start an emacs client frame. Starts an emacs daemon if necessary.")
(setf *emacs-command* "emacsclient -c -a \"\"")

(defcommand run-emacs () ()
    (run-shell-command (concat "exec " *emacs-command*)))

;; Chromium
(defcommand chromium () ()
  "run chromium"
  (run-or-raise "chromium-browser" '(:instance "chromium-browser")))
(define-key *root-map* (kbd "b") "chromium")

;; Clear rules

(define-frame-preference "Default"
  ;; frame raise lock (lock AND raise == jumpto)
  (0 t   t :instance "emacs")
  (1 t   t :instance "chromium-browser"))

;; Start default applications

=== END ===

Sometimes, I use an external monitor. When starting stumpwm, would it
be possible to detect the presence of an external monitor and start
the emacs frame in it, while the chromium browser can be launched in
the laptop's head?

Any suggestions on how this can be implemented?


Shakthi Kannan

Stumpwm-devel mailing list
[hidden email]