diff options
author | Jon Santmyer <jon@jonsantmyer.com> | 2024-01-07 12:00:08 -0500 |
---|---|---|
committer | Jon Santmyer <jon@jonsantmyer.com> | 2024-01-07 12:00:08 -0500 |
commit | 7b79203f54853733d4fae88943829d0e24e6e49f (patch) | |
tree | a352d199fad7453332b9308a6295164157729f27 /modules/desktop/awesome/scratch.lua | |
parent | 184bd30bcb303104a4981ac742d8f8961c5477e7 (diff) | |
download | nix-config-7b79203f54853733d4fae88943829d0e24e6e49f.tar.gz nix-config-7b79203f54853733d4fae88943829d0e24e6e49f.tar.bz2 nix-config-7b79203f54853733d4fae88943829d0e24e6e49f.zip |
massive overhaul
Diffstat (limited to 'modules/desktop/awesome/scratch.lua')
-rw-r--r-- | modules/desktop/awesome/scratch.lua | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/modules/desktop/awesome/scratch.lua b/modules/desktop/awesome/scratch.lua deleted file mode 100644 index aa1fd1e..0000000 --- a/modules/desktop/awesome/scratch.lua +++ /dev/null @@ -1,54 +0,0 @@ -local client = client - -local awful = require("awful") -local util = require("awful.util") - -local scratch = {} - -local function activate(c) - local ctag = awful.tag.selected(c.screen) - ctags = {ctag} - for k,tag in pairs(c:tags()) do - if tag ~= ctag then table.insert(ctags, tag) end - end - c:tags(ctags) - c:raise() - client.focus = c -end - -local function deactivate(c) - local ctag = awful.tag.selected(c.screen) - ctags = {} - for k,tag in pairs(c:tags()) do - if tag ~= ctag then table.insert(ctags, tag) end - end - c:tags(ctags) -end - -function scratch.raise(cmd, rule) - local rule = rule or { instance = "scratch" } - local function match(c) return awful.rules.match(c, rule) end - - local clients = client.get() - local findex = util.table.hasitem(clients, client.focus) or 1 - local start = util.cycle(#clients, findex + 1) - - for c in awful.client.iterate(match, start) do - activate(c) - return - end - - util.spawn(cmd) -end - -function scratch.toggle(cmd, rule) - local rule = rule or { instance = "scratch" } - - if client.focus and awful.rules.match(client.focus, rule) then - deactivate(client.focus) - else - scratch.raise(cmd) - end -end - -return scratch |