autogenerate layout list
This commit is contained in:
parent
5def70a8f0
commit
8416705a20
|
@ -68,6 +68,13 @@ uicbgen.h: $(awesome_SOURCES)
|
|||
@echo "generating uicbgen.h from headers file"
|
||||
@$(top_srcdir)/uicbgen.sh > $(top_srcdir)/uicbgen.h
|
||||
|
||||
CLEANFILES += layoutgen.h
|
||||
BUILT_SOURCES += layoutgen.h
|
||||
EXTRA_DIST += layoutgen.sh
|
||||
layoutgen.h: $(awesome_SOURCES)
|
||||
@echo "generating layoutgen.h from layouts headers file"
|
||||
@$(top_srcdir)/layoutgen.sh > $(top_srcdir)/layoutgen.h
|
||||
|
||||
CLEANFILES += widgetgen.h
|
||||
BUILT_SOURCES += widgetgen.h
|
||||
EXTRA_DIST += widgetgen.sh
|
||||
|
|
13
layout.c
13
layout.c
|
@ -38,18 +38,7 @@
|
|||
|
||||
extern AwesomeConf globalconf;
|
||||
|
||||
const name_func_link_t LayoutList[] =
|
||||
{
|
||||
{"tile", layout_tile},
|
||||
{"tileleft", layout_tileleft},
|
||||
{"tiledown", layout_tiledown},
|
||||
{"tileup", layout_tileup},
|
||||
{"max", layout_max},
|
||||
{"spiral", layout_spiral},
|
||||
{"dwindle", layout_dwindle},
|
||||
{"floating", layout_floating},
|
||||
{NULL, NULL}
|
||||
};
|
||||
#include "layoutgen.h"
|
||||
|
||||
/** Arrange windows following current selected layout
|
||||
* \param screen the screen to arrange
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
#!/bin/sh
|
||||
echo "/* This file is autogenerated by" $(basename $0) "*/"
|
||||
echo
|
||||
echo "const name_func_link_t LayoutList[] ="
|
||||
echo "{"
|
||||
for file in layouts/*.h
|
||||
do
|
||||
echo " /* $file */"
|
||||
grep '^LayoutArrange layout_' $file | cut -d' ' -f2 | cut -d\; -f1 | while read layout
|
||||
do
|
||||
shortname=$(echo $layout | cut -d _ -f2-)
|
||||
echo " {\"$shortname\", $layout},"
|
||||
done
|
||||
done
|
||||
|
||||
echo " {NULL, NULL}"
|
||||
echo "};"
|
Loading…
Reference in New Issue