builds and lists window names

This commit is contained in:
Jeff Carr 2024-12-23 02:41:40 -06:00
parent d3f10b0341
commit 944fc8685d
Notes: Jeff Carr 2024-12-24 03:51:27 -06:00
// `autogen:go.mod`

module go.wit.com/apps/utils/xstartplacement

go 1.20

require github.com/BurntSushi/xgb v0.0.0-20210121224620-deaf085860bc

// `autogen:go.sum`

github.com/BurntSushi/xgb v0.0.0-20210121224620-deaf085860bc h1:7D+Bh06CRPCJO3gr2F7h1sriovOZ8BMhca2Rg85c2nk=
github.com/BurntSushi/xgb v0.0.0-20210121224620-deaf085860bc/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=

// `autogen:`
5 changed files with 3 additions and 49 deletions

View File

@ -8,9 +8,9 @@ run:
echo apt install lua-posix
./devilspie2 -l
./devilspie2 -w
sleep 3
./devilspie2 -d -e -f scripts
./devilspie2 -d -e -f lua
build:
reset
gcc *.c -o devilspie2 ${PKGINC} \
-lwnck-3 -lgtk-3 -lgdk-3 -lz -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -llua5.1 -lX11 -lXinerama

View File

@ -1,46 +0,0 @@
-- Support Awesome 3.5 WM
local posix = require("posix");
local os = require("os");
local awesome = "/usr/bin/awesome-client"
if not posix.stat(awesome, "type") == "file" then
awesome = nil;
end
-- Check for tiling mode
function is_tiling()
if awesome then
return true;
end
return false;
end
-- Make window floating
-- Parameters: state - true to make window floating, else make window tiled
function set_tile_floating( state )
if not awesome then
return nil;
end
if state then state = "true" else state = "false" end
local xid = get_window_xid();
local command = "echo ";
command = command .. "'";
command = command .. " local naughty = require(\"naughty\");";
command = command .. " local awcl = require(\"awful.client\");";
command = command .. " local client = require(\"client\");";
command = command .. " for k, c in pairs( client.get() ) do";
command = command .. " if c.window == " .. xid .. " then";
command = command .. " awcl.floating.set(c, " .. state .. ");";
command = command .. " end";
command = command .. " end";
command = command .. "'";
command = command .. " | ";
command = command .. awesome;
debug_print("Awesome floating: " .. command);
return os.execute( command );
end

View File

View File

@ -23,7 +23,7 @@ if grp_name == nil then grp_name = '[nil]' end
-- Debug output ("devilspie2 -d")
decorated = get_window_is_decorated() and "yes" or "no"
debug_print("\nName: '" .. win_name .. "'\nApp: '" .. app_name .. "'\nClass: " .. win_class .. "\nRole: <" .. win_role .. ">")
debug_print ("Process: '" .. get_process_name() .. "'\nDecorated: " .. decorated)
debug_print ("Process: '" .. get_process_name() .. "'\nDecorated (jwc note. this is in the lua script): " .. decorated)
debug_print ("Instance: '" .. ins_name .. "' & '" .. grp_name .. "'")
-- Add your stuff here!