diff --git a/README.md b/README.md index b4864ad..29133cd 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,7 @@ while the `Control` key is used to max out the effect. | `Mod4` | `Mod1 (Alt)` | `Shift` | Resize a client relative to the top left corner | | `Control` | `Mod1 (Alt)` | | Move to the next/previous tag | | `Control` | `Mod4` | `Mod1 (Alt)` | Move to the next/previous screen | +| `Control` | `Mod4` | `Mod1 (Alt)` | + `Shift` Move tag to the next/previous screen | # Using different keys diff --git a/init.lua b/init.lua index bfaabaf..5aa8666 100644 --- a/init.lua +++ b/init.lua @@ -119,9 +119,9 @@ function module.tag(direction,swap,max) start_loop(swap,max) end -function module.screen(direction) +function module.screen(direction, move) current_mode = "screen" - module._screen.display(nil,direction) + module._screen.display(nil,direction,move) start_loop(false,max) end @@ -134,15 +134,16 @@ local function new(k) glib.idle_add(glib.PRIORITY_DEFAULT_IDLE, function() for k,v in pairs(keys) do for _,key_nane in ipairs(v) do - aw[#aw+1] = awful.key({ "Mod4", }, key_nane, function () module.focus (k ) end) - aw[#aw+1] = awful.key({ "Mod4", "Mod1" }, key_nane, function () module.resize(k ) end) - aw[#aw+1] = awful.key({ "Mod4", "Shift" }, key_nane, function () module.move (k ) end) - aw[#aw+1] = awful.key({ "Mod4", "Shift", "Control" }, key_nane, function () module.move (k,nil ,true) end) - aw[#aw+1] = awful.key({ "Mod4", "Control" }, key_nane, function () module.focus (k,nil ,true) end) - aw[#aw+1] = awful.key({ "Mod4", "Mod1" , "Control" }, key_nane, function () module.screen(k ) end) + aw[#aw+1] = awful.key({ "Mod4", }, key_nane, function () module.focus (k ) end) + aw[#aw+1] = awful.key({ "Mod4", "Mod1" }, key_nane, function () module.resize(k ) end) + aw[#aw+1] = awful.key({ "Mod4", "Shift" }, key_nane, function () module.move (k ) end) + aw[#aw+1] = awful.key({ "Mod4", "Shift", "Control" }, key_nane, function () module.move (k,nil ,true) end) + aw[#aw+1] = awful.key({ "Mod4", "Control" }, key_nane, function () module.focus (k,nil ,true) end) + aw[#aw+1] = awful.key({ "Mod4", "Mod1" , "Control" }, key_nane, function () module.screen(k ) end) + aw[#aw+1] = awful.key({ "Mod1", "Shift", "Control", "Mod4" }, key_nane, function () module.screen(k,true ) end) if k == "left" or k =="right" then -- Conflict with my text editor, so I say no - aw[#aw+1] = awful.key({ "Mod1", "Control" }, key_nane, function () module.tag (k,nil ,true) end) - aw[#aw+1] = awful.key({ "Mod1", "Shift", "Control" }, key_nane, function () module.tag (k,true,true) end) + aw[#aw+1] = awful.key({ "Mod1", "Control" }, key_nane, function () module.tag (k,nil ,true) end) + aw[#aw+1] = awful.key({ "Mod1", "Shift", "Control" }, key_nane, function () module.tag (k,true,true) end) end end end diff --git a/max.lua b/max.lua index 2c48e8d..a246966 100644 --- a/max.lua +++ b/max.lua @@ -95,7 +95,7 @@ local function draw_shape(s,collection,current_idx,icon_f,y,text_height) -- Borders and background cr3:set_source(k==current_idx and focus or nornal) util.draw_round_rect(cr3,dx+border,0+border,width-2*border,height-2*border,rad) - cr3:set_line_width(2*border) + cr3:set_line_width(2*border + 4) -- The 4 is required to cover the non-antialiased region cr3:stroke_preserve() cr3:set_source(bg) cr3:fill() diff --git a/screen.lua b/screen.lua index acdc281..0c23dc8 100644 --- a/screen.lua +++ b/screen.lua @@ -98,7 +98,7 @@ local function init_wiboxes(direction) return true end -local function next_screen(ss,dir) +local function next_screen(ss,dir,move) local scr_index = ss for k,s in ipairs(screens) do if ss == s then @@ -115,21 +115,28 @@ local function next_screen(ss,dir) local geom = capi.screen[scr_index].geometry capi.mouse.coords({x=geom.x+geom.width/2,y=geom.y+geom.height/2+55}) - local c = awful.mouse.client_under_pointer() - if c then - capi.client.focus = c + + if move then + local t = awful.tag.selected(ss) + awful.tag.setscreen(t,scr_index) + awful.tag.viewonly(t) + else + local c = awful.mouse.client_under_pointer() + if c then + capi.client.focus = c + end end return scr_index end -function module.display(_,dir) +function module.display(_,dir,move) if #wiboxes == 0 then init_wiboxes(dir) end module.reload(nil,direction) local ss,opss = capi.client.focus and capi.client.focus.screen or capi.mouse.screen,pss - next_screen(ss,dir) + next_screen(ss,dir,move) module.reload(nil,direction) end @@ -141,10 +148,11 @@ function module.hide() end end -function module.reload(_,dir) +function module.reload(mod,dir,__,___,move) +print("LA",mod and #mod) local ss,opss = capi.client.focus and capi.client.focus.screen or capi.mouse.screen,pss if dir then - ss = next_screen(ss,dir:lower()) + ss = next_screen(ss,dir:lower(),move or (mod and #mod == 4)) end if pss ~= ss then