stumpwm-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Spatial groups concept discussion


From: Tim Macdonald
Subject: Re: Spatial groups concept discussion
Date: Fri, 22 Apr 2022 17:08:48 +0100

I finally had some spare time to get this up and running on my own system and so far like it very much. Just need to retrain some of my muscle memory! I'm currently using it on two heads and it's fine; it's the same as using it on one head with every single desktop having a vertical split.

A stupid hack that I did and thought I'd share is changing the focus color for each z-layer to have a subtle reminder of which layer you're in. Here's how I did it (directly editing COORD-GROUP-CHANGE in the library file >.< ):

diff --git a/.stumpwm.d/modules/StumpWMSpatial/spatial-groups.lisp b/.stumpwm.d/modules/StumpWMSpatial/spatial-groups.lisp
index f3cba3c..c73e628 100644
--- a/.stumpwm.d/modules/StumpWMSpatial/spatial-groups.lisp
+++ b/.stumpwm.d/modules/StumpWMSpatial/spatial-groups.lisp
@@ -119,7 +119,8 @@
                   (split-string (group-name (current-group)) ",")))
          (new-coords (mapcar #'+ current-coords (list xo yo zo)))
          (new-group-name (format nil "~{~a~^,~}" new-coords)) )
-
+    (set-focus-color (elt *colors* (mod (third new-coords)
+                                        (length *colors*))))
     (if (= 0 zo)
 
         ;; Not changing desktop, so just move by coordinates


—Tim

On Mon, Mar 14, 2022 at 9:49 AM Roland Everaert <r.everaert@protonmail.com> wrote:
Russel,

> Roland,
>
> On Mon, Mar 14, 2022 at 08:19:09AM +0000, Roland Everaert wrote:
>
> > Regarding keybings, (un)fortunately, I live in a hybrid-world, the
> >
> > machine I use for my job is a windows machine provided by the
> >
> > customer, so I have to account for the Windows world, hence C-n et
> >
> > al. doesn't feels natural to me for a very long time.
>
> Xkeymacs. http://xkeymacs.osdn.jp/
>
> Reskin your OS to use reasonable keybindings.

I will have to look at it, thanks

>
> > Maybe you could propose predefined keybindings in addition to the
> >
> > possibility for the user to define its own. The Nyxt web-browser, a
> >
> > common lisp based browser, do that quite well.
>
> Kind of out of scope for me. ;]
>
> > Below is my keybindings definition:
> >
> > ;; 1. Undefine all the default keybindings
> >
> > (undefine-key top-map (kbd "C-Left"))
> >
> > (undefine-key top-map (kbd "C-Right"))
> >
> > (undefine-key top-map (kbd "C-Up"))
> >
> > (undefine-key top-map (kbd "C-Down"))
> >
> > (undefine-key top-map (kbd "C-S-Left"))
> >
> > (undefine-key top-map (kbd "C-S-Right"))
> >
> > (undefine-key top-map (kbd "C-S-Up"))
> >
> > (undefine-key top-map (kbd "C-S-Down"))
> >
> > ;; 2. Set my own keybindings
> >
> > (define-key top-map (kbd "s-Left") "coord-left")
> >
> > (define-key top-map (kbd "s-Right") "coord-right")
> >
> > (define-key top-map (kbd "s-Up") "coord-up")
> >
> > (define-key top-map (kbd "s-Down") "coord-down")
> >
> > ;; Control-Shift left/right to switch desktop Z
> >
> > (define-key top-map (kbd "C-s-Left") "coord-taskleft")
> >
> > (define-key top-map (kbd "C-s-Right") "coord-taskright")
> >
> > ;; Control-Shift-Up to return to origin 0,0 on current desktop Z
> >
> > (define-key top-map (kbd "C-s-Up") "coord-taskorigin")
> >
> > ;; "Pop" back to last desktop position
> >
> > (define-key top-map (kbd "C-s-Down") "coord-taskpop")
> >
> > ;; ----------------------------------------------
>
> The updated module 0.0.2 now has a function you have to call to
>
> install my default keybinds. If you omit it, you can just define
>
> them. No need for undefines.
>
> So you moved the coordinate navigation from Control-arrows to Windows-key arrows?

Indeed.

>
> I have my music player bound there. ;]
>
> > As for the multi-head usage, S-Arrows allows to switch between
> >
> > frames in the same group, so it allows to switch between heads.
>
> You mean move-focus? That built in likely works.

Yes, move-focus.

>
> Do you configure the multiple heads somewhere, regarding which screen
>
> is adjacent to the other? (ie: DP2 left of DP1)

I used lxrandr to create a configuration file for screen placement, then in my configuration I launch this command:

(run-shell-command "gtk-launch lxrandr-autostart")

>
> > As for frame/windows placement in groups, according to the
> >
> > documentation, it is possible to define rules, unfortunately, I
> >
> > never manage to make them works, with the exception of firefox. :(
>
> Yeah. I mentioned this at one point, where you can define a group
>
> where all terminals go, or all Firefox windows go. That feels very
>
> confining to me, cramming all those on one group / screen.
>
> I meant that on startup I'd love to launch a series of applications in
>
> fixed locations (group 0,0,0, frame 0, launch urxvt. group 0,0,0,
>
> frame 1, launch urxvt. and so on). Instead I have a short snippet to
>
> create my frames and splits, but then I have to manually launch things.
>
> (defun my-startup ()
>
> (spatial-groups:spatial-gselect "0,0,0")
>
> (hsplit)
>
> (resize-frame (current-group) (tile-group-current-frame (current-group)) (- 110 (frame-width (tile-group-current-frame (current-group)))) :width)
>
> (move-focus :right)
>
> (hsplit)
>
> ; (run-shell-command "/usr/bin/urxvt")
>
> ; (sleep 1)
>
> (move-focus :right)
>
> ; (run-shell-command "/usr/bin/urxvt")
>
> ; (sleep 1)
>
> (spatial-groups:spatial-gselect "0,1,0")
>
> (hsplit)
>
> ; (run-shell-command "/usr/bin/urxvt")
>
> ; (sleep 1)
>
> (move-focus :right)
>
> ; (run-shell-command "/usr/bin/urxvt")
>
> ; (sleep 1)
>
> (spatial-groups:spatial-gselect "1,-1,0")
>
> (hsplit)
>
> ; (run-shell-command "/usr/bin/urxvt")
>
> ; (sleep 1)
>
> (move-focus :right)
>
> ; (run-shell-command "/usr/bin/urxvt")
>
> ; (sleep 1)
>
> (spatial-groups:spatial-gselect "1,0,0")
>
> ; (run-shell-command "/usr/bin/emacsclient -c")
>
> ; (sleep 1)
>
> (spatial-groups:spatial-gselect "0,0,0") )
>
> (when initializing (my-startup))
>
> If I uncomment the run-shell-command, they stack in the last or
>
> current frame.

I have the same problem :(


>
> ------------------------------------------------------------------
>
> Russell Adams RLAdams@AdamsInfoServ.com
>
> PGP Key ID: 0x1160DCB3 http://www.adamsinfoserv.com/
>
> Fingerprint: 1723 D8CA 4280 1EC9 557F 66E8 1154 E018 1160 DCB3


reply via email to

[Prev in Thread] Current Thread [Next in Thread]