Compare commits
No commits in common. "53c7b207f62fd5e85cc355a1f872936d69cdcc78" and "d60d254ab40d07169f0e49ca10bcc5721f1a6e91" have entirely different histories.
53c7b207f6
...
d60d254ab4
31
init.lua
31
init.lua
@ -4,25 +4,24 @@ local wibox = require("wibox")
|
|||||||
local switcherpopup = require("awesome-switcherpopup")
|
local switcherpopup = require("awesome-switcherpopup")
|
||||||
local launcherpopup = require("awesome-launcherpopup")
|
local launcherpopup = require("awesome-launcherpopup")
|
||||||
local longpress = require("awesome-longpress")
|
local longpress = require("awesome-longpress")
|
||||||
local vkbd = require("vkbd")
|
|
||||||
|
|
||||||
local navbar = {
|
local navbar = {
|
||||||
iconSize = 96,
|
iconSize = 96,
|
||||||
iconPath = gears.filesystem.get_configuration_dir() .. "/awesome-navbar/",
|
iconPath = gears.filesystem.get_configuration_dir() .. "/awesome-navbar/",
|
||||||
launcher = launcher or "xfce4-appfinder"
|
launcher = "xfce4-appfinder"
|
||||||
}
|
}
|
||||||
|
|
||||||
function navbar.new(s)
|
function navbar.new(s)
|
||||||
local landscape = s.geometry.width > s.geometry.height
|
local landscape = s.geometry.width > s.geometry.height
|
||||||
local portrait = not landscape
|
local portrait = not landscape
|
||||||
s.tasklist = switcherpopup.new(s)
|
local tasklist = switcherpopup.new(s)
|
||||||
s.launcher = launcherpopup.new(s)
|
local launcher = launcherpopup.new(s)
|
||||||
local switcher_button = wibox.container.place(awful.widget.button({image = navbar.iconPath .. "/switcher.svg"}), "center", "center")
|
local switcher_button = wibox.container.place(awful.widget.button({image = navbar.iconPath .. "/switcher.svg"}), "center", "center")
|
||||||
switcher_button:buttons(gears.table.join(
|
switcher_button:buttons(gears.table.join(
|
||||||
switcher_button:buttons(),
|
switcher_button:buttons(),
|
||||||
awful.button({}, 1, nil, function()
|
awful.button({}, 1, nil, function()
|
||||||
s.launcher:hide()
|
launcher:hide()
|
||||||
s.tasklist:toggle()
|
tasklist:toggle()
|
||||||
end)
|
end)
|
||||||
))
|
))
|
||||||
local kb_button = wibox.container.place(awful.widget.button({image = navbar.iconPath .. "/keyboard.svg"}), "center", "center")
|
local kb_button = wibox.container.place(awful.widget.button({image = navbar.iconPath .. "/keyboard.svg"}), "center", "center")
|
||||||
@ -34,23 +33,26 @@ function navbar.new(s)
|
|||||||
))
|
))
|
||||||
local launcher_button = wibox.container.place(awful.widget.button({image = navbar.iconPath .. "/launcher.svg"}), "center", "center")
|
local launcher_button = wibox.container.place(awful.widget.button({image = navbar.iconPath .. "/launcher.svg"}), "center", "center")
|
||||||
longpress.add(launcher_button,function()
|
longpress.add(launcher_button,function()
|
||||||
s.tasklist:hide()
|
tasklist:hide()
|
||||||
s.launcher:toggle()
|
launcher:toggle()
|
||||||
end,
|
end,
|
||||||
function()
|
function()
|
||||||
awful.spawn(navbar.launcher)
|
awful.spawn(navbar.launcher)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local rnavbar = awful.wibar({
|
local rnavbar = awful.wibar({
|
||||||
position = landscape and "left" or "bottom",
|
|
||||||
height = (portrait and 96) or nil,
|
|
||||||
width = (landscape and 96) or nil,
|
|
||||||
ontop = true,
|
ontop = true,
|
||||||
screen = s
|
screen = s
|
||||||
})
|
})
|
||||||
rnavbar:setup({
|
function rnavbar.reflow()
|
||||||
layout = landscape and wibox.layout.ratio.vertical or wibox.layout.ratio.horizontal, launcher_button, switcher_button, kb_button
|
rnavbar.position = landscape and "left" or "bottom"
|
||||||
})
|
rnavbar.height = (portrait and navbar.iconSize) or nil
|
||||||
|
rnavbar.width = (landscape and navbar.iconSize) or nil
|
||||||
|
rnavbar:setup({
|
||||||
|
layout = landscape and wibox.layout.ratio.vertical or wibox.layout.ratio.horizontal, launcher_button, switcher_button, kb_button
|
||||||
|
})
|
||||||
|
end
|
||||||
|
rnavbar.reflow()
|
||||||
|
|
||||||
s.keyboard = awful.wibar({
|
s.keyboard = awful.wibar({
|
||||||
height = s.geometry.height * 0.25,
|
height = s.geometry.height * 0.25,
|
||||||
@ -62,7 +64,6 @@ function navbar.new(s)
|
|||||||
})
|
})
|
||||||
|
|
||||||
vkbd.spacing = 1
|
vkbd.spacing = 1
|
||||||
vkbd.init("ansi")
|
|
||||||
s.keyboard:setup ({
|
s.keyboard:setup ({
|
||||||
layout = wibox.layout.ratio.horizontal,
|
layout = wibox.layout.ratio.horizontal,
|
||||||
vkbd
|
vkbd
|
||||||
|
Loading…
Reference in New Issue
Block a user