How to propose several rc files to awesome so it doesn't crash?

The idea is to have a rescue rc file in addition to the normal rc file. The rescue file is read, only if the normal one failed (so awesome doesn't crash during a restart).

What I thought is to make awesome load the normal rc file via require. Then check if all is OK, awesome won't crash. If it will, then load the rescue rc file.

My problem is that I don't know how to check that all is OK.

Note: I already use the restart function from awful.utils so no restart is attempted when the syntax of the rc file is wrong.

有帮助吗?

解决方案

awesome first looks for a config in your home directory ~/.config/awesome/rc.lua. When that config does not exist or fails /etc/xdg/awesome/rc.lua is loaded. There's your answer already.

I find that configuring awesome using Xephyr works best. In one terminal create a nested X Xephyr :1, in another terminal run awesome on that display:

export DISPLAY=:1
awesome

awesome can also use an alternative config using the -c or --config option:

awesome -c /path/to/config.lua
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top