From aee96b09461ae4e6e1b8377402ec1235741d3484 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Thu, 15 Dec 2016 10:27:31 +0100 Subject: more config. Getting there --- config/awesome/rc.lua | 54 ++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 40 insertions(+), 14 deletions(-) diff --git a/config/awesome/rc.lua b/config/awesome/rc.lua index 3ea2f5b..1477f51 100644 --- a/config/awesome/rc.lua +++ b/config/awesome/rc.lua @@ -14,6 +14,7 @@ local menubar = require("menubar") -- Load Debian menu entries require("debian.menu") require("volume") +require("weasel-rules") -- require("revelation") -- {{{ Error handling @@ -57,6 +58,7 @@ editor_cmd = terminal .. " -e " .. editor -- I suggest you to remap Mod4 to another key using xmodmap or other tools. -- However, you can use another modifier like Mod1, but it may interact with others. modkey = "Mod4" +modkey2 = "Mod3" -- Table of layouts to cover with awful.layout.inc, order matters. local layouts = @@ -258,7 +260,7 @@ globalkeys = awful.util.table.join( -- Standard program -- awful.key({ modkey, }, "Return", function () awful.util.spawn(terminal) end), - awful.key({ modkey, "Control" }, "r", awesome.restart), + --awful.key({ modkey, "Control" }, "r", awesome.restart), --awful.key({ modkey, "Shift" }, "q", awesome.quit), awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end), @@ -288,6 +290,7 @@ globalkeys = awful.util.table.join( awful.key({ "Ctrl", "Mod1" }, "BackSpace", awesome.quit), 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), awful.key({ modkey }, "m", function () awful.util.spawn_with_shell("xterm-mail") end), awful.key({ modkey, "Shift" }, "m", function () awful.util.spawn_with_shell("xterm-mail-cosy") end), awful.key({ modkey }, "i", function () awful.util.spawn_with_shell("xterm-irc") end), @@ -306,8 +309,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), - awful.key({ "Control", "Mod1"}, "l", function () awful.util.spawn("loginctl lock-session") end), - awful.key({ "Control", "Mod1"}, "End", function () awful.util.spawn_with_shell("systemctl suspend -i; xdg-screensaver reset; loginctl unlock-session") end), + --KDE--awful.key({ "Control", "Mod1"}, "l", function () awful.util.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( {"Ctrl"}, "Tab", revelation), @@ -339,22 +342,24 @@ globalkeys = awful.util.table.join( "1", "2", "3", "4", "5", "q", "w", "e", "r", "t", "a", "s", "d", "f", "g" } + -- local modkeytag = modkey2 + local modkeytag = modkey for i = 1, #tag_keys do globalkeys = awful.util.table.join(globalkeys, -- View tag only. - awful.key({ "Mod3" }, tag_keys[i], function () + awful.key({ modkeytag }, tag_keys[i], function () local screen = mouse.screen local tag = awful.tag.gettags(screen)[i] if tag then awful.tag.viewonly(tag) end end), -- Toggle tag. - awful.key({ "Mod3", "Shift" }, tag_keys[i], function () + awful.key({ modkeytag, "Shift" }, tag_keys[i], function () local screen = mouse.screen local tag = awful.tag.gettags(screen)[i] if tag then awful.tag.viewtoggle(tag) end end), -- Move client to tag. - awful.key({ "Mod3", "Control" }, tag_keys[i], function () + awful.key({ modkeytag, "Control" }, tag_keys[i], function () if client.focus then local tag = awful.tag.gettags(client.focus.screen)[i] if tag then @@ -364,7 +369,7 @@ globalkeys = awful.util.table.join( end end), -- Toggle tag. - awful.key({ "Mod3", "Control", "Shift" }, tag_keys[i], function () + awful.key({ modkeytag, "Control", "Shift" }, tag_keys[i], function () if client.focus then local tag = awful.tag.gettags(client.focus.screen)[i] if tag then awful.client.toggletag(tag) end @@ -374,7 +379,7 @@ globalkeys = awful.util.table.join( end clientkeys = awful.util.table.join( - awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen end), + -- awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen end), -- 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), @@ -382,9 +387,28 @@ clientkeys = awful.util.table.join( -- awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end), -- weasel - awful.key({ modkey }, "q", function (c) c.sticky = not c.sticky end), + awful.key({ modkey }, "q", function (c) + if c.sticky then + local screen = mouse.screen + -- local tags = awful.tag.selectedlist(screen) + -- awful.client.movetotag(tags[1]) + local tag = awful.tag.selected(screen) + awful.client.movetotag(tag) + end + c.sticky = not c.sticky + end), + --awful.key({ modkey, }, "c", + -- function (c) + -- c.maximized_horizontal = not c.maximized_horizontal + -- c.maximized_vertical = not c.maximized_vertical + -- end), + awful.key({ modkey2, }, "m", + function (c) + c.maximized_horizontal = not c.maximized_horizontal + c.maximized_vertical = not c.maximized_vertical + end), awful.key({ modkey }, "Escape", function (c) c:kill() end) --awful.key({ modkey, }, "n", @@ -431,6 +455,7 @@ awful.rules.rules = { -- properties = { tag = tags[1][2] } }, } -- }}} +awful.rules.rules = awful.util.table.join(awful.rules.rules, get_weasel_rules()) -- {{{ Signals -- Signal function to execute when a new client appears. @@ -458,8 +483,8 @@ client.connect_signal("manage", function (c, startup) awful.placement.no_offscreen(c) end - local titlebars_enabled = false - -- local titlebars_enabled = true + -- local titlebars_enabled = false + local titlebars_enabled = true if titlebars_enabled and (c.type == "normal" or c.type == "dialog") then -- buttons for the titlebar local buttons = awful.util.table.join( @@ -511,9 +536,10 @@ client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_n terminal = "urxvt" awful.util.spawn("nm-applet") +awful.util.spawn("klipper") -- awful.util.spawn("xscreensaver -no-splash") -awful.util.spawn("X-screensaver") -awful.util.spawn_with_shell("pkill -x -f clipit; clipit") +--KDE--awful.util.spawn("X-screensaver") +--KDE--awful.util.spawn_with_shell("pkill -x -f clipit; clipit") awful.util.spawn_with_shell("pkill -x -f 'alsa-volume-monitor hw:0'; alsa-volume-monitor hw:0") --- vim:set softtabstop=4:ts=4:shiftwidth=4: +-- vim:set softtabstop=4:ts=4:shiftwidth=4:et=1: -- cgit v1.2.3