ma awesome: make locker configurable

This commit is contained in:
makefu 2018-03-13 11:34:28 +01:00
parent 325be7a661
commit 28324a02d9
No known key found for this signature in database
GPG Key ID: 36F7711F3FC0F225
4 changed files with 24 additions and 22 deletions

View File

@ -21,7 +21,9 @@ let
This module will use substituteAll to replace strings before writing to This module will use substituteAll to replace strings before writing to
/etc/xdg/awesome/rc.lua /etc/xdg/awesome/rc.lua
''; '';
default = pkgs.awesomecfg.full; default = pkgs.awesomecfg.full.override {
locker = "${pkgs.i3lock}/bin/i3lock -i /var/lib/wallpaper/wallpaper";
};
}; };
}; };
imp = { imp = {

View File

@ -1,23 +1,23 @@
{ pkgs { pkgs
, lib , lib
, alsaUtils , alsaUtils
, xlockmore
, xbacklight , xbacklight
, modkey?"Mod4" , modkey?"Mod4"
, locker? "${pkgs.xlock}/bin/xlock -mode blank"
, ... }: , ... }:
{ {
# replace: @alsaUtils@ @xlockmore@ @xbacklight@ @modkey@ # replace: @alsaUtils@ @xlockmore@ @xbacklight@ @modkey@
full = lib.makeOverridable pkgs.substituteAll { full = lib.makeOverridable pkgs.substituteAll {
name = "awesome_full_config"; name = "awesome_full_config";
inherit alsaUtils xlockmore xbacklight modkey; inherit alsaUtils locker xbacklight modkey;
isExecutable = false; isExecutable = false;
src = ./full.cfg; src = ./full.cfg;
}; };
kiosk = lib.makeOverridable pkgs.substituteAll { kiosk = lib.makeOverridable pkgs.substituteAll {
name = "awesome_kiosk_config"; name = "awesome_kiosk_config";
inherit alsaUtils xlockmore xbacklight modkey; inherit alsaUtils locker xbacklight modkey;
isExecutable = false; isExecutable = false;
src = ./kiosk.lua; src = ./kiosk.lua;
}; };

View File

@ -243,7 +243,7 @@ awful.screen.connect_for_each_screen(function(s)
set_wallpaper(s) set_wallpaper(s)
-- Each screen has its own tag table. -- Each screen has its own tag table.
awful.tag({ "tmp", "news", "www", "im", "work1","work2","net","misc","remote" }, s, awful.layout.layouts[1]) awful.tag({ "tmp", "news", "www", "im", "work1","work2","net","misc","remote" }, s, awful.layout.layouts[1])
-- Create a promptbox for each screen -- Create a promptbox for each screen
s.mypromptbox = awful.widget.prompt() s.mypromptbox = awful.widget.prompt()
@ -277,10 +277,10 @@ awful.screen.connect_for_each_screen(function(s)
{ -- Right widgets { -- Right widgets
layout = wibox.layout.fixed.horizontal, layout = wibox.layout.fixed.horizontal,
mykeyboardlayout, mykeyboardlayout,
mailwidget, mailwidget,
wibox.widget.systray(), wibox.widget.systray(),
cpuwidget, cpuwidget,
batwidget, batwidget,
mytextclock, mytextclock,
s.mylayoutbox, s.mylayoutbox,
}, },
@ -379,19 +379,19 @@ globalkeys = awful.util.table.join(
-- Prompt -- Prompt
awful.key({ modkey }, "r", function () awful.screen.focused().mypromptbox:run() end, awful.key({ modkey }, "r", function () awful.screen.focused().mypromptbox:run() end,
{description = "run prompt", group = "launcher"}), {description = "run prompt", group = "launcher"}),
awful.key({ modkey,"Control" }, "BackSpace", function () awful.util.spawn("@xlockmore@/bin/xlock -mode blank") end), awful.key({ modkey,"Control" }, "BackSpace", function () awful.util.spawn("@locker@") end),
awful.key({ }, "XF86ScreenSaver", function () awful.util.spawn("@xlockmore@/bin/xlock -mode blank") end), awful.key({ }, "XF86ScreenSaver", function () awful.util.spawn("@locker@") end),
awful.key({ modkey }, "x", awful.key({ modkey }, "x",
function () function ()
awful.prompt.run { awful.prompt.run {
prompt = "Run Lua code: ", prompt = "Run Lua code: ",
textbox = awful.screen.focused().mypromptbox.widget, textbox = awful.screen.focused().mypromptbox.widget,
exe_callback = awful.util.eval, exe_callback = awful.util.eval,
history_path = awful.util.get_cache_dir() .. "/history_eval" history_path = awful.util.get_cache_dir() .. "/history_eval"
} }
end, end,
{description = "lua execute prompt", group = "awesome"}), {description = "lua execute prompt", group = "awesome"}),
-- Menubar -- Menubar
awful.key({ modkey }, "p", function() menubar.show() end) awful.key({ modkey }, "p", function() menubar.show() end)

View File

@ -331,8 +331,8 @@ globalkeys = awful.util.table.join(
-- Prompt -- Prompt
awful.key({ modkey }, "r", function () mypromptbox[mouse.screen]:run() end), awful.key({ modkey }, "r", function () mypromptbox[mouse.screen]:run() end),
-- awful.key({ modkey }, "r", function () awful.util.spawn( "dmenu_run" ) end ), -- awful.key({ modkey }, "r", function () awful.util.spawn( "dmenu_run" ) end ),
awful.key({ modkey,"Control" }, "BackSpace", function () awful.util.spawn("xlock -mode blank") end), awful.key({ modkey,"Control" }, "BackSpace", function () awful.util.spawn("@locker@") end),
awful.key({ }, "XF86ScreenSaver", function () awful.util.spawn("xlock -mode blank") end), awful.key({ }, "XF86ScreenSaver", function () awful.util.spawn("@locker@") end),
awful.key({ modkey }, "x", awful.key({ modkey }, "x",
function () function ()