Skip to content

Commit

Permalink
Removed json config, now we use tranquil to configure instead, rename…
Browse files Browse the repository at this point in the history
…d Main.tq to xnomad and added shebangs
  • Loading branch information
fjolnir committed Mar 5, 2013
1 parent 7ba762e commit d2f448d
Show file tree
Hide file tree
Showing 9 changed files with 121 additions and 271 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
xnomad
2 changes: 1 addition & 1 deletion Accessibility.tq
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import "CGSPrivate"
klass = rolePtr value case: {
#AXApplication => `AccessibilityApplication`,
#AXWindow => `AccessibilityWindow`
} else: `AccessibilityElement`
} default: `AccessibilityElement`
^klass new setAxElement: element; self
}
+ systemWide `self withAXElement: AXUIElementCreateSystemWide() autorelease`
Expand Down
13 changes: 0 additions & 13 deletions JSON.tq

This file was deleted.

3 changes: 1 addition & 2 deletions Layouts.tq
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,8 @@ min = `a,b| (a > b) ? b ! a`
x = i * masterWidth
x = screenFrame[1][0] - x - masterWidth if @horizontallyFlipped
x += left
y = top
masterCount = wm maxMastersOnScreen: screen space: spaceId
frame = [[x, y], [masterWidth, screenFrame[1][1]]]
frame = [[x, top], [masterWidth, screenFrame[1][1]]]
win setFrame: frame
} else {
h = screenFrame[1][1] / subCount
Expand Down
210 changes: 0 additions & 210 deletions Main.tq

This file was deleted.

16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ A tiling window manager for OS X; written in [tranquil](https://github.com/fjoln

##setup

[Download](http://d.asgeirsson.is/sfEI) a binary, then copy `xnomad.default` to your home directory & rename it to `.xnomad` (Resulting path is `~/.xnomad`)

And then just execute xnomad, your windows will be snapped in place. (Make sure "Access for Assistive Devices" is enabled in Accessibility Preferences)

To learn the hotkeys, read xnomad.default
* Download & install [tranquil](https://github.com/fjolnir/Tranquil)
* Make sure "Access for Assistive Devices" is enabled in Accessibility Preferences
* Clone xnomad, and execute `./xnomad`

OS X 10.8 or newer is required.

Expand All @@ -25,12 +23,10 @@ OS X 10.8 or newer is required.
* Fullscreen
* Additional ones are easy to write

## protip
##protips

In order to make the most of xnomad, I recommend you also install [afloat](http://infinite-labs.net/afloat/). It will add shortcuts for making windows floating (and therefore ignored by xnomad) and resizing/moving windows without having to spend precious milliseconds looking for the window edges.

The rounded corner hack is discussed under this issue: https://github.com/fjolnir/xnomad/issues/6
Another nice addition is [menufela](http://github.com/fjolnir/menufela) which hides the menubar)

##building

In order to build xnomad you'll first need to install [tranquil](https://github.com/fjolnir/tranquil). Then you can simply write (assuming you added /usr/local/tranquil/bin to your PATH) `tqc Main.tq -framework Carbon -framework ApplicationServices -o xnomad` and a binary will appear.
The rounded corner hack is discussed under this issue: https://github.com/fjolnir/xnomad/issues/6
20 changes: 6 additions & 14 deletions WindowManager.tq
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import "Accessibility"
import "Layouts"

@NSNotificationCenter
{
Expand All @@ -14,6 +13,7 @@ import "Layouts"
accessor: #windowsInMaster initialValue: 1
accessor: #defaultRatio initialValue: 0.7
accessor: #defaultMaxMasters initialValue: 1
accessor: #layouts initialValue: []

- init
{
Expand All @@ -23,14 +23,6 @@ import "Layouts"
@screensThatNeedReflowing = []
@spacesThatNeedReflowing = []

@layouts = [
MultiColLayout new,
MultiColLayout new setHorizontallyFlipped: yes; self,
TallLayout new,
WideLayout new,
FullscreenLayout new
]

workspace = NSWorkspace sharedWorkspace
workspace runningApplications each: { app |
self addApplicationWithPID: app processIdentifier unless app bundleIdentifier hasPrefix: "com.apple.dashboard"
Expand Down Expand Up @@ -84,6 +76,7 @@ import "Layouts"
(self managedWindowsForScreen: NSScreen mainScreen spaces: destSpace) first raise
}
}

\ This doesn't work yet, not sure if my function prototype is wrong, or if you need elevated permissions to move windows around
\ - moveWindow: window toSpace: destSpaceIdx
\ {
Expand Down Expand Up @@ -284,12 +277,12 @@ import "Layouts"
- swapWithCounterpart: window
{
\ Get the existing reference managing the same physical window
screen = window screen
space = self currentSpaceId
screen = window screen
space = self currentSpaceId
windows = self managedWindowsForScreen: screen space: space
idx = windows indexOf: window
idx = windows indexOf: window
masterCount = self maxMastersOnScreen: screen space: space
isOnLeft = idx < masterCount
isOnLeft = idx < masterCount

winCount = windows count
if isOnLeft {
Expand All @@ -301,7 +294,6 @@ import "Layouts"
self swapWindow: window with: windows[otherIdx]
}


- focusOnScreen: screen
{
(self managedWindowsForScreen: screen space: self currentSpaceId) first raise
Expand Down
Loading

0 comments on commit d2f448d

Please sign in to comment.