summaryrefslogtreecommitdiff
path: root/rc.lua
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2017-01-26 12:25:52 +0100
committerAnton Khirnov <anton@khirnov.net>2017-01-26 12:25:52 +0100
commit9b322660ee6b7640af24def50a7fb8615a8ab126 (patch)
treea3064adc789a0ed91149432a15b86c66d7967c35 /rc.lua
parente8bb1f4a1844f07fc2f6973f2e7b400f2ddf2f3d (diff)
Basic support for desktops/pages.
Diffstat (limited to 'rc.lua')
-rw-r--r--rc.lua48
1 files changed, 19 insertions, 29 deletions
diff --git a/rc.lua b/rc.lua
index aef7510..eaf9de0 100644
--- a/rc.lua
+++ b/rc.lua
@@ -13,8 +13,8 @@ local menubar = require("menubar")
local bindings = require("bindings")
local commondefs = require("commondefs")
-local desktop = require("desktop")
local pager = require("pager")
+local workspace = require("workspace")
-- {{{ Error handling
-- Check if awesome encountered an error during startup and fell back to
@@ -43,7 +43,7 @@ end
-- {{{ Variable definitions
-- Themes define colours, icons, font and wallpapers.
-beautiful.init("/usr/share/awesome/themes/default/theme.lua")
+beautiful.init(awful.util.getdir("config") .. "/theme.lua")
-- Table of layouts to cover with awful.layout.inc, order matters.
local layouts =
@@ -54,16 +54,8 @@ local layouts =
-- }}}
-- {{{ Tags
--- Define a tag table which hold all screen tags.
-tags = {}
-for s = 1, screen.count() do
- -- Each screen has its own tag table.
- tags[s] = awful.tag({ 1, 2, 3, 4, 5, 6, 7, 8, 9 }, s, layouts[1])
-end
-
-desktops = {}
-
-desktops[1] = desktop.Desktop:new("main", 10)
+workspace = workspace.Workspace:new(layouts)
+workspace:add_desktop("main", 10)
-- }}}
-- Menubar configuration
@@ -78,15 +70,7 @@ mytextclock = awful.widget.textclock()
mywibox = {}
mypromptbox = {}
mylayoutbox = {}
-mytaglist = {}
-mytaglist.buttons = awful.util.table.join(
- awful.button({ }, 1, awful.tag.viewonly),
- awful.button({ commondefs.modkey }, 1, awful.client.movetotag),
- awful.button({ }, 3, awful.tag.viewtoggle),
- awful.button({ commondefs.modkey }, 3, awful.client.toggletag),
- awful.button({ }, 4, function(t) awful.tag.viewnext(awful.tag.getscreen(t)) end),
- awful.button({ }, 5, function(t) awful.tag.viewprev(awful.tag.getscreen(t)) end)
- )
+
mytasklist = {}
mytasklist.buttons = awful.util.table.join(
awful.button({ }, 1, function (c)
@@ -136,18 +120,22 @@ for s = 1, screen.count() do
awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end),
awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end)))
- -- Create a taglist widget
- mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.filter.all, mytaglist.buttons, nil, nil, wibox.layout.fixed.vertical())
-
-- Create a tasklist widget
--mytasklist[s] = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons, nil, nil, wibox.layout.fixed.vertical())
- pgr = pager.Pager:new(desktops[1])
- pgr:set_desktop(desktops[1])
+ local pgr = pager.Pager:new(s, 128, 800)
+ 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)
+
-- Widgets that are aligned to the left
local left_layout = wibox.layout.fixed.vertical()
- left_layout:add(mytaglist[s])
left_layout:add(mypromptbox[s])
-- Widgets that are aligned to the right
@@ -181,8 +169,10 @@ clientbuttons = awful.util.table.join(
awful.button({ commondefs.modkey }, 1, awful.mouse.client.move),
awful.button({ commondefs.modkey }, 3, awful.mouse.client.resize))
+local globalkeys, clientkeys = bindings.create(workspace)
+
-- Set keys
-root.keys(bindings.globalkeys)
+root.keys(globalkeys)
-- {{{ Rules
-- Rules to apply to new clients (through the "manage" signal).
@@ -193,7 +183,7 @@ awful.rules.rules = {
border_color = "#000000",
focus = awful.client.focus.filter,
raise = true,
- keys = bindings.clientkeys,
+ keys = clientkeys,
buttons = clientbuttons } },
{ rule = { class = "MPlayer" },
properties = { floating = true } },