init.lua.in

来自「awesome is a highly configurable, next g」· IN 代码 · 共 89 行

IN
89
字号
----------------------------------------------------------------------------- @author Julien Danjou <julien@danjou.info>-- @copyright 2008 Julien Danjou-- @release @AWESOME_VERSION@----------------------------------------------------------------------------- Grab environment we needlocal ipairs = ipairslocal tag = require("awful.tag")local util = require("awful.util")local suit = require("awful.layout.suit")local capi ={    hooks = hooks,    screen = screen}local hooks = require("awful.hooks")--- Layout module for awfulmodule("awful.layout")--- Get the current layout.-- @param screen The screen number.-- @return The layout function.function get(screen)    local t = tag.selected(screen)    return tag.getproperty(t, "layout") or suit.floatingend--- Change the layout of the current tag.-- @param layouts A table of layouts.-- @param i Relative index.function inc(layouts, i)    local t = tag.selected()    if t then        local curlayout = get()        local curindex        local rev_layouts = {}        for k, v in ipairs(layouts) do            if v == curlayout then                curindex = k                break            end        end        if curindex then            local newindex = util.cycle(#layouts, curindex + i)            set(layouts[newindex])        end    endend--- Set the layout function of the current tag.-- @param layout Layout name.function set(layout, t)    t = t or tag.selected()    tag.setproperty(t, "layout", layout)    capi.hooks.arrange()(t.screen)end-- Register an arrange hook.local function on_arrange (screen)    get(screen)(screen)endlocal layouts_name ={    [suit.tile]            = "tile",    [suit.tile.left]       = "tileleft",    [suit.tile.bottom]     = "tilebottom",    [suit.tile.top]        = "tiletop",    [suit.fair]            = "fairv",    [suit.fair.horizontal] = "fairh",    [suit.max]             = "max",    [suit.max.fullscreen]  = "fullscreen",    [suit.magnifier]       = "magnifier",    [suit.floating]        = "floating"}--- Get the current layout name.-- @param layout the layout name.-- @return The layout name.function getname(layout)    return layouts_name[layout]endhooks.arrange.register(on_arrange)-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?