From 6204c603d4bbb23c102819be311e76849735702e Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Tue, 10 Mar 2020 19:58:00 +0100 Subject: [PATCH] match targets by pattern --- .config/awesome/rc.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua index 2b5b2a8..fce9a05 100644 --- a/.config/awesome/rc.lua +++ b/.config/awesome/rc.lua @@ -329,9 +329,10 @@ awful.screen.connect_for_each_screen(function(s) end) -- }}} -- {{{ autorandr integration -local function find_screen_by_name(name) +local function find_screen_by_pattern(pattern) for s in screen do - if s.name == name then + print(s.name .. " :: " .. pattern) + if s.name:match(pattern) then return s end end @@ -350,7 +351,7 @@ local function get_target_screen_for_tag(tag) if tag.targets then if type(tag.targets) == "table" then for _,target in ipairs(tag.targets) do - local s = find_screen_by_name(target) + local s = find_screen_by_pattern(target:gsub('%-', '%%-')) if s then print(" → screen " .. s.name) return s -- 2.39.5