2016-04-13 05:18:09 +02:00
|
|
|
local spawn = require("awful.spawn")
|
|
|
|
|
|
|
|
-- This file provide a simple, yet flexible, test client.
|
|
|
|
-- It is used to test the `awful.rules`
|
|
|
|
|
2016-05-05 18:33:18 +02:00
|
|
|
return function(class, title, use_sn)
|
2016-05-01 19:24:38 +02:00
|
|
|
class = class or 'test_app'
|
2016-04-13 05:18:09 +02:00
|
|
|
title = title or 'Awesome test client'
|
|
|
|
|
|
|
|
local cmd = {"lua" , "-e", table.concat {
|
|
|
|
"local lgi = require 'lgi';",
|
|
|
|
"local Gtk = lgi.require('Gtk');",
|
|
|
|
"Gtk.init();",
|
2016-05-01 19:24:38 +02:00
|
|
|
"local class = '",class,"';",
|
2016-04-13 05:18:09 +02:00
|
|
|
"local window = Gtk.Window {",
|
|
|
|
" default_width = 100,",
|
|
|
|
" default_height = 100,",
|
2016-05-01 19:36:53 +02:00
|
|
|
" on_destroy = Gtk.main_quit,",
|
2016-04-13 05:18:09 +02:00
|
|
|
" title = '",title,
|
|
|
|
"'};",
|
|
|
|
"window:set_wmclass(class, class);",
|
2016-05-01 19:36:53 +02:00
|
|
|
"window:show_all();",
|
|
|
|
"Gtk:main{...}"
|
2016-04-13 05:18:09 +02:00
|
|
|
}}
|
|
|
|
|
2016-05-05 18:33:18 +02:00
|
|
|
return spawn(cmd, use_sn)
|
2016-04-13 05:18:09 +02:00
|
|
|
end
|
2016-05-01 19:23:22 +02:00
|
|
|
|
|
|
|
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|