foo-wm

(Archived) Experimental Zooming IPC-based WM
git clone http://milesalan.com/git/foo-wm
Log | Files | Refs | Mirror | README | LICENSE

commit f9cc998f0de2ac0cfc9b760820bed75f385864db
parent f6acf1347d4c41acdb73ec4538883ebb767f7014
Author: Miles Sandlar <miles.sandlar@gmail.com>
Date:   Fri, 16 Nov 2012 17:36:08 -0500

Fix some bugs

Diffstat:
MTODO.md | 2++
Mconfig/.xbindkeysrc | 173++++++++++++++++++++++++++++++++++++++-----------------------------------------
Mscripts/uncontainerize.rb | 2+-
Msrc/config.h | 2+-
Msrc/tree.c | 8++------
5 files changed, 90 insertions(+), 97 deletions(-)

diff --git a/TODO.md b/TODO.md @@ -18,6 +18,8 @@ Bugs * 'kill' 'kill' 'kill' 'focus pc -1' ==> causes crash * void focus asserts focusedNode? - mark'ing and jump'ing to a client doesn't restore the client but the container +- First client launched if no root (on start) should be just a client and not part of a container + * When 2nd client launched, if there is a client, a container should be created Fixed Bugs ========== diff --git a/config/.xbindkeysrc b/config/.xbindkeysrc @@ -1,146 +1,141 @@ ### Applications -"urxvt -cd `cat /home/mil/.wd`" - m:0x40 + c:36 - mod4 + enter "urxvt" - m:0x40 + c:48 - Mod4 + apostrophe - -" + m:0x8 + c:36 + Alt + enter "dwb" - m:0x40 + c:51 - Mod4 + backslash + m:0x8 + c:51 + Alt + backslash "xdotool getactivewindow windowkill" - m:0x41 + c:24 - Shift+Mod4 + q + m:0x8 + c:24 + Alt + q ### WM # Layout Commands -"foo-wm-c /tmp/stable-wm.socket 'layout vertical'" - m:0x40 + c:55 - Mod4 + v +"foo-wm-c /tmp/foo-wm.socket 'layout vertical'" + m:0x8 + c:55 + Alt + v -"foo-wm-c /tmp/stable-wm.socket 'layout horizontal'" - m:0x40 + c:56 - Mod4 + b +"foo-wm-c /tmp/foo-wm.socket 'layout horizontal'" + m:0x8 + c:56 + Alt + b -"foo-wm-c /tmp/stable-wm.socket 'layout grid'" - m:0x40 + c:57 - Mod4 + n +"foo-wm-c /tmp/foo-wm.socket 'layout grid'" + m:0x8 + c:57 + Alt + n -"foo-wm-c /tmp/stable-wm.socket 'layout max'" - m:0x40 + c:58 - Mod4 + m +"foo-wm-c /tmp/foo-wm.socket 'layout max'" + m:0x8 + c:58 + Alt + m # Containerize Command -"foo-wm-c /tmp/stable-wm.socket 'containerize'" - m:0x40 + c:47 - Mod4 + semicolon +"foo-wm-c /tmp/foo-wm.socket 'containerize'" + m:0x8 + c:47 + Alt + semicolon # Focus Commands -"foo-wm-c /tmp/stable-wm.socket 'focus brother 1'" - m:0x40 + c:23 - Mod4 + Tab +"foo-wm-c /tmp/foo-wm.socket 'focus brother 1'" + m:0x8 + c:23 + Alt + Tab -"foo-wm-c /tmp/stable-wm.socket 'focus brother 2'" - m:0x40 + c:43 - Mod4 + h +"foo-wm-c /tmp/foo-wm.socket 'focus brother 2'" + m:0x8 + c:43 + Alt + h -"foo-wm-c /tmp/stable-wm.socket 'focus brother 1'" - m:0x40 + c:44 - Mod4 + j +"foo-wm-c /tmp/foo-wm.socket 'focus brother 1'" + m:0x8 + c:44 + Alt + j -"foo-wm-c /tmp/stable-wm.socket 'focus brother -1'" - m:0x40 + c:45 - Mod4 + k +"foo-wm-c /tmp/foo-wm.socket 'focus brother -1'" + m:0x8 + c:45 + Alt + k -"foo-wm-c /tmp/stable-wm.socket 'focus brother -2'" - m:0x40 + c:46 - Mod4 + l +"foo-wm-c /tmp/foo-wm.socket 'focus brother -2'" + m:0x8 + c:46 + Alt + l -"foo-wm-c /tmp/stable-wm.socket 'focus pc -1'" - m:0x40 + c:32 - Mod4 + o +"foo-wm-c /tmp/foo-wm.socket 'focus pc -1'" + m:0x8 + c:32 + Alt + o -"foo-wm-c /tmp/stable-wm.socket 'focus pc 1'" - m:0x40 + c:33 - Mod4 + p +"foo-wm-c /tmp/foo-wm.socket 'focus pc 1'" + m:0x8 + c:33 + Alt + p # Move Commands -"foo-wm-c /tmp/stable-wm.socket 'move 1'" - m:0x41 + c:23 - Shift+Mod4 + Tab +"foo-wm-c /tmp/foo-wm.socket 'move 1'" + m:0x9 + c:23 + Shift+Alt + Tab # Shift VIM-Esque Movement -"foo-wm-c /tmp/stable-wm.socket 'shift brother -2'" - m:0x41 + c:43 - Shift+Mod4 + h +"foo-wm-c /tmp/foo-wm.socket 'shift brother -2'" + m:0x9 + c:43 + Shift+Alt + h -"foo-wm-c /tmp/stable-wm.socket 'shift brother 1'" - m:0x41 + c:44 - Shift+Mod4 + j +"foo-wm-c /tmp/foo-wm.socket 'shift brother 1'" + m:0x9 + c:44 + Shift+Alt + j -"foo-wm-c /tmp/stable-wm.socket 'shift brother -1'" - m:0x41 + c:45 - Shift+Mod4 + k +"foo-wm-c /tmp/foo-wm.socket 'shift brother -1'" + m:0x9 + c:45 + Shift+Alt + k -"foo-wm-c /tmp/stable-wm.socket 'shift brother -2'" - m:0x41 + c:46 - Shift+Mod4 + l +"foo-wm-c /tmp/foo-wm.socket 'shift brother -2'" + m:0x9 + c:46 + Shift+Alt + l -"foo-wm-c /tmp/stable-wm.socket 'set client_border_width 1'" - m:0x40 + c:10 - Mod4 + 1 +"foo-wm-c /tmp/foo-wm.socket 'set client_border_width 1'" + m:0x8 + c:10 + Alt + 1 -"foo-wm-c /tmp/stable-wm.socket 'set client_border_width 20'" - m:0x40 + c:11 - Mod4 + 2 +"foo-wm-c /tmp/foo-wm.socket 'set client_border_width 20'" + m:0x8 + c:11 + Alt + 2 # Zoom Commands -"foo-wm-c /tmp/stable-wm.socket 'zoom -1'" - m:0x40 + c:31 - Mod4 + i +"foo-wm-c /tmp/foo-wm.socket 'zoom -1'" + m:0x8 + c:31 + Alt + i -"foo-wm-c /tmp/stable-wm.socket 'zoom 1'" - m:0x40 + c:30 - Mod4 + u +"foo-wm-c /tmp/foo-wm.socket 'zoom 1'" + m:0x8 + c:30 + Alt + u # Killing Clients -"foo-wm-c /tmp/stable-wm.socket 'kill client'" - m:0x40 + c:24 - Mod4 + q +"foo-wm-c /tmp/foo-wm.socket 'kill client'" + m:0x8 + c:24 + Alt + q # Dumps the Tree -"foo-wm-c /tmp/stable-wm.socket 'dump tree'" - m:0x40 + c:28 - Mod4 + t +"foo-wm-c /tmp/foo-wm.socket 'dump tree'" + m:0x8 + c:28 + Alt + t # Dmenu "dmenu-suggestions.rb | dmenu -h 40 -x 100 -y 400 -w 1100 -fn 'Envy Code R-16' -sb '#ffffff' -nf '#2b4f00' -nb '#cfcfcf' -sf '#0052d6' -b -p 'Command' | xargs -0 -I INPUT handler INPUT" - m:0x40 + c:40 - Mod4 + d + m:0x8 + c:40 + Alt + d # Dmenu -"cat /home/mil/code/stable/foo-wm/config/commands | dmenu -h 40 -x 100 -y 400 -w 1100 -fn 'Envy Code R-16' -sb '#ffffff' -nf '#2b4f00' -nb '#cfcfcf' -sf '#0052d6' -b -p 'Foo-WM' | xargs -0 -I INPUT foo-wm-c /tmp/stable-wm.socket INPUT" - m:0x40 + c:38 - Mod4 + a +"cat /home/mil/Code/Github/foo-wm/config/commands | dmenu -h 40 -x 100 -y 400 -w 1100 -fn 'Envy Code R-16' -sb '#ffffff' -nf '#2b4f00' -nb '#cfcfcf' -sf '#0052d6' -b -p 'Foo-WM' | xargs -0 -I INPUT foo-wm-c /tmp/foo-wm.socket INPUT" + m:0x8 + c:38 + Alt + a # Dmenu "find /etc/network.d -maxdepth 1 -type f -printf '%f\n' | dmenu -h 40 -x 100 -y 400 -w 1100 -fn 'Envy Code R-16' -sb '#ffffff' -nf '#2b4f00' -nb '#cfcfcf' -sf '#0052d6' -b -p 'Netcfg' | tr -d '\n' | xargs -0 -I NETWORK sudo netcfg NETWORK" - m:0x40 + c:25 - Mod4 + w + m:0x8 + c:25 + Alt + w @@ -181,5 +176,5 @@ XF86AudioPlay "scrot -s" - m:0x41 + c:13 - Shift+Mod4 + 4 + m:0x9 + c:13 + Shift+Alt + 4 diff --git a/scripts/uncontainerize.rb b/scripts/uncontainerize.rb @@ -2,7 +2,7 @@ require 'socket' require 'json' require 'pp' -$socketPath = "/tmp/foo-wm.socket" +$socketPath = "/tmp/stable-wm.socket" def sendCommand(command) response = "" diff --git a/src/config.h b/src/config.h @@ -3,7 +3,7 @@ /* If "NONE" is specified as the SOCKET_NAME, * one will automatically be generated based the sockets PID * In the form of: foo-wm-pid.socket */ -#define SOCKET_NAME "stable-wm.socket" +#define SOCKET_NAME "foo-wm.socket" //Screen #define SCREEN_PADDING_TOP (18) diff --git a/src/tree.c b/src/tree.c @@ -409,13 +409,9 @@ void swapNodes(Node * a, Node * b) { /* Update Parent / Parent -> Child Pointer */ Node *temp = NULL; + if (a -> parent -> child == a) a -> parent -> child = b; + else if (b -> parent -> child == b) b -> parent -> child = a; - /* Parent Client Server */ - temp = a -> parent; a -> parent = b -> parent; - if (a -> parent && a -> parent -> child == b) a -> parent -> child = a; - b -> parent = temp; - if (b -> parent && b -> parent -> child == a) b -> parent -> child = b; - /* Update Previous Pointer */ temp = a -> previous; a -> previous = b -> previous; if (a -> previous) a -> previous -> next = a;