pinnacle/api/lua/example_config.lua

43 lines
1.6 KiB
Lua
Raw Normal View History

2023-06-22 01:03:27 +02:00
-- Just like in Awesome, if you want access to Luarocks packages, this needs to be called.
-- NOTE: The loader doesn't load from the local Luarocks directory (probably in ~/.luarocks),
-- | so if you have any rocks installed with --local,
-- | you may need to add those paths to package.path and package.cpath.
-- Alternatively, you can add
-- eval $(luarocks path --bin)
-- to your shell's startup script to permanently have access to Luarocks in all your Lua files.
pcall(require, "luarocks.loader")
-- Neovim users be like:
2023-06-20 02:09:05 +02:00
require("pinnacle").setup(function(pinnacle)
local input = pinnacle.input --Key and mouse binds
local client = pinnacle.client --Window management
local process = pinnacle.process -- Process spawning
-- Every key supported by xkbcommon.
-- Support for just putting in a string of a key is intended.
local keys = input.keys
-- Keybinds ----------------------------------------------------------------------
2023-06-22 02:12:27 +02:00
input.keybind({ "Ctrl", "Alt" }, keys.q, pinnacle.quit)
input.keybind({ "Ctrl", "Alt" }, keys.c, client.close_window)
2023-06-21 21:48:38 +02:00
input.keybind({ "Ctrl", "Alt" }, keys.space, client.toggle_floating)
input.keybind({ "Ctrl" }, keys.Return, function()
process.spawn("alacritty", function(stdout, stderr, exit_code, exit_msg)
-- do something with the output here
end)
end)
input.keybind({ "Ctrl" }, keys.KEY_1, function()
process.spawn("kitty")
end)
input.keybind({ "Ctrl" }, keys.KEY_2, function()
process.spawn("foot")
end)
input.keybind({ "Ctrl" }, keys.KEY_3, function()
process.spawn("nautilus")
end)
2023-06-20 02:09:05 +02:00
end)