This commit is contained in:
parent
19347f0997
commit
c052b98e3d
32
README.md
32
README.md
|
@ -1,10 +1,10 @@
|
|||
### why?
|
||||
|
||||
Layout-machi is great, however it requires you to use its built-in switcher to manage your open windows. If you are shuffling, swapping, and move things around a lot, this could become counter productive.
|
||||
Layout-machi is great, however it requires you to use its built-in switcher to manage your open windows. If you are shuffling, swapping, and moving things around often, this could become counter productive.
|
||||
|
||||
`Machina` is built on top of layout-machi, and allows you to bind frequently used actions to your keys and gives you additional user friendly features.
|
||||
|
||||
In other words, combination of `layout-machi` and `awesomewm-machina` will give you a similar (if not better) experience than the fancyzones on windows.
|
||||
A combination of `layout-machi` and `awesomewm-machina` will give you a similar experience to fancy zones on windows.
|
||||
|
||||
### what?
|
||||
|
||||
|
@ -52,17 +52,14 @@ local machina = require('awesomewm-machina')()
|
|||
some of the default shortcuts are:
|
||||
|
||||
```lua
|
||||
modkey + [ : prev client within region
|
||||
modkey + ] : next client within region
|
||||
modkey + [ : prev within region
|
||||
modkey + ] : next within region
|
||||
|
||||
modkey + shift + [ : move client to region (counter clock wise)
|
||||
modkey + shift + ] : move client to region (clock wise)
|
||||
modkey + shift + [ : move to region (counter clock wise, infinite)
|
||||
modkey + shift + ] : move to region (clock wise, infinite)
|
||||
|
||||
modkey + ; : move client to region on left (with bump)
|
||||
modkey + ' : move client to region on right (with bump)
|
||||
|
||||
modkey + shift + ; : swap with client on left if any
|
||||
modkey + shift + ' : swap with client on right if any
|
||||
modkey + ; : swap with client on left (if any)
|
||||
modkey + ' : swap with client on right (if any)
|
||||
|
||||
modkey + insert : quick expand to left side (toggle)
|
||||
modkey + pageup : quick expand to right side (toggle)
|
||||
|
@ -72,10 +69,15 @@ modkey + end : toggle float
|
|||
|
||||
modkey + delete : expand client vertically
|
||||
|
||||
modkey + j : stack friendly left
|
||||
modkey + k : stack friendly down
|
||||
modkey + l : stack friendly right
|
||||
modkey + i : stack friendly up
|
||||
modkey + j : focus left
|
||||
modkey + k : focus down
|
||||
modkey + l : focus right
|
||||
modkey + i : focus up
|
||||
|
||||
modkey + shift + j : move to left region
|
||||
modkey + shift + k : move to down region
|
||||
modkey + shift + l : move to right region
|
||||
modkey + shift + i : move to up region
|
||||
```
|
||||
|
||||
### Preview
|
||||
|
|
38
methods.lua
38
methods.lua
|
@ -12,6 +12,15 @@ geoms.crt43 = function ()
|
|||
}
|
||||
end
|
||||
|
||||
geoms.p1080 = function ()
|
||||
return {
|
||||
x = awful.screen.focused().workarea.width - client.focus:geometry().width,
|
||||
y = awful.screen.focused().workarea.height - client.focus:geometry().height,
|
||||
width = awful.screen.focused().workarea.width * 0.70,
|
||||
height = awful.screen.focused().workarea.height * 0.90
|
||||
}
|
||||
end
|
||||
|
||||
local function compare(a,b)
|
||||
return a.v < b.v
|
||||
end
|
||||
|
@ -217,6 +226,7 @@ local function expand_horizontal(direction)
|
|||
end --| reset toggle maximized state
|
||||
|
||||
if c.direction == direction then
|
||||
naughty.notify({text="exec"})
|
||||
c.direction = nil
|
||||
return
|
||||
end --| reset toggle when sending same shortcut
|
||||
|
@ -225,8 +235,7 @@ local function expand_horizontal(direction)
|
|||
local stuff = get_active_regions()
|
||||
local target = grect.get_in_direction(direction, stuff.regions, client.focus:geometry())
|
||||
|
||||
if not target and direction ~= "center" then return end
|
||||
-- flow control
|
||||
if not target and direction ~= "center" then return end -- flow control
|
||||
|
||||
if direction == "right" then
|
||||
tobe = {
|
||||
|
@ -257,15 +266,32 @@ local function expand_horizontal(direction)
|
|||
end
|
||||
|
||||
if direction == "center" then
|
||||
c.direction = "center"
|
||||
|
||||
c.maximized = false
|
||||
c.maximixed_vertical = false
|
||||
c.maximized_horizontal = true
|
||||
client.focus:geometry(geoms.crt43())
|
||||
awful.placement.centered(client.focus)
|
||||
|
||||
if c.floating then
|
||||
client.focus:geometry(geoms.crt43())
|
||||
end
|
||||
|
||||
if not c.floating then
|
||||
c.direction = "center"
|
||||
c.maximized_horizontal = true
|
||||
client.focus:geometry(geoms.p1080())
|
||||
end
|
||||
|
||||
|
||||
gears.timer.delayed_call(function ()
|
||||
awful.placement.centered(client.focus)
|
||||
end) --| give it some time before centering
|
||||
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
-- c.direction is used to create a fake toggling effect.
|
||||
-- tiled clients require an internal maximized property to
|
||||
-- be set, otherwise they won't budge.
|
||||
|
||||
----------------------------------------------------- expand_vertical() -- ;
|
||||
|
||||
|
|
Loading…
Reference in New Issue