dotfiles/awesome/main/menu.lua

69 lines
1.8 KiB
Lua

--- awesome stdlib
local awful = require("awful")
local hotkeys_popup = require("awful.hotkeys_popup").widget
--- theme lib
local beautiful = require("beautiful") --- for awesome.icon
local M = {}
local _M = {}
------------------------------------------
--- import preferred programs
local terminal = RC.vars.terminal
local file_manager = RC.vars.file_manager
--- import editor variable from OS environment
local editor = os.getenv("EDITOR") or "nano"
local editor_cmd = terminal .. " -e " .. editor
------------------------------------------
--- make it harder to quit awesome accidentally
M.quitmenu =
{{ "i mean it!",
function() awesome.quit() end }}
--- "awesome" menu
M.awesome = {
{ "hotkeys",
function()
hotkeys_popup.show_help(nil,awful.screen.focused())
end },
{ "manual",
terminal .. " -e man awesome" },
{ "edit config",
editor_cmd .. " " .. awesome.conffile },
{ "terminal", terminal },
{ "restart", awesome.restart },
{ "quit", M.quitmenu }
}
--- stuff that doesn't show up in rofi
M.misc = {
{ "youtube",
"/usr/lib64/chromium-browser/chromium-browser.sh\
--profile-directory=Default\
--app-id=agimnkijcaahngcdmfeangaknmldooml" },
}
------------------------------------------
function _M.get()
--- main menu
local menu_items = {
{ "awesome",
M.awesome, beautiful.awesome_subicon },
{ "terminal", terminal },
{ "files" , file_manager },
{ "search" , "catfish" },
{ "wally" , "wally" },
{ "misc" , M.misc }
}
return menu_items
end
------------------------------------------
return setmetatable({}, { __call = function(_, ...) return _M.get(...) end })