Flippin' screens

This commit is contained in:
Benson Chu 2019-12-26 15:26:42 -06:00
parent e0cc0eee29
commit d1e1fd7b31
3 changed files with 75 additions and 0 deletions

View file

@ -742,6 +742,8 @@
(let ((monitors (my/get-screens)))
(setq exwm-workspace-number (length monitors)))
(defvar exwm-randr/current-offset 0)
(setq exwm-randr-workspace-monitor-plist
(loop for m in (my/get-screens)
for i from 0
@ -758,6 +760,25 @@
(exwm-workspace-switch (my/get-next-workspace-number)))
(define-exwm-input-key (kbd "<s-tab>") #'my/next-workspace)
(defun my/swap-screens ()
(interactive)
(clj-swap exwm-randr/current-offset
(lambda (x)
(mod (1+ x)
2)))
(let ((monitors (my/get-screens)))
(setq exwm-randr-workspace-monitor-plist
(loop for i from 0 below exwm-workspace-number
for m = (nth (mod (+ i exwm-randr/current-offset)
exwm-workspace-number)
monitors)
collect i
collect m)))
(exwm-workspace-switch (mod (1- exwm-workspace-current-index)
2))
(exwm-randr-refresh))
#+end_src
** Floating windows don't need that many faces ^_^
#+begin_src emacs-lisp
@ -3426,6 +3447,27 @@
(setq wg-emacs-exit-save-behavior nil
wg-workgroups-mode-exit-save-behavior nil)
;; Advice for frames, don't switch to an active workgroup
(defun get-active-workgroups ()
(loop for frame in exwm-workspace--list
unless (eq (selected-frame) frame)
collect (with-selected-frame frame
(wg-workgroup-name (wg-current-workgroup)))))
(defun wg-dont-switch-to-active (orig &optional workgroup noerror)
(if workgroup
(funcall orig workgroup noerror)
(let ((active (get-active-workgroups))
(to-switch (wg-read-workgroup-name)))
(if (member to-switch active)
(message "Workgroup \"%s\" already active" to-switch)
(funcall orig to-switch noerror)))))
(advice-add #'wg-switch-to-workgroup
:around
#'wg-dont-switch-to-active)
#+end_src
** opml to elfeed-org
#+begin_src emacs-lisp

32
lisp/clojure-swap.el Normal file
View file

@ -0,0 +1,32 @@
;;; clojure-swap.el --- -*- lexical-binding: t -*-
;; Copyright (C) 2019 Benson Chu
;; Author: Benson Chu <bensonchu457@gmail.com>
;; Created: [2019-12-26 15:13]
;; This file is not part of GNU Emacs
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;;; Code:
(defmacro clj-swap (place fun)
`(setf ,place
(funcall ,fun ,place)))
(provide 'clojure-swap)
;;; clojure-swap.el ends here

View file

@ -11,6 +11,7 @@
(require 'org-process)
(require 'org-project)
(require 'org-delay)
(require 'clojure-swap)
;; Buggy overall, not needed cause of workgroups2.el
;; (require 'exwm-workspace-counsel)