summaryrefslogtreecommitdiff
path: root/config/awesome/rc.lua
diff options
context:
space:
mode:
Diffstat (limited to 'config/awesome/rc.lua')
-rw-r--r--config/awesome/rc.lua139
1 files changed, 70 insertions, 69 deletions
diff --git a/config/awesome/rc.lua b/config/awesome/rc.lua
index 91d78f7..112ac19 100644
--- a/config/awesome/rc.lua
+++ b/config/awesome/rc.lua
@@ -104,57 +104,60 @@ menubar.utils.terminal = terminal -- Set the terminal for applications that requ
-- {{{ Wibox
-- Create a textclock widget
-mytextclock = awful.widget.textclock(nil, 5)
+mytextclock = wibox.widget.textclock(nil, 5)
-- Create a wibox for each screen and add it
-mywibox = {}
-mypromptbox = {}
-mylayoutbox = {}
-mytaglist = {}
-mytaglist.buttons = awful.util.table.join(
- awful.button({ }, 1, awful.tag.viewonly),
- awful.button({ modkey }, 1, awful.client.movetotag),
- awful.button({ }, 3, awful.tag.viewtoggle),
- awful.button({ 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)
- if c == client.focus then
- c.minimized = true
- else
- -- Without this, the following
- -- :isvisible() makes no sense
- c.minimized = false
- if not c:isvisible() then
- awful.tag.viewonly(c:tags()[1])
+local taglist_buttons = awful.util.table.join(
+ awful.button({ }, 1, function(t) t:view_only() end ),
+ awful.button({ modkey }, 1, function(t)
+ if client.focus then
+ client.focus:move_to_tag(t)
+ end
+ end),
+ awful.button({ }, 3, awful.tag.viewtoggle),
+ awful.button({ modkey }, 3, function(t)
+ if client.focus then
+ client.focus:toggle_tag(t)
+ end
+ end),
+ awful.button({ }, 4, function(t) awful.tag.viewnext(t.screen) end),
+ awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end)
+ )
+local tasklist_buttons = awful.util.table.join(
+ awful.button({ }, 1, function (c)
+ if c == client.focus then
+ c.minimized = true
+ else
+ -- Without this, the following
+ -- :isvisible() makes no sense
+ c.minimized = false
+ if not c:isvisible() and c.first_tag then
+ c:tags()[1]:view_only()
+ end
+ -- This will also un-minimize
+ -- the client, if needed
+ client.focus = c
+ -- c:raise()
end
- -- This will also un-minimize
- -- the client, if needed
- client.focus = c
- -- c:raise()
- end
- end),
- awful.button({ }, 3, function ()
- if instance then
- instance:hide()
- instance = nil
- else
- instance = awful.menu.clients({
- theme = { width = 250 }
- })
- end
- end),
- awful.button({ }, 4, function ()
- awful.client.focus.byidx(1)
- if client.focus then client.focus:raise() end
- end),
- awful.button({ }, 5, function ()
- awful.client.focus.byidx(-1)
- if client.focus then client.focus:raise() end
- end))
+ end),
+ awful.button({ }, 3, function ()
+ if instance then
+ instance:hide()
+ instance = nil
+ else
+ instance = awful.menu.clients({
+ theme = { width = 250 }
+ })
+ end
+ end),
+ awful.button({ }, 4, function ()
+ awful.client.focus.byidx(1)
+ if client.focus then client.focus:raise() end
+ end),
+ awful.button({ }, 5, function ()
+ awful.client.focus.byidx(-1)
+ if client.focus then client.focus:raise() end
+ end))
local function set_wallpaper(s)
-- Wallpaper
@@ -184,12 +187,10 @@ awful.screen.connect_for_each_screen(function(s)
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.horizontal())
- s.mytaglist = awful.widget.taglist(s, awful.widget.taglist.filter.all, mytaglist.buttons)
+ s.mytaglist = awful.widget.taglist(s, awful.widget.taglist.filter.all, taglist_buttons)
-- Create a tasklist widget
- -- mytasklist[s] = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons)
- s.mytasklist = awful.widget.tasklist(s, awful.widget.tasklist.filter.alltags, mytasklist.buttons)
+ s.mytasklist = awful.widget.tasklist(s, awful.widget.tasklist.filter.alltags, tasklist_buttons)
-- Create the wibox
s.mywibox = awful.wibox({ position = "bottom", screen = s })
@@ -202,7 +203,7 @@ awful.screen.connect_for_each_screen(function(s)
-- Widgets that are aligned to the right
local right_layout = wibox.layout.fixed.horizontal()
- if s == 1 then right_layout:add(wibox.widget.systray()) end
+ right_layout:add(wibox.widget.systray())
right_layout:add(battery_widget)
right_layout:add(volume_widget)
right_layout:add(mytextclock)
@@ -259,7 +260,7 @@ globalkeys = awful.util.table.join(
end),
-- Standard program
- -- awful.key({ modkey, }, "Return", function () awful.util.spawn(terminal) end),
+ -- awful.key({ modkey, }, "Return", function () awful.spawn(terminal) end),
--awful.key({ modkey, "Control" }, "r", awesome.restart),
--awful.key({ modkey, "Shift" }, "q", awesome.quit),
@@ -308,15 +309,15 @@ globalkeys = awful.util.table.join(
awful.key({ modkey, }, "F4", function () awful.layout.set(awful.layout.suit.max) end),
awful.key({ }, "XF86AudioRaiseVolume", function ()
- awful.util.spawn("amixer -q -D default sset Master 5%+", false) end),
+ awful.spawn("amixer -q -D default sset Master 5%+", false) end),
awful.key({ }, "XF86AudioLowerVolume", function ()
- awful.util.spawn("amixer -q -D default sset Master 5%-", false) end),
+ awful.spawn("amixer -q -D default sset Master 5%-", false) end),
awful.key({ "Shift" }, "XF86AudioRaiseVolume", function ()
- awful.util.spawn("amixer -q -D default sset Master 1%+", false) end),
+ awful.spawn("amixer -q -D default sset Master 1%+", false) end),
awful.key({ "Shift" }, "XF86AudioLowerVolume", function ()
- awful.util.spawn("amixer -q -D default sset Master 1%-", false) end),
+ awful.spawn("amixer -q -D default sset Master 1%-", false) end),
awful.key({ }, "XF86AudioMute", function ()
- awful.util.spawn("amixer -q -D default sset Master toggle", false) end),
+ awful.spawn("amixer -q -D default sset Master toggle", false) end),
awful.key({ modkey }, "x", function () awful.util.spawn_with_shell("urxvt") end),
awful.key({ modkey, "Shift" }, "x", function () awful.util.spawn_with_shell("urxvt -title FURxvt") end),
@@ -327,8 +328,8 @@ globalkeys = awful.util.table.join(
-- awful.key({ "Control", "Mod1"}, "End", function () awful.util.spawn_with_shell("xscreensaver-command -lock; sleep 1; systemctl suspend") end),
--awful.key({ "Control", "Mod1"}, "l", function () awful.util.spawn_with_shell("xscreensaver-command -lock") end),
- -- awful.key({ "Control", "Mod1"}, "l", function () awful.util.spawn("xdg-screensaver lock") end),
- --KDE--awful.key({ "Control", "Mod1"}, "l", function () awful.util.spawn("loginctl lock-session") end),
+ -- awful.key({ "Control", "Mod1"}, "l", function () awful.spawn("xdg-screensaver lock") end),
+ --KDE--awful.key({ "Control", "Mod1"}, "l", function () awful.spawn("loginctl lock-session") end),
--KDE--awful.key({ "Control", "Mod1"}, "End", function () awful.util.spawn_with_shell("systemctl suspend -i; xdg-screensaver reset; loginctl unlock-session; xdg-screensaver reset") end),
-- awful.key({ "Control", "Mod1"}, "End", function () awful.util.spawn_with_shell("xscreensaver-command -lock; sleep 1; systemctl suspend") end),
-- awful.key({ "Control", "Mod1"}, "End", function () awful.util.spawn_with_shell("loginctl lock-session && systemctl suspend -i") end),
@@ -372,7 +373,7 @@ globalkeys = awful.util.table.join(
awful.key({ modkeytag }, tag_keys[i], function ()
local screen = awful.screen.focused()
local tag = screen.tags[i]
- if tag then awful.tag.viewonly(tag) end
+ if tag then tag:view_only() end
end),
-- Toggle tag.
awful.key({ modkeytag, "Shift" }, tag_keys[i], function ()
@@ -385,8 +386,7 @@ globalkeys = awful.util.table.join(
if client.focus then
local tag = client.focus.screen.tags[i]
if tag then
- awful.client.movetotag(tag)
- -- awful.tag.viewonly(tag)
+ client.focus:move_to_tag(tag)
end
end
end),
@@ -405,7 +405,7 @@ clientkeys = awful.util.table.join(
-- awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end),
awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ),
awful.key({ modkey, }, "Return", function (c) c:swap(awful.client.getmaster()) end),
- awful.key({ modkey, }, "o", awful.client.movetoscreen ),
+ awful.key({ modkey, }, "o", function (c) c:move_to_screen() end),
awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end),
-- weasel
@@ -414,7 +414,7 @@ clientkeys = awful.util.table.join(
if c.sticky then
local screen = awful.screen.focused()
local tag = awful.tag.selected(screen)
- awful.client.movetotag(tag)
+ client.focus:move_to_tag(tag)
end
c.sticky = not c.sticky
end),
@@ -525,7 +525,8 @@ awful.rules.rules = {
properties = { border_width = beautiful.border_width,
border_color = beautiful.border_normal,
focus = awful.client.focus.filter,
- screen = awful.screen.focused,
+ screen = awful.screen.preferred,
+ placement = awful.placement.no_overlap+awful.placement.no_offscreen,
raise = true,
keys = clientkeys,
buttons = clientbuttons } },
@@ -646,8 +647,8 @@ tag.connect_signal(
terminal = "urxvt"
awful.util.spawn_with_shell("pkill -x -f nm-applet; nm-applet")
--awful.util.spawn_with_shell("pkill -x -f klipper; klipper")
--- awful.util.spawn("xscreensaver -no-splash")
---KDE--awful.util.spawn("X-screensaver")
+-- awful.spawn("xscreensaver -no-splash")
+--KDE--awful.spawn("X-screensaver")
awful.util.spawn_with_shell("pkill -x -f clipit; clipit")
-- awful.util.spawn_with_shell("pkill -x -f dnssec-trigger-panel; dnssec-trigger-panel")
awful.util.spawn_with_shell("pkill -x -f 'alsa-volume-monitor hw:0'; alsa-volume-monitor hw:0")