[STUMP] set initial frame size in pixel

2011-03-13 Thread Ivan Kanis
Hi,

The following small patch let's the user specify the initial frame size
width in pixel. I use to setup emacs so it's 80 characters wide.

Take care,

From 2d5028c06b101312f95c8f83c43146b34ae32276 Mon Sep 17 00:00:00 2001
From: Ivan Kanis ivan@tao
Date: Sun, 19 Dec 2010 16:35:21 +0100
Subject: [PATCH] add support for specifying a frame size in pixels

---
 tile-group.lisp |   22 --
 1 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/tile-group.lisp b/tile-group.lisp
index 3ed00aa..fba5337 100644
--- a/tile-group.lisp
+++ b/tile-group.lisp
@@ -316,7 +316,7 @@ T (default) then also focus the frame.
 
 (defun split-frame-h (group p ratio)
   Return 2 new frames. The first one stealing P's number and window
-  (let* ((w (truncate (* (frame-width p) ratio)))
+  (let* ((w (ratio-or-pixel (frame-width p) ratio))
  (h (frame-height p))
  (f1 (make-frame :number (frame-number p)
  :x (frame-x p)
@@ -337,7 +337,7 @@ T (default) then also focus the frame.
 (defun split-frame-v (group p ratio)
   Return 2 new frames. The first one stealing P's number and window
   (let* ((w (frame-width p))
- (h (truncate (* (frame-height p) ratio)))
+ (h (ratio-or-pixel (frame-height p) ratio))
  (f1 (make-frame :number (frame-number p)
  :x (frame-x p)
  :y (frame-y p)
@@ -354,6 +354,13 @@ T (default) then also focus the frame.
 (run-hook-with-args *new-frame-hook* f2)
 (values f1 f2)))
 
+(defun ratio-or-pixel (length ratio)
+  Return a ratio of length unless ratio is a number.
+If ratio is a number return the number of pixel desired.
+  (if (integerp ratio)
+  ratio
+  (truncate (* length ratio
+
 (defun funcall-on-leaf (tree leaf fn)
   Return a new tree with LEAF replaced with the result of calling FN on LEAF.
   (cond ((atom tree)
@@ -725,9 +732,12 @@ depending on the tree's split direction.
  (tree-iterate i (lambda (leaf)
(sync-frame-windows group leaf))
 
-(defun split-frame (group how optional (ratio 1/2))
+(defun split-frame (group how ratio)
   Split the current frame into 2 frames. Return new frame number, if
-  it succeeded. NIL otherwise.
+it succeeded. NIL otherwise. RATIO is a fraction of the screen to
+allocate to the new split window. If ratio is a number then the
+number of pixels will be used. This can be handy to setup the
+desktop when starting.
   (check-type how (member :row :column))
   (let* ((frame (tile-group-current-frame group))
  (head (frame-head group frame)))
@@ -833,9 +843,9 @@ windows used to draw the numbers in. The caller must destroy them.
 
 ;;; Frame commands
 
-(defun split-frame-in-dir (group dir)
+(defun split-frame-in-dir (group dir optional (ratio 1/2))
   (let ((f (tile-group-current-frame group)))
-(if (split-frame group dir)
+(if (split-frame group dir ratio)
 (progn
   (when (frame-window f)
 (update-decoration (frame-window f)))
-- 
1.7.1


-- 
Ivan Kanis
http://kanis.fr

The reasonable man adapts himself to the world; the unreasonable man
persists in trying to adapt the world to himself. Therefore, all
progress depends on the unreasonable man.
-- George Bernard Shaw 
___
Stumpwm-devel mailing list
Stumpwm-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/stumpwm-devel


[STUMP] Explanation of screen shot

2011-07-30 Thread Ivan Kanis
Hi,

On the web page there is this screen shot:

http://www.nongnu.org/stumpwm/screenshot.html

I assume it's a stumpwm session across multiheads. I am curious how it
was setup.

Take care,
-- 
Ivan Kanis

If debugging is the process of removing bugs, then programming must be
the process of putting them in.
-- Edsger W. Dykstra 

___
Stumpwm-devel mailing list
Stumpwm-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/stumpwm-devel


Re: [STUMP] Explanation of screen shot

2011-07-31 Thread Ivan Kanis
Michael Raskin 38a93...@rambler.ru wrote:

http://www.nongnu.org/stumpwm/screenshot.html

I assume it's a stumpwm session across multiheads. I am curious how it
was setup.

 Current version of StumpWM correctly goes multihead automatically when
 launched on most XRandR multihead setups.

Yeah but it looks like multiple computers are used for displays. For
example there are two laptops. From what I read XRandR only works on one
computer...

Take care,
-- 
Ivan Kanis
http://kanis.fr

If you would stand well with a great mind, leave him with a favorable
impression of yourself; if with a little mind, leave him with a
favorable impression of himself.
-- Samuel Taylor Coleridge 

___
Stumpwm-devel mailing list
Stumpwm-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/stumpwm-devel


Re: [STUMP] Stumpwm-devel Digest, Vol 105, Issue 12

2014-02-01 Thread Ivan Kanis
Hi,

January, 31 at 20:22 Kenan Bölükbaşı wrote:

 Hi, I am a designer and a stumpwm fan. I couldn't keep myself from
 drafting an alternative when I saw the logo discussion. So, how about
 one of these:

 http://kenanb.com/static/img/stumpwm.png

FWIW I much prefer these two logos to the others.
-- 
Alas, for our towns and cities. Monstrous carbuncles of concrete have
erupted in gentle Georgian Squares.
-- Raine, Countess Spencer

___
Stumpwm-devel mailing list
Stumpwm-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/stumpwm-devel


Re: [STUMP] Drop the generation of stumpwm.texi

2014-11-18 Thread Ivan Kanis
November, 17 at 21:18 David Bjergaard wrote:

 Diogo F. S. Ramos d...@riseup.net writes:

 I know you wrote a few days ago about developing a module, I hope to
 see what it is sometime soon.

 Heh.

 It is not a new module.  And it is just a silly one.
 I'm still interested :) I really need to do something about some of the
 modules that we're hosting anyway (swm-emacs for sure).

Hi,

What's swm-emacs that you are speaking of?

Ivan

-- 
You need to install an RTFM interface..
-- BOFH excuse #56

___
Stumpwm-devel mailing list
Stumpwm-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/stumpwm-devel