add(debug) vscode debug config
This commit is contained in:
parent
a267fc99ab
commit
acd4f3e924
|
@ -1,7 +1,4 @@
|
|||
{
|
||||
// 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": [
|
||||
{
|
||||
|
@ -14,8 +11,9 @@
|
|||
"args": [
|
||||
"/usr/bin/Xephyr",
|
||||
"/usr/bin/awesome",
|
||||
"${workspaceFolder}/init.lua",
|
||||
]
|
||||
"${workspaceFolder}/init.lua"
|
||||
],
|
||||
"postDebugTask": "Terminate All Tasks"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "Terminate All Tasks",
|
||||
"command": "${workspaceFolder}/start-xephyr.sh stop",
|
||||
"type": "shell",
|
||||
"problemMatcher": []
|
||||
}
|
||||
],
|
||||
"inputs": [
|
||||
{
|
||||
"id": "terminate",
|
||||
"type": "command",
|
||||
"command": "workbench.action.tasks.terminate",
|
||||
"args": "terminateAll"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -1,21 +1,33 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
killXephyr() {
|
||||
kill "$(pgrep Xephyr)" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
trap killXephyr EXIT
|
||||
|
||||
if [ "$1" = "stop" ]; then
|
||||
killXephyr
|
||||
exit 0
|
||||
fi;
|
||||
|
||||
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
|
||||
# Check for the first free display
|
||||
for i in $(seq 1 10); 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 &
|
||||
$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
|
||||
--config "$rc_file"
|
||||
|
||||
|
|
Loading…
Reference in New Issue