add(debug) lld debugger with Xephyr

This commit is contained in:
Aire-One 2021-10-04 20:32:34 +02:00
parent a0a8250d14
commit 57724c340d
3 changed files with 46 additions and 0 deletions

21
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,21 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "lua-local",
"request": "launch",
"name": "Debug with Xephyr",
"program": {
"command": "${workspaceFolder}/start-xephyr.sh"
},
"args": [
"/usr/bin/Xephyr",
"/usr/bin/awesome",
"${workspaceFolder}/init.lua",
]
}
]
}

View File

@ -1,5 +1,9 @@
-- awesome_mode: api-level=4:screen=on -- awesome_mode: api-level=4:screen=on
if os.getenv("LOCAL_LUA_DEBUGGER_VSCODE") == "1" then
require("lldebugger").start()
end
-- If LuaRocks is installed, make sure that packages installed through it are -- If LuaRocks is installed, make sure that packages installed through it are
-- found (e.g. lgi). If LuaRocks is not installed, do nothing. -- found (e.g. lgi). If LuaRocks is not installed, do nothing.
pcall(require, 'luarocks.loader') pcall(require, 'luarocks.loader')

21
start-xephyr.sh Executable file
View File

@ -0,0 +1,21 @@
#!/usr/bin/env sh
xephyr=$1
awesome=$2
rc_file=$3
# Check for the first free $DISPLAY
for ((i=1;;i++)); do
if [[ ! -f "/tmp/.X${i}-lock" ]]; then
D=$i;
break;
fi;
done
# Start Xephyr
$xephyr :$D -name xephyr_$D -ac -br -noreset -screen 1600x900 >/dev/null 2>&1 &
sleep 1
# Start Awesome
DISPLAY=:$D.0 $awesome \
--config $rc_file