File: named_floating_groupws.lua

package info (click to toggle)
notion 4.0.2%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 4,676 kB
  • sloc: ansic: 47,508; sh: 2,096; makefile: 603; perl: 270
file content (39 lines) | stat: -rw-r--r-- 1,174 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
-- Authors: Etan Reisner <deryni@gmail.com>
-- License: MIT, see http://opensource.org/licenses/mit-license.php
-- Last Changed: 2007-01-29
--
--[[
Author: Etan Reisner
Email: deryni@gmail.com
Summary: Toggle (and create) floating WGroupWS:s by name.
Version: 0.1
Last Updated: 2007-01-29

Copyright (c) Etan Reisner 2007

This software is released under the terms of the MIT license. For more
information, see http://opensource.org/licenses/mit-license.php .
--]]

-- Example: This will create a level 2 floatws named example_floatws
--          kpress(MOD4.."e", "named_groupws(_, 'example_groupws')")

function named_groupws(reg, name)
    local named_groupws
    local scr = reg:screen_of()

    named_groupws = ioncore.lookup_region(name, "WGroupWS")

    if not named_groupws then
        named_groupws = scr:attach_new({
                                        type="WGroupWS",
                                        name=name,
                                        unnumbered=true,
                                        hidden=true,
                                       })
    end

    scr:set_hidden(named_groupws, 'toggle')
end

-- vim: set expandtab sw=4: