summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pager.lua2
-rw-r--r--rc.lua28
-rw-r--r--utils.lua8
-rw-r--r--workspace.lua20
4 files changed, 29 insertions, 29 deletions
diff --git a/pager.lua b/pager.lua
index dd69cef..cdffe47 100644
--- a/pager.lua
+++ b/pager.lua
@@ -93,7 +93,7 @@ end
local function pager_set_desktop(self, desktop)
local init_data = self.init_data
- print("pager " .. init_data.screen .. " set desktop")
+ print("pager " .. init_data.screen.index .. " set desktop")
self:reset()
diff --git a/rc.lua b/rc.lua
index 6806402..531b11a 100644
--- a/rc.lua
+++ b/rc.lua
@@ -55,9 +55,9 @@ local layouts =
-- {{{ Tags
workspace = workspace.Workspace:new(layouts)
-for s = 1, screen.count() do
- workspace:add_desktop(s, "Desktop " .. s, 10)
- workspace:view(s, s, 1)
+for s in screen do
+ workspace:add_desktop(s.index, "Desktop " .. s.index, 10)
+ workspace:view(s, s.index, 1)
end
-- }}}
@@ -67,7 +67,7 @@ menubar.utils.terminal = terminal -- Set the terminal for applications that requ
-- {{{ Wibox
-- Create a textclock widget
-mytextclock = awful.widget.textclock()
+mytextclock = wibox.widget.textclock()
-- Create a wibox for each screen and add it
mywibox = {}
@@ -111,7 +111,7 @@ mytasklist.buttons = awful.util.table.join(
if client.focus then client.focus:raise() end
end))
-for s = 1, screen.count() do
+for s in screen do
-- Create a promptbox for each screen
mypromptbox[s] = awful.widget.prompt()
-- Create an imagebox widget which will contains an icon indicating which layout we're using.
@@ -129,13 +129,13 @@ for s = 1, screen.count() do
pgr:set_desktop(workspace.desktops[1])
mytasklist[s] = pgr
- workspace.signals:connect_signal("desktop:view",
- function(signals, screen_idx, desktop)
- print("desktop:view " .. desktop .. " on " .. screen_idx)
- if screen_idx == s then
- pgr:set_desktop(workspace.desktops[desktop])
- end
- end)
+ workspace.signals:connect_signal("desktop:view",
+ function(signals, view_screen, desktop)
+ print("desktop:view " .. desktop .. " on " .. view_screen.index)
+ if view_screen == s then
+ pgr:set_desktop(workspace.desktops[desktop])
+ end
+ end)
-- Widgets that are aligned to the left
local left_layout = wibox.layout.fixed.vertical()
@@ -143,7 +143,7 @@ for s = 1, screen.count() do
-- Widgets that are aligned to the right
local right_layout = wibox.layout.fixed.vertical()
- if s == 1 then right_layout:add(wibox.widget.systray()) end
+ if s.index == 1 then right_layout:add(wibox.widget.systray()) end
right_layout:add(mytextclock)
right_layout:add(mylayoutbox[s])
@@ -154,7 +154,7 @@ for s = 1, screen.count() do
layout:set_bottom(right_layout)
-- Create the wibox
- mywibox[s] = awful.wibox({ position = "right", screen = s, width = 128 })
+ mywibox[s] = awful.wibar({ position = "right", screen = s, width = 128 })
mywibox[s]:set_widget(layout)
end
-- }}}
diff --git a/utils.lua b/utils.lua
index 1df9690..d1f76dd 100644
--- a/utils.lua
+++ b/utils.lua
@@ -17,15 +17,15 @@ local function map_screen_physical(n)
table.sort(screens, screen_cmp)
if screens[n] ~= nil then
- return screens[n][1]
+ return screens[n][2]
end
return nil
end
local function screen_focus_physical(n)
- local idx_logical = map_screen_physical(n)
- if idx_logical then
- awful.screen.focus(idx_logical)
+ local s = map_screen_physical(n)
+ if s then
+ awful.screen.focus(s)
end
end
diff --git a/workspace.lua b/workspace.lua
index 0ac91c3..0d7d12a 100644
--- a/workspace.lua
+++ b/workspace.lua
@@ -20,25 +20,25 @@ end
function Workspace:_apply_state()
orig_focus = mouse.screen
- for s = 1, screen.count() do
+ for s in screen do
if self.screen_state[s] then
awful.tag.viewnone(s)
desk = self.screen_state[s].desktop
page = self.desktops[desk].pages[self.screen_state[s].page]
- awful.tag.setscreen(page, s)
+ page.screen = s
end
end
- for s = 1, screen.count() do
+ for s in screen do
state = self.screen_state[s]
if state then
desk_idx = state.desktop
desk = self.desktops[desk_idx]
page_idx = state.page
page = desk.pages[page_idx]
- print("workspace displaying: " .. s .. " => " .. desk_idx .. "/" .. page_idx)
+ print("workspace displaying: " .. s.index .. " => " .. desk_idx .. "/" .. page_idx)
- awful.tag.viewonly(page)
+ page:view_only()
desk:emit_signal("page:view", s, page_idx)
end
@@ -48,14 +48,14 @@ function Workspace:_apply_state()
end
function Workspace:view(screen, desktop, page_idx)
- print("workspace: " .. screen .. ": view " .. desktop .. "/" .. (page_idx or "nil"))
+ print("workspace: " .. screen.index .. ": view " .. desktop .. "/" .. (page_idx or "nil"))
-- the page currently displayed on the target screen
old = {}
if self.screen_state[screen] then
old.desk = self.screen_state[screen].desktop
old.page_idx = self.screen_state[screen].page
old.page = self.desktops[old.desk].pages[page_old_idx]
- print(screen .. " now showing " .. old.desk .. "/" .. old.page_idx)
+ print(screen.index .. " now showing " .. old.desk .. "/" .. old.page_idx)
end
-- the page to display on the target screen
@@ -67,8 +67,8 @@ function Workspace:view(screen, desktop, page_idx)
-- the screen on which the new page is currently displayed (if any)
screen_cur = nil
if page_new and page_new.selected then
- screen_cur = awful.tag.getscreen(page_new)
- print("page " .. page_idx .. " now displayed on " .. screen_cur)
+ screen_cur = page_new.screen
+ print("page " .. page_idx .. " now displayed on " .. screen_cur.index)
end
if old.page ~= page_new or page_new == nil then
@@ -94,7 +94,7 @@ end
function Workspace:view_relative(offset, screen)
screen = screen or mouse.screen
- print("view relative " .. offset .. " on " .. screen)
+ print("view relative " .. offset .. " on " .. screen.index)
state = self.screen_state[screen]
if state then