Skip to content

Commit f289007

Browse files
authored
config/lua: init lua config manager, use lua if available (hyprwm#13817)
Adds a new lua config manager, which will automatically be used if there is a lua config present.
1 parent 4eb2c07 commit f289007

258 files changed

Lines changed: 19208 additions & 7356 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.clang-tidy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,5 @@ CheckOptions:
201201
readability-identifier-naming.EnumConstantCase: UPPER_CASE
202202
readability-identifier-naming.FunctionCase: camelBack
203203
readability-identifier-naming.NamespaceCase: CamelCase
204-
readability-identifier-naming.NamespacePrefix: N
205204
readability-identifier-naming.StructPrefix: S
206205
readability-identifier-naming.StructCase: CamelCase

.github/actions/setup_base/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ runs:
4545
libxkbcommon \
4646
libxkbfile \
4747
lld \
48+
lua \
4849
meson \
4950
muparser \
5051
ninja \

CMakeLists.txt

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ if(NOT HYPR_SHADER_GEN_RESULT EQUAL 0)
3434
endif()
3535

3636
find_package(PkgConfig REQUIRED)
37+
find_package(Python3 COMPONENTS Interpreter QUIET)
3738

3839
# Try to find canihavesomecoffee's udis86 using pkgconfig vmd/udis86 does not
3940
# provide a .pc file and won't be detected this way
@@ -268,7 +269,8 @@ pkg_check_modules(
268269
gio-2.0
269270
re2
270271
muparser
271-
lcms2)
272+
lcms2
273+
lua55)
272274

273275
find_package(hyprwayland-scanner 0.3.10 REQUIRED)
274276

@@ -437,6 +439,28 @@ endif()
437439

438440
# used by `make installheaders`, to ensure the headers are generated
439441
add_custom_target(generate-protocol-headers)
442+
443+
if(Python3_Interpreter_FOUND)
444+
add_custom_target(
445+
generate-lua-stubs ALL
446+
COMMAND ${Python3_EXECUTABLE} ${CMAKE_SOURCE_DIR}/meta/generateLuaStubs.py --root ${CMAKE_SOURCE_DIR}
447+
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
448+
COMMENT "Generating Lua API stubs for LuaLS"
449+
VERBATIM)
450+
451+
add_dependencies(hyprland_lib generate-lua-stubs)
452+
add_dependencies(Hyprland generate-lua-stubs)
453+
454+
add_custom_target(
455+
check-lua-stubs
456+
COMMAND ${Python3_EXECUTABLE} ${CMAKE_SOURCE_DIR}/meta/generateLuaStubs.py --root ${CMAKE_SOURCE_DIR} --check
457+
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
458+
COMMENT "Checking Lua API stubs are up to date"
459+
VERBATIM)
460+
else()
461+
message(FATAL_ERROR "Python3 interpreter not found, which is required for the build")
462+
endif()
463+
440464
set(PROTOCOL_SOURCES "")
441465

442466
function(protocolnew protoPath protoName external)
@@ -605,6 +629,10 @@ install(FILES ${INSTALLABLE_ASSETS}
605629
install(FILES ${CMAKE_SOURCE_DIR}/example/hyprland.conf
606630
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/hypr)
607631

632+
# LuaLS stubs
633+
install(FILES ${CMAKE_SOURCE_DIR}/meta/hl.meta.lua
634+
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/hypr/stubs)
635+
608636
# portal config
609637
install(FILES ${CMAKE_SOURCE_DIR}/assets/hyprland-portals.conf
610638
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/xdg-desktop-portal)

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,4 @@ format-fix:
108108

109109
test:
110110
$(MAKE) debug
111-
./build/hyprtester/hyprtester -c hyprtester/test.conf -b ./build/Hyprland -p hyprtester/plugin/hyprtestplugin.so
111+
./build/hyprtester/hyprtester -c hyprtester/test.lua -b ./build/Hyprland -p hyprtester/plugin/hyprtestplugin.so

docs/hyprctl.1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,12 @@ Lists all the layers.
123123
.RS
124124
.PP
125125
Returns the current random splash.
126+
\f[B]status\f[R]
127+
.RS
128+
.PP
129+
Returns internal status information like config format or backend.
130+
.RE
131+
.PP
126132
.RE
127133
.SH OPTIONS
128134
.PP

docs/hyprctl.1.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ INFO COMMANDS
8888

8989
Returns the current random splash.
9090

91+
**status**
92+
93+
Returns internal status information like config format or backend.
94+
9195
OPTIONS
9296
=======
9397

example/hyprland.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@ animations {
179179

180180
# See https://wiki.hypr.land/Configuring/Dwindle-Layout/ for more
181181
dwindle {
182-
pseudotile = true # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
183182
preserve_split = true # You probably want this
184183
}
185184

0 commit comments

Comments
 (0)