use systemctl for poweroff/reboot/suspend
parent
edd6a2b6c4
commit
b7f864618d
|
@ -43,7 +43,7 @@ end
|
||||||
beautiful.init("/home/yorick/dotfiles/awesome/theme.lua")
|
beautiful.init("/home/yorick/dotfiles/awesome/theme.lua")
|
||||||
|
|
||||||
-- This is used later as the default terminal and editor to run.
|
-- This is used later as the default terminal and editor to run.
|
||||||
terminal = "urxvt"
|
terminal = "urxvtc"
|
||||||
editor = os.getenv("EDITOR") or "nano"
|
editor = os.getenv("EDITOR") or "nano"
|
||||||
editor_cmd = terminal .. " -e " .. editor
|
editor_cmd = terminal .. " -e " .. editor
|
||||||
|
|
||||||
|
@ -85,21 +85,10 @@ end
|
||||||
tags = {}
|
tags = {}
|
||||||
for s = 1, screen.count() do
|
for s = 1, screen.count() do
|
||||||
-- Each screen has its own tag table.
|
-- Each screen has its own tag table.
|
||||||
tags[s] = awful.tag({ 1, 2, 3, 4, 5, 6, 7, 8, 9 }, s, layouts[1])
|
tags[s] = awful.tag({ "w", "d", "c", 4, 5, 6, 7, 8, 9 }, s, layouts[1])
|
||||||
end
|
end
|
||||||
-- }}}
|
-- }}}
|
||||||
|
|
||||||
local upower = [[dbus-send --print-reply \
|
|
||||||
--system \
|
|
||||||
--dest=org.freedesktop.UPower \
|
|
||||||
/org/freedesktop/UPower \
|
|
||||||
org.freedesktop.UPower.]]
|
|
||||||
local consolkit = [[dbus-send --print-reply \
|
|
||||||
--system \
|
|
||||||
--dest="org.freedesktop.ConsoleKit" \
|
|
||||||
/org/freedesktop/ConsoleKit/Manager \
|
|
||||||
org.freedesktop.ConsoleKit.Manager.]]
|
|
||||||
|
|
||||||
|
|
||||||
-- {{{ Menu
|
-- {{{ Menu
|
||||||
-- Create a laucher widget and a main menu
|
-- Create a laucher widget and a main menu
|
||||||
|
@ -122,9 +111,9 @@ myappsmenu = {
|
||||||
-- system
|
-- system
|
||||||
mysystemmenu = {
|
mysystemmenu = {
|
||||||
{ "lock", function () awful.util.spawn("xscreensaver-command -lock") end },
|
{ "lock", function () awful.util.spawn("xscreensaver-command -lock") end },
|
||||||
{ "Suspend", function() awful.util.spawn(upower.."Suspend") end },
|
{ "Suspend", "systemctl suspend" },
|
||||||
{ "Restart", consolkit.."Restart"},
|
{ "Restart", "systemctl reboot" },
|
||||||
{ "Shutdown", consolkit.."Stop"},
|
{ "Shutdown", "systemctl poweroff" },
|
||||||
}
|
}
|
||||||
|
|
||||||
mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon },
|
mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon },
|
||||||
|
@ -137,6 +126,17 @@ mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesom
|
||||||
mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon,
|
mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon,
|
||||||
menu = mymainmenu })
|
menu = mymainmenu })
|
||||||
|
|
||||||
|
|
||||||
|
awful.menu.menu_keys = { up = { "k", "Up" },
|
||||||
|
down = { "j", "Down" },
|
||||||
|
exec = { "l", "Return", "Right" },
|
||||||
|
-- the new item
|
||||||
|
enter = { "Right" },
|
||||||
|
--
|
||||||
|
back = { "h", "Left" },
|
||||||
|
close = { "q", "Escape" },
|
||||||
|
}
|
||||||
|
|
||||||
-- Menubar configuration
|
-- Menubar configuration
|
||||||
menubar.utils.terminal = terminal -- Set the terminal for applications that require it
|
menubar.utils.terminal = terminal -- Set the terminal for applications that require it
|
||||||
-- }}}
|
-- }}}
|
||||||
|
@ -309,7 +309,7 @@ globalkeys = awful.util.table.join(
|
||||||
-- Menubar
|
-- Menubar
|
||||||
awful.key({ modkey }, "p", function() menubar.show() end),
|
awful.key({ modkey }, "p", function() menubar.show() end),
|
||||||
-- locking
|
-- locking
|
||||||
awful.key({ modkey, "Control" }, "l", function () awful.util.spawn("xscreensaver-command -lock") end),
|
awful.key({ modkey, "Control", "Shift" }, "l", function () awful.util.spawn("xscreensaver-command -lock") end),
|
||||||
-- brightness adjustment
|
-- brightness adjustment
|
||||||
awful.key({ }, "XF86MonBrightnessDown", function() awful.util.spawn("/home/yorick/dotfiles/bin/brightne.sh down") end),
|
awful.key({ }, "XF86MonBrightnessDown", function() awful.util.spawn("/home/yorick/dotfiles/bin/brightne.sh down") end),
|
||||||
awful.key({ }, "XF86MonBrightnessUp", function() awful.util.spawn("/home/yorick/dotfiles/bin/brightne.sh up") end),
|
awful.key({ }, "XF86MonBrightnessUp", function() awful.util.spawn("/home/yorick/dotfiles/bin/brightne.sh up") end),
|
||||||
|
|
Loading…
Reference in New Issue