File: awesome

package info (click to toggle)
lua-lgi 0.9.2-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,376 kB
  • sloc: ansic: 5,082; makefile: 169; sh: 31
file content (34 lines) | stat: -rw-r--r-- 923 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh

CONFIG="$AUTOPKGTEST_TMP/rc.lua"
SUCCESS_FILE="$AUTOPKGTEST_TMP/success"
cat > "$CONFIG" <<DONE
local gears = require("gears")
local orig_error = error
local had_error = false
function error(...)
    had_error = true
    -- quit() only sets a flag and doesn't quit immediately :-(
    awesome.quit()
    orig_error(...)
end
-- Quit in 5 seconds, if everything worked
local t = gears.timer({ timeout = 5 })
local connect = t.connect_signal or t.add_signal
connect(t, "timeout", function()
    -- Create the success file, everything worked fine
    if not had_error then
        io.open("$SUCCESS_FILE", "w")
    end
    awesome.quit()
end)
t:start()
dofile("/etc/xdg/awesome/rc.lua")
DONE

export TMPDIR="$AUTOPKGTEST_TMP/"
xvfb-run -s '-screen 0 1024x768x24' dbus-launch --exit-with-session awesome -c "$CONFIG" &
PID=$!
sleep 10
kill -9 $PID 2> /dev/null
if [ -e "$SUCCESS_FILE" ]; then exit 0; else exit 1; fi