Compare commits

...

2 Commits

Author SHA1 Message Date
Izaya 53c7b207f6 make stuff more accessible for other libs maybe 2022-08-25 16:29:11 +10:00
Izaya a9e8f53b5b actually works now, maybe 2022-08-25 16:25:43 +10:00
1 changed files with 15 additions and 16 deletions

View File

@ -4,24 +4,25 @@ local wibox = require("wibox")
local switcherpopup = require("awesome-switcherpopup")
local launcherpopup = require("awesome-launcherpopup")
local longpress = require("awesome-longpress")
local vkbd = require("vkbd")
local navbar = {
iconSize = 96,
iconPath = gears.filesystem.get_configuration_dir() .. "/awesome-navbar/",
launcher = "xfce4-appfinder"
launcher = launcher or "xfce4-appfinder"
}
function navbar.new(s)
local landscape = s.geometry.width > s.geometry.height
local portrait = not landscape
local tasklist = switcherpopup.new(s)
local launcher = launcherpopup.new(s)
s.tasklist = switcherpopup.new(s)
s.launcher = launcherpopup.new(s)
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(),
awful.button({}, 1, nil, function()
launcher:hide()
tasklist:toggle()
s.launcher:hide()
s.tasklist:toggle()
end)
))
local kb_button = wibox.container.place(awful.widget.button({image = navbar.iconPath .. "/keyboard.svg"}), "center", "center")
@ -33,26 +34,23 @@ function navbar.new(s)
))
local launcher_button = wibox.container.place(awful.widget.button({image = navbar.iconPath .. "/launcher.svg"}), "center", "center")
longpress.add(launcher_button,function()
tasklist:hide()
launcher:toggle()
s.tasklist:hide()
s.launcher:toggle()
end,
function()
awful.spawn(navbar.launcher)
end)
local rnavbar = awful.wibar({
position = landscape and "left" or "bottom",
height = (portrait and 96) or nil,
width = (landscape and 96) or nil,
ontop = true,
screen = s
})
function rnavbar.reflow()
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()
rnavbar:setup({
layout = landscape and wibox.layout.ratio.vertical or wibox.layout.ratio.horizontal, launcher_button, switcher_button, kb_button
})
s.keyboard = awful.wibar({
height = s.geometry.height * 0.25,
@ -64,6 +62,7 @@ function navbar.new(s)
})
vkbd.spacing = 1
vkbd.init("ansi")
s.keyboard:setup ({
layout = wibox.layout.ratio.horizontal,
vkbd