summaryrefslogtreecommitdiff
path: root/devilspie/lua
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-12-23 02:41:40 -0600
committerJeff Carr <[email protected]>2024-12-23 02:41:40 -0600
commit944fc8685d4c1b2c6093fd3475d496b087e2f1ee (patch)
tree730323441ac39d3fbc06a18b3ae76fcacb8c4135 /devilspie/lua
parentd3f10b03413573b11496bdbcf9340f174588c220 (diff)
builds and lists window namesv0.0.6v0.0.5v0.0.4v0.0.3
Diffstat (limited to 'devilspie/lua')
-rw-r--r--devilspie/lua/awesome.lua46
-rw-r--r--devilspie/lua/file-header.lua29
2 files changed, 75 insertions, 0 deletions
diff --git a/devilspie/lua/awesome.lua b/devilspie/lua/awesome.lua
new file mode 100644
index 0000000..dc11905
--- /dev/null
+++ b/devilspie/lua/awesome.lua
@@ -0,0 +1,46 @@
+-- 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
diff --git a/devilspie/lua/file-header.lua b/devilspie/lua/file-header.lua
new file mode 100644
index 0000000..f09459c
--- /dev/null
+++ b/devilspie/lua/file-header.lua
@@ -0,0 +1,29 @@
+--[[
+ This file is part of devilspie2
+ Copyright (C) 2023 Darren Salt
+
+ This is an example primarily intended for use in your own
+ configuration files etc. without causing licence contamination.
+ As such, no licence conditions are attached; it may be modified and
+ redistributed freely. Essentially, do what you want with it.
+
+ That said, retaining proper attribution would be appreciated.
+]]
+-- Optional, but probably useful. (Technical feedback would be helpful.)
+set_adjust_for_decoration(true)
+-- Set up some variables containing likely-to-be-referenced values
+win_class = get_window_class()
+win_role = get_window_role()
+win_name = get_window_name()
+app_name = get_application_name()
+ins_name = get_class_instance_name()
+if ins_name == nil then ins_name = '[nil]' end
+grp_name = get_class_group_name()
+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 (jwc note. this is in the lua script): " .. decorated)
+debug_print ("Instance: '" .. ins_name .. "' & '" .. grp_name .. "'")
+
+-- Add your stuff here!