Compare commits
8 Commits
d18e5074d2
...
3a8a55b63a
Author | SHA1 | Date |
---|---|---|
Yessiest | 3a8a55b63a | |
Yessiest | 780f63f1a0 | |
Yessiest | 579c46f4f4 | |
Yessiest | 7cd97ec4b0 | |
Yessiest | 768e6d49d3 | |
Yessiest | dcfcc459a1 | |
Yessiest | b80ec3fdb4 | |
Yessiest | 9842227176 |
|
@ -2,7 +2,7 @@ local awful = require("awful")
|
||||||
local gears = require("gears")
|
local gears = require("gears")
|
||||||
|
|
||||||
return gears.table.join(
|
return gears.table.join(
|
||||||
awful.button({ }, 3, function () require("core.widgets.menu"):toggle() end),
|
awful.button({ }, 3, function () menu:show() end),
|
||||||
awful.button({ }, 4, awful.tag.viewnext),
|
awful.button({ }, 4, awful.tag.viewnext),
|
||||||
awful.button({ }, 5, awful.tag.viewprev)
|
awful.button({ }, 5, awful.tag.viewprev)
|
||||||
)
|
)
|
||||||
|
|
|
@ -34,7 +34,6 @@ require("core.widgets.menubar")
|
||||||
awful.screen.connect_for_each_screen(function(s)
|
awful.screen.connect_for_each_screen(function(s)
|
||||||
-- Wallpaper
|
-- Wallpaper
|
||||||
set_wallpaper(s)
|
set_wallpaper(s)
|
||||||
|
|
||||||
-- Each screen has its own tag table.
|
-- Each screen has its own tag table.
|
||||||
awful.tag({ "1", "2", "3", "4", "5", "6", "7", "8", "9" }, s, awful.layout.layouts[1])
|
awful.tag({ "1", "2", "3", "4", "5", "6", "7", "8", "9" }, s, awful.layout.layouts[1])
|
||||||
|
|
||||||
|
@ -67,76 +66,81 @@ awful.screen.connect_for_each_screen(function(s)
|
||||||
},
|
},
|
||||||
bottom_widgets = {
|
bottom_widgets = {
|
||||||
require("widgets.polylauncher")({vertical = true})
|
require("widgets.polylauncher")({vertical = true})
|
||||||
}
|
},
|
||||||
|
position="left"
|
||||||
})
|
})
|
||||||
-- Add widgets to the wibox
|
-- Menu
|
||||||
s.mywibox:setup {
|
require("core.widgets.menu")
|
||||||
layout = wibox.layout.align.horizontal,
|
-- Start button
|
||||||
{ -- Left widgets
|
local start_button = wibox.widget {
|
||||||
layout = wibox.layout.fixed.horizontal,
|
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
require("core.widgets.menu_launcher"),
|
image = beautiful.awesome_icon,
|
||||||
|
widget = wibox.widget.imagebox
|
||||||
|
},
|
||||||
widget = wibox.container.place,
|
widget = wibox.container.place,
|
||||||
halign = "center"
|
halign = "center",
|
||||||
|
id = "menu"
|
||||||
},
|
},
|
||||||
bg = "#26262633",
|
bg = "#26262633",
|
||||||
widget = wibox.container.background,
|
widget = wibox.container.background,
|
||||||
forced_width = require("beautiful.xresources").apply_dpi(61),
|
forced_width = require("beautiful.xresources").apply_dpi(61),
|
||||||
},
|
}
|
||||||
|
start_button:connect_signal("button::press",function(self,x,y,button)
|
||||||
|
if button == 1 then
|
||||||
|
menu:show()
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
-- Add widgets to the wibox
|
||||||
|
s.mywibox:setup {
|
||||||
|
expand = "outside",
|
||||||
|
layout = wibox.layout.align.horizontal,
|
||||||
|
{
|
||||||
|
{
|
||||||
|
-- Left widgets
|
||||||
|
start_button,
|
||||||
--require("widgets.polylauncher")({vertical = false}),
|
--require("widgets.polylauncher")({vertical = false}),
|
||||||
--s.mytaglist,
|
--s.mytaglist,
|
||||||
s.mypromptbox,
|
s.mypromptbox,
|
||||||
|
layout = wibox.layout.fixed.horizontal,
|
||||||
spacing = 3
|
spacing = 3
|
||||||
},
|
},
|
||||||
-- Middle widget
|
widget = wibox.container.place,
|
||||||
|
halign = "left",
|
||||||
|
fill_horizontal = false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
--[[require("widgets.polytasklist")({
|
|
||||||
vertical = false,
|
|
||||||
stretch = false,
|
|
||||||
constraint = 180,
|
|
||||||
names = true,
|
|
||||||
margins = 5
|
|
||||||
})(s),]]
|
|
||||||
layout = wibox.layout.fixed.horizontal
|
layout = wibox.layout.fixed.horizontal
|
||||||
},
|
},
|
||||||
{ -- Right widgets
|
{
|
||||||
layout = wibox.layout.fixed.horizontal,
|
{
|
||||||
awful.widget.keyboardlayout(),
|
-- Right widgets
|
||||||
|
require("widgets.drawer")({
|
||||||
|
wibox.widget.systray(),
|
||||||
|
}),
|
||||||
require("widgets.wallpapers")({
|
require("widgets.wallpapers")({
|
||||||
screen = s,
|
screen = s,
|
||||||
path = os.getenv("HOME").."/Pictures/Wallpapers/",
|
path = os.getenv("HOME").."/Pictures/Wallpapers/",
|
||||||
style = {
|
|
||||||
icon_bg_normal = beautiful.topbar_bg
|
|
||||||
}
|
|
||||||
}),
|
}),
|
||||||
require("widgets.mailbox")({
|
require("widgets.mailbox")({
|
||||||
screen = s,
|
screen = s,
|
||||||
style = {
|
style = {
|
||||||
rounding = 1,
|
rounding = 1,
|
||||||
icon_bg_normal = beautiful.topbar_bg
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
--wibox.widget.systray(),
|
|
||||||
require("widgets.volume")({
|
|
||||||
style = {
|
|
||||||
icon_bg_normal = beautiful.topbar_bg
|
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
require("widgets.volume")({}),
|
||||||
require("widgets.battery")({
|
require("widgets.battery")({
|
||||||
percentage = true,
|
percentage = true,
|
||||||
style = {
|
|
||||||
icon_bg_normal = beautiful.topbar_bg
|
|
||||||
}
|
|
||||||
}),
|
}),
|
||||||
|
awful.widget.keyboardlayout(),
|
||||||
wibox.widget.textclock(),
|
wibox.widget.textclock(),
|
||||||
require("widgets.username")({
|
|
||||||
style = {
|
|
||||||
icon_bg_normal = beautiful.topbar_bg
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
s.mylayoutbox,
|
s.mylayoutbox,
|
||||||
spacing = 4
|
layout = wibox.layout.fixed.horizontal,
|
||||||
|
spacing = 4,
|
||||||
|
},
|
||||||
|
widget = wibox.container.place,
|
||||||
|
halign = "right",
|
||||||
|
fill_horizontal = false
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
end)
|
end)
|
||||||
|
|
|
@ -2,9 +2,11 @@ local awful = require("awful")
|
||||||
local gears = require("gears")
|
local gears = require("gears")
|
||||||
local wibox = require("wibox")
|
local wibox = require("wibox")
|
||||||
local menu = require("widgets.polymenu")
|
local menu = require("widgets.polymenu")
|
||||||
local move_screentags = {}
|
-- To conserve memory we keep one menu at a time
|
||||||
local toggle_screentags = {}
|
if not menu_widget then
|
||||||
awful.screen.connect_for_each_screen(function(s)
|
local move_screentags = {}
|
||||||
|
local toggle_screentags = {}
|
||||||
|
awful.screen.connect_for_each_screen(function(s)
|
||||||
local move_tags = {}
|
local move_tags = {}
|
||||||
local toggle_tags = {}
|
local toggle_tags = {}
|
||||||
for _,tag in pairs(s.tags) do
|
for _,tag in pairs(s.tags) do
|
||||||
|
@ -42,14 +44,13 @@ awful.screen.connect_for_each_screen(function(s)
|
||||||
"Screen "..tostring(s.index),
|
"Screen "..tostring(s.index),
|
||||||
toggle_tags
|
toggle_tags
|
||||||
})
|
})
|
||||||
end)
|
end)
|
||||||
local controls_widget = wibox.widget {
|
controls_widget = wibox.widget {
|
||||||
forced_width = 72,
|
forced_width = 72,
|
||||||
forced_height = 24,
|
forced_height = 24,
|
||||||
layout = wibox.layout.fixed.horizontal,
|
layout = wibox.layout.fixed.horizontal,
|
||||||
}
|
}
|
||||||
-- To conserve memory we keep one menu at a time
|
menu_widget = menu({
|
||||||
local menu_widget = menu({
|
|
||||||
before = {
|
before = {
|
||||||
controls_widget
|
controls_widget
|
||||||
},
|
},
|
||||||
|
@ -65,12 +66,12 @@ local menu_widget = menu({
|
||||||
},
|
},
|
||||||
{ "Stop task",
|
{ "Stop task",
|
||||||
function()
|
function()
|
||||||
awful.spawn("kill "..tostring(client.focus.pid))
|
awful.spawn("kill "..tostring(c.pid))
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
{ "Kill task",
|
{ "Kill task",
|
||||||
function()
|
function()
|
||||||
awful.spawn("kill -s KILL "..tostring(client.focus.pid))
|
awful.spawn("kill -s KILL "..tostring(c.pid))
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
{ "Debug info",
|
{ "Debug info",
|
||||||
|
@ -82,7 +83,8 @@ local menu_widget = menu({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
vertical = true
|
vertical = true
|
||||||
})
|
})
|
||||||
|
end
|
||||||
|
|
||||||
return function(c)
|
return function(c)
|
||||||
local buttons = gears.table.join(
|
local buttons = gears.table.join(
|
||||||
|
|
|
@ -83,7 +83,7 @@ local menu_template = {
|
||||||
vertical = true,
|
vertical = true,
|
||||||
inverse = true
|
inverse = true
|
||||||
}
|
}
|
||||||
local menu = polymenu(menu_template)
|
menu = polymenu(menu_template)
|
||||||
root.keys(gears.table.join(
|
root.keys(gears.table.join(
|
||||||
root.keys(),
|
root.keys(),
|
||||||
awful.key({ global.modkey, }, "w", function () menu:show() end,
|
awful.key({ global.modkey, }, "w", function () menu:show() end,
|
||||||
|
|
|
@ -67,76 +67,81 @@ awful.screen.connect_for_each_screen(function(s)
|
||||||
},
|
},
|
||||||
bottom_widgets = {
|
bottom_widgets = {
|
||||||
require("widgets.polylauncher")({vertical = true})
|
require("widgets.polylauncher")({vertical = true})
|
||||||
}
|
},
|
||||||
|
position="left"
|
||||||
})
|
})
|
||||||
-- Add widgets to the wibox
|
-- Menu
|
||||||
s.mywibox:setup {
|
require("core.widgets.menu")
|
||||||
layout = wibox.layout.align.horizontal,
|
-- Start button
|
||||||
{ -- Left widgets
|
local start_button = wibox.widget {
|
||||||
layout = wibox.layout.fixed.horizontal,
|
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
require("core.widgets.menu_launcher"),
|
image = beautiful.awesome_icon,
|
||||||
|
widget = wibox.widget.imagebox
|
||||||
|
},
|
||||||
widget = wibox.container.place,
|
widget = wibox.container.place,
|
||||||
halign = "center"
|
halign = "center",
|
||||||
|
id = "menu"
|
||||||
},
|
},
|
||||||
bg = "#26262633",
|
bg = "#26262633",
|
||||||
widget = wibox.container.background,
|
widget = wibox.container.background,
|
||||||
forced_width = require("beautiful.xresources").apply_dpi(61),
|
forced_width = require("beautiful.xresources").apply_dpi(61),
|
||||||
},
|
}
|
||||||
|
start_button:connect_signal("button::press",function(self,x,y,button)
|
||||||
|
if button == 1 then
|
||||||
|
menu:show()
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
-- Add widgets to the wibox
|
||||||
|
s.mywibox:setup {
|
||||||
|
expand = "outside",
|
||||||
|
layout = wibox.layout.align.horizontal,
|
||||||
|
{
|
||||||
|
{
|
||||||
|
-- Left widgets
|
||||||
|
start_button,
|
||||||
--require("widgets.polylauncher")({vertical = false}),
|
--require("widgets.polylauncher")({vertical = false}),
|
||||||
--s.mytaglist,
|
--s.mytaglist,
|
||||||
s.mypromptbox,
|
s.mypromptbox,
|
||||||
|
layout = wibox.layout.fixed.horizontal,
|
||||||
spacing = 3
|
spacing = 3
|
||||||
},
|
},
|
||||||
-- Middle widget
|
widget = wibox.container.place,
|
||||||
|
halign = "left",
|
||||||
|
fill_horizontal = false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
--[[require("widgets.polytasklist")({
|
|
||||||
vertical = false,
|
|
||||||
stretch = false,
|
|
||||||
constraint = 180,
|
|
||||||
names = true,
|
|
||||||
margins = 5
|
|
||||||
})(s),]]
|
|
||||||
layout = wibox.layout.fixed.horizontal
|
layout = wibox.layout.fixed.horizontal
|
||||||
},
|
},
|
||||||
{ -- Right widgets
|
{
|
||||||
layout = wibox.layout.fixed.horizontal,
|
{
|
||||||
awful.widget.keyboardlayout(),
|
-- Right widgets
|
||||||
|
require("widgets.drawer")({
|
||||||
|
wibox.widget.systray(),
|
||||||
|
}),
|
||||||
require("widgets.wallpapers")({
|
require("widgets.wallpapers")({
|
||||||
screen = s,
|
screen = s,
|
||||||
path = os.getenv("HOME").."/Pictures/Wallpapers/",
|
path = os.getenv("HOME").."/Pictures/Wallpapers/",
|
||||||
style = {
|
|
||||||
icon_bg_normal = beautiful.topbar_bg
|
|
||||||
}
|
|
||||||
}),
|
}),
|
||||||
require("widgets.mailbox")({
|
require("widgets.mailbox")({
|
||||||
screen = s,
|
screen = s,
|
||||||
style = {
|
style = {
|
||||||
rounding = 1,
|
rounding = 1,
|
||||||
icon_bg_normal = beautiful.topbar_bg
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
--wibox.widget.systray(),
|
|
||||||
require("widgets.volume")({
|
|
||||||
style = {
|
|
||||||
icon_bg_normal = beautiful.topbar_bg
|
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
require("widgets.volume")({}),
|
||||||
require("widgets.battery")({
|
require("widgets.battery")({
|
||||||
percentage = true,
|
percentage = true,
|
||||||
style = {
|
|
||||||
icon_bg_normal = beautiful.topbar_bg
|
|
||||||
}
|
|
||||||
}),
|
}),
|
||||||
|
awful.widget.keyboardlayout(),
|
||||||
wibox.widget.textclock(),
|
wibox.widget.textclock(),
|
||||||
require("widgets.username")({
|
|
||||||
style = {
|
|
||||||
icon_bg_normal = beautiful.topbar_bg
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
s.mylayoutbox,
|
s.mylayoutbox,
|
||||||
spacing = 4
|
layout = wibox.layout.fixed.horizontal,
|
||||||
|
spacing = 4,
|
||||||
|
},
|
||||||
|
widget = wibox.container.place,
|
||||||
|
halign = "right",
|
||||||
|
fill_horizontal = false
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
end)
|
end)
|
||||||
|
|
|
@ -71,56 +71,51 @@ awful.screen.connect_for_each_screen(function(s)
|
||||||
})
|
})
|
||||||
-- Add widgets to the wibox
|
-- Add widgets to the wibox
|
||||||
s.mywibox:setup {
|
s.mywibox:setup {
|
||||||
|
expand = "outside",
|
||||||
layout = wibox.layout.align.horizontal,
|
layout = wibox.layout.align.horizontal,
|
||||||
{ -- Left widgets
|
{ -- Left widgets
|
||||||
layout = wibox.layout.fixed.horizontal,
|
{
|
||||||
require("core.widgets.menu_launcher"),
|
require("core.widgets.menu_launcher"),
|
||||||
--require("widgets.polylauncher")({vertical = false}),
|
--require("widgets.polylauncher")({vertical = false}),
|
||||||
--s.mytaglist,
|
--s.mytaglist,
|
||||||
s.mypromptbox,
|
s.mypromptbox,
|
||||||
|
layout = wibox.layout.fixed.horizontal,
|
||||||
spacing = 3
|
spacing = 3
|
||||||
},
|
},
|
||||||
|
widget = wibox.container.place,
|
||||||
|
halign = "left",
|
||||||
|
fill_horizontal = false,
|
||||||
|
},
|
||||||
-- Middle widget
|
-- Middle widget
|
||||||
{
|
|
||||||
widget = wibox.container.background
|
|
||||||
},
|
|
||||||
{ -- Right widgets
|
|
||||||
wibox.widget.textclock(),
|
wibox.widget.textclock(),
|
||||||
|
{ -- Right widgets
|
||||||
{
|
{
|
||||||
widget = wibox.container.background,
|
require("widgets.drawer")({
|
||||||
forced_width = (math.abs(s.geometry.width/2)-200)
|
wibox.widget.systray()
|
||||||
},
|
}),
|
||||||
layout = wibox.layout.fixed.horizontal,
|
|
||||||
awful.widget.keyboardlayout(),
|
awful.widget.keyboardlayout(),
|
||||||
require("widgets.wallpapers")({
|
require("widgets.wallpapers")({
|
||||||
screen = s,
|
screen = s,
|
||||||
path = os.getenv("HOME").."/Pictures/Wallpapers/",
|
path = os.getenv("HOME").."/Pictures/Wallpapers/",
|
||||||
style = {
|
|
||||||
icon_bg_normal = beautiful.topbar_bg
|
|
||||||
}
|
|
||||||
}),
|
}),
|
||||||
require("widgets.mailbox")({
|
require("widgets.mailbox")({
|
||||||
screen = s,
|
screen = s,
|
||||||
style = {
|
style = {
|
||||||
rounding = 1,
|
rounding = 1,
|
||||||
icon_bg_normal = beautiful.topbar_bg
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
--wibox.widget.systray(),
|
|
||||||
require("widgets.volume")({
|
|
||||||
style = {
|
|
||||||
icon_bg_normal = beautiful.topbar_bg
|
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
require("widgets.volume")({}),
|
||||||
require("widgets.battery")({
|
require("widgets.battery")({
|
||||||
percentage = false,
|
percentage = false,
|
||||||
style = {
|
|
||||||
icon_bg_normal = beautiful.topbar_bg
|
|
||||||
}
|
|
||||||
}),
|
}),
|
||||||
s.mylayoutbox,
|
s.mylayoutbox,
|
||||||
|
layout = wibox.layout.fixed.horizontal,
|
||||||
spacing = 4
|
spacing = 4
|
||||||
},
|
},
|
||||||
|
widget = wibox.container.place,
|
||||||
|
halign = "right",
|
||||||
|
fill_horizontal = false
|
||||||
|
},
|
||||||
}
|
}
|
||||||
end)
|
end)
|
||||||
-- }}}
|
-- }}}
|
||||||
|
|
|
@ -0,0 +1,136 @@
|
||||||
|
local beautiful = require("beautiful")
|
||||||
|
local awful = require("awful")
|
||||||
|
local gears = require("gears")
|
||||||
|
local wibox = require("wibox")
|
||||||
|
-- {{{ Wibar
|
||||||
|
|
||||||
|
-- Create a wibox for each screen and add it
|
||||||
|
|
||||||
|
local function set_wallpaper(s)
|
||||||
|
-- Wallpaper
|
||||||
|
if beautiful.wallpaper then
|
||||||
|
local wallpaper = beautiful.wallpaper
|
||||||
|
-- If wallpaper is a function, call it with the screen
|
||||||
|
if type(wallpaper) == "function" then
|
||||||
|
wallpaper = wallpaper(s)
|
||||||
|
end
|
||||||
|
gears.wallpaper.maximized(wallpaper, s, true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Re-set wallpaper when a screen's geometry changes (e.g. different resolution)
|
||||||
|
screen.connect_signal("property::geometry", set_wallpaper)
|
||||||
|
|
||||||
|
-- {{{ Non-widget modules
|
||||||
|
-- The following modules are not exactly widgets, however they are part of the ui.
|
||||||
|
|
||||||
|
-- Load the keybindings list
|
||||||
|
require("core.widgets.hotkeys_popup")
|
||||||
|
|
||||||
|
-- Load the menubar
|
||||||
|
require("core.widgets.menubar")
|
||||||
|
-- }}}
|
||||||
|
|
||||||
|
awful.screen.connect_for_each_screen(function(s)
|
||||||
|
-- Wallpaper
|
||||||
|
set_wallpaper(s)
|
||||||
|
|
||||||
|
-- Each screen has its own tag table.
|
||||||
|
awful.tag({ "1", "2", "3", "4", "5", "6", "7", "8", "9" }, s, awful.layout.layouts[1])
|
||||||
|
|
||||||
|
-- Create a promptbox for each screen
|
||||||
|
s.mypromptbox = require("core.widgets.prompt")()
|
||||||
|
-- Create an imagebox widget which will contain an icon indicating which layout we're using.
|
||||||
|
-- Create the taglist
|
||||||
|
s.mytaglist = require("core.widgets.taglist")(s)
|
||||||
|
-- We need one layoutbox per screen.
|
||||||
|
s.mylayoutbox = require("core.widgets.layout_box")(s)
|
||||||
|
-- Create a tasklist widget
|
||||||
|
s.mytasklist = require("core.widgets.tasklist")(s)
|
||||||
|
-- Create the wibox
|
||||||
|
s.mywibox = awful.wibar({
|
||||||
|
position = "top",
|
||||||
|
screen = s,
|
||||||
|
bg = beautiful.topbar_bg,
|
||||||
|
})
|
||||||
|
-- Add screen lock
|
||||||
|
require("widgets.lock")({screen = s, obscure = true})
|
||||||
|
require("widgets.unitybar")(s,{
|
||||||
|
top_widgets = {
|
||||||
|
require("widgets.polytasklist")({
|
||||||
|
vertical = false,
|
||||||
|
stretch = false,
|
||||||
|
--constraint = 180,
|
||||||
|
names = false,
|
||||||
|
margins = 5
|
||||||
|
})(s),
|
||||||
|
},
|
||||||
|
bottom_widgets = {
|
||||||
|
require("widgets.polylauncher")({vertical = false})
|
||||||
|
},
|
||||||
|
position="bottom"
|
||||||
|
})
|
||||||
|
-- Menu
|
||||||
|
require("core.widgets.menu")
|
||||||
|
-- Start button
|
||||||
|
local start_button = wibox.widget {
|
||||||
|
{
|
||||||
|
{
|
||||||
|
image = beautiful.awesome_icon,
|
||||||
|
widget = wibox.widget.imagebox
|
||||||
|
},
|
||||||
|
widget = wibox.container.place,
|
||||||
|
halign = "center",
|
||||||
|
id = "menu"
|
||||||
|
},
|
||||||
|
bg = "#26262633",
|
||||||
|
widget = wibox.container.background,
|
||||||
|
forced_width = require("beautiful.xresources").apply_dpi(61),
|
||||||
|
}
|
||||||
|
start_button:connect_signal("button::press",function(self,x,y,button)
|
||||||
|
if button == 1 then
|
||||||
|
menu:show()
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
-- Add widgets to the wibox
|
||||||
|
s.mywibox:setup {
|
||||||
|
expand = "outside",
|
||||||
|
layout = wibox.layout.align.horizontal,
|
||||||
|
{ -- Left widgets
|
||||||
|
start_button,
|
||||||
|
layout = wibox.layout.fixed.horizontal,
|
||||||
|
--require("widgets.polylauncher")({vertical = false}),
|
||||||
|
--s.mytaglist,
|
||||||
|
s.mypromptbox,
|
||||||
|
spacing = 3
|
||||||
|
},
|
||||||
|
wibox.widget.textclock(),
|
||||||
|
{ -- Right widgets
|
||||||
|
{
|
||||||
|
layout = wibox.layout.fixed.horizontal,
|
||||||
|
awful.widget.keyboardlayout(),
|
||||||
|
require("widgets.wallpapers")({
|
||||||
|
screen = s,
|
||||||
|
path = os.getenv("HOME").."/Pictures/Wallpapers/",
|
||||||
|
}),
|
||||||
|
require("widgets.mailbox")({
|
||||||
|
screen = s,
|
||||||
|
style = {
|
||||||
|
rounding = 1,
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
--wibox.widget.systray(),
|
||||||
|
require("widgets.volume")({}),
|
||||||
|
require("widgets.battery")({
|
||||||
|
percentage = true,
|
||||||
|
}),
|
||||||
|
s.mylayoutbox,
|
||||||
|
spacing = 4,
|
||||||
|
},
|
||||||
|
widget = wibox.container.place,
|
||||||
|
halign = "right",
|
||||||
|
fill_horizontal = true
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end)
|
||||||
|
-- }}}
|
|
@ -0,0 +1,155 @@
|
||||||
|
local awful = require("awful")
|
||||||
|
local gears = require("gears")
|
||||||
|
local wibox = require("wibox")
|
||||||
|
local menu = require("widgets.polymenu")
|
||||||
|
local move_screentags = {}
|
||||||
|
local toggle_screentags = {}
|
||||||
|
awful.screen.connect_for_each_screen(function(s)
|
||||||
|
local move_tags = {}
|
||||||
|
local toggle_tags = {}
|
||||||
|
for _,tag in pairs(s.tags) do
|
||||||
|
table.insert(move_tags,{
|
||||||
|
tag.name,
|
||||||
|
function()
|
||||||
|
if client.focus then
|
||||||
|
client.focus:tags({tag})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
})
|
||||||
|
table.insert(toggle_tags,{
|
||||||
|
tag.name,
|
||||||
|
function()
|
||||||
|
if client.focus then
|
||||||
|
local tags = client.focus:tags()
|
||||||
|
for k,v in pairs(tags) do
|
||||||
|
if v == tag then
|
||||||
|
table.remove(tags,k)
|
||||||
|
client.focus:tags(tags)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
table.insert(tags,tag)
|
||||||
|
client.focus:tags(tags)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
})
|
||||||
|
end
|
||||||
|
table.insert(move_screentags,{
|
||||||
|
"Screen "..tostring(s.index),
|
||||||
|
move_tags
|
||||||
|
})
|
||||||
|
table.insert(toggle_screentags,{
|
||||||
|
"Screen "..tostring(s.index),
|
||||||
|
toggle_tags
|
||||||
|
})
|
||||||
|
end)
|
||||||
|
local controls_widget = wibox.widget {
|
||||||
|
forced_width = 72,
|
||||||
|
forced_height = 24,
|
||||||
|
layout = wibox.layout.fixed.horizontal,
|
||||||
|
}
|
||||||
|
-- To conserve memory we keep one menu at a time
|
||||||
|
local menu_widget = menu({
|
||||||
|
before = {
|
||||||
|
controls_widget
|
||||||
|
},
|
||||||
|
after = {
|
||||||
|
require("widgets.client-volume")({})
|
||||||
|
},
|
||||||
|
items = {
|
||||||
|
{ "Move to tag" ,
|
||||||
|
move_screentags
|
||||||
|
},
|
||||||
|
{ "Toggle on tag",
|
||||||
|
toggle_screentags
|
||||||
|
},
|
||||||
|
{ "Stop task",
|
||||||
|
function()
|
||||||
|
awful.spawn("kill "..tostring(client.focus.pid))
|
||||||
|
end
|
||||||
|
},
|
||||||
|
{ "Kill task",
|
||||||
|
function()
|
||||||
|
awful.spawn("kill -s KILL "..tostring(client.focus.pid))
|
||||||
|
end
|
||||||
|
},
|
||||||
|
{ "Debug info",
|
||||||
|
{
|
||||||
|
before = {
|
||||||
|
require("widgets.window-debug")()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
vertical = true
|
||||||
|
})
|
||||||
|
|
||||||
|
return function(c)
|
||||||
|
local buttons = gears.table.join(
|
||||||
|
awful.button({ }, 1, function()
|
||||||
|
c:emit_signal("request::activate", "titlebar", {raise = true})
|
||||||
|
awful.mouse.client.move(c)
|
||||||
|
end),
|
||||||
|
awful.button({ }, 3, function()
|
||||||
|
c:emit_signal("request::activate", "titlebar", {raise = true})
|
||||||
|
awful.mouse.client.resize(c)
|
||||||
|
end)
|
||||||
|
)
|
||||||
|
c.menu_button = awful.titlebar.widget.iconwidget(c)
|
||||||
|
-- A little trick we do to conserve memory and cpu usage on regenerating
|
||||||
|
-- buttons is we pop up a menu in the location of the icon
|
||||||
|
-- and insert buttons into the controls widget layout.
|
||||||
|
c.hidden_floatingbutton = awful.titlebar.widget.floatingbutton(c)
|
||||||
|
c.hidden_stickybutton = awful.titlebar.widget.stickybutton(c)
|
||||||
|
c.hidden_ontopbutton = awful.titlebar.widget.ontopbutton(c)
|
||||||
|
c.menu_button:connect_signal("button::press", function()
|
||||||
|
menu_widget.toggle()
|
||||||
|
if controls_widget then
|
||||||
|
controls_widget:reset()
|
||||||
|
controls_widget:add(c.hidden_floatingbutton)
|
||||||
|
controls_widget:add(c.hidden_stickybutton)
|
||||||
|
controls_widget:add(c.hidden_ontopbutton)
|
||||||
|
end
|
||||||
|
c:emit_signal("request::activate", "titlebar", {raise = true})
|
||||||
|
end)
|
||||||
|
c:connect_signal("unfocus",function()
|
||||||
|
if menu_widget.visible then
|
||||||
|
menu_widget.toggle(0,0)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
return awful.titlebar(c) : setup {
|
||||||
|
{ -- Left
|
||||||
|
c.menu_button,
|
||||||
|
layout = wibox.layout.fixed.horizontal
|
||||||
|
},
|
||||||
|
{ -- Middle
|
||||||
|
awful.titlebar.widget.titlewidget(c),
|
||||||
|
buttons = buttons,
|
||||||
|
layout = wibox.layout.flex.horizontal
|
||||||
|
},
|
||||||
|
{ -- Right
|
||||||
|
{
|
||||||
|
{
|
||||||
|
awful.titlebar.widget.maximizedbutton(c),
|
||||||
|
awful.titlebar.widget.minimizebutton (c),
|
||||||
|
awful.titlebar.widget.closebutton (c),
|
||||||
|
layout = wibox.layout.fixed.horizontal(),
|
||||||
|
widget = wibox.container.margin,
|
||||||
|
margins = 3
|
||||||
|
},
|
||||||
|
widget = wibox.container.background,
|
||||||
|
shape = gears.shape.rounded_bar,
|
||||||
|
bg = {
|
||||||
|
type = "linear",
|
||||||
|
from = { 0, 15 },
|
||||||
|
to = { 0, 0},
|
||||||
|
stops = { { 0, "#5d5d5955"} , {1, "39383555"} }
|
||||||
|
},
|
||||||
|
},
|
||||||
|
widget = wibox.container.margin,
|
||||||
|
margins = 2
|
||||||
|
},
|
||||||
|
spacing = 10,
|
||||||
|
layout = wibox.layout.align.horizontal,
|
||||||
|
}
|
||||||
|
end
|
|
@ -0,0 +1,31 @@
|
||||||
|
local awful = require("awful")
|
||||||
|
local gears = require("gears")
|
||||||
|
-- {{{ Variable definitions
|
||||||
|
global = {}
|
||||||
|
global.awesome_dir = os.getenv("HOME").."/.config/awesome/"
|
||||||
|
global.config_dir = os.getenv("HOME").."/.awesome/"
|
||||||
|
global.themes_dir = os.getenv("HOME").."/.config/awesome/themes/"
|
||||||
|
global.theme = global.awesome_dir .. "themes/unity/theme.lua"
|
||||||
|
global.terminal = "xterm"
|
||||||
|
global.editor = os.getenv("EDITOR") or "vim"
|
||||||
|
global.editor_cmd = global.terminal .. " -e ".. global.editor
|
||||||
|
global.modkey = "Mod4"
|
||||||
|
awful.layout.layouts = {
|
||||||
|
awful.layout.suit.floating,
|
||||||
|
awful.layout.suit.tile,
|
||||||
|
awful.layout.suit.tile.left,
|
||||||
|
awful.layout.suit.tile.bottom,
|
||||||
|
awful.layout.suit.tile.top,
|
||||||
|
awful.layout.suit.fair,
|
||||||
|
awful.layout.suit.fair.horizontal,
|
||||||
|
awful.layout.suit.spiral,
|
||||||
|
awful.layout.suit.spiral.dwindle,
|
||||||
|
awful.layout.suit.max,
|
||||||
|
awful.layout.suit.max.fullscreen,
|
||||||
|
awful.layout.suit.magnifier,
|
||||||
|
awful.layout.suit.corner.nw,
|
||||||
|
-- awful.layout.suit.corner.ne,
|
||||||
|
-- awful.layout.suit.corner.sw,
|
||||||
|
-- awful.layout.suit.corner.se,
|
||||||
|
}
|
||||||
|
-- }}}
|
|
@ -0,0 +1,73 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
width="48"
|
||||||
|
height="48"
|
||||||
|
viewBox="0 0 12.7 12.7"
|
||||||
|
version="1.1"
|
||||||
|
id="svg5"
|
||||||
|
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
|
||||||
|
sodipodi:docname="drawer-closed.svg"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#">
|
||||||
|
<sodipodi:namedview
|
||||||
|
id="namedview7"
|
||||||
|
pagecolor="#505050"
|
||||||
|
bordercolor="#ffffff"
|
||||||
|
borderopacity="1"
|
||||||
|
inkscape:pageshadow="0"
|
||||||
|
inkscape:pageopacity="0"
|
||||||
|
inkscape:pagecheckerboard="1"
|
||||||
|
inkscape:document-units="mm"
|
||||||
|
showgrid="false"
|
||||||
|
units="px"
|
||||||
|
inkscape:zoom="6.6340405"
|
||||||
|
inkscape:cx="3.1654917"
|
||||||
|
inkscape:cy="25.097827"
|
||||||
|
inkscape:window-width="1132"
|
||||||
|
inkscape:window-height="576"
|
||||||
|
inkscape:window-x="62"
|
||||||
|
inkscape:window-y="24"
|
||||||
|
inkscape:window-maximized="0"
|
||||||
|
inkscape:current-layer="layer1">
|
||||||
|
<inkscape:grid
|
||||||
|
type="xygrid"
|
||||||
|
id="grid9" />
|
||||||
|
</sodipodi:namedview>
|
||||||
|
<defs
|
||||||
|
id="defs2" />
|
||||||
|
<g
|
||||||
|
inkscape:label="Layer 1"
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer1">
|
||||||
|
<path
|
||||||
|
id="rect85"
|
||||||
|
style="fill:#ffffff;fill-rule:evenodd;stroke-width:0.132288"
|
||||||
|
d="M 4.6963541,6.3497502 8.0036458,8.3340001 V 4.3655002 Z"
|
||||||
|
sodipodi:nodetypes="cccc" />
|
||||||
|
</g>
|
||||||
|
<metadata
|
||||||
|
id="metadata676">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<cc:license
|
||||||
|
rdf:resource="http://creativecommons.org/publicdomain/zero/1.0/" />
|
||||||
|
</cc:Work>
|
||||||
|
<cc:License
|
||||||
|
rdf:about="http://creativecommons.org/publicdomain/zero/1.0/">
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Reproduction" />
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Distribution" />
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
|
||||||
|
</cc:License>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 2.2 KiB |
|
@ -0,0 +1,73 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
width="48"
|
||||||
|
height="48"
|
||||||
|
viewBox="0 0 12.7 12.7"
|
||||||
|
version="1.1"
|
||||||
|
id="svg5"
|
||||||
|
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
|
||||||
|
sodipodi:docname="drawer-open.svg"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#">
|
||||||
|
<sodipodi:namedview
|
||||||
|
id="namedview7"
|
||||||
|
pagecolor="#505050"
|
||||||
|
bordercolor="#ffffff"
|
||||||
|
borderopacity="1"
|
||||||
|
inkscape:pageshadow="0"
|
||||||
|
inkscape:pageopacity="0"
|
||||||
|
inkscape:pagecheckerboard="1"
|
||||||
|
inkscape:document-units="mm"
|
||||||
|
showgrid="false"
|
||||||
|
units="px"
|
||||||
|
inkscape:zoom="6.6340405"
|
||||||
|
inkscape:cx="3.1654917"
|
||||||
|
inkscape:cy="25.097827"
|
||||||
|
inkscape:window-width="1024"
|
||||||
|
inkscape:window-height="576"
|
||||||
|
inkscape:window-x="62"
|
||||||
|
inkscape:window-y="24"
|
||||||
|
inkscape:window-maximized="0"
|
||||||
|
inkscape:current-layer="layer1">
|
||||||
|
<inkscape:grid
|
||||||
|
type="xygrid"
|
||||||
|
id="grid9" />
|
||||||
|
</sodipodi:namedview>
|
||||||
|
<defs
|
||||||
|
id="defs2" />
|
||||||
|
<g
|
||||||
|
inkscape:label="Layer 1"
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer1">
|
||||||
|
<path
|
||||||
|
id="rect85"
|
||||||
|
style="fill:#ffffff;fill-rule:evenodd;stroke-width:0.132288"
|
||||||
|
d="M 8.0036458,6.3497502 4.6963541,8.3340001 V 4.3655002 Z"
|
||||||
|
sodipodi:nodetypes="cccc" />
|
||||||
|
</g>
|
||||||
|
<metadata
|
||||||
|
id="metadata602">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<cc:license
|
||||||
|
rdf:resource="http://creativecommons.org/publicdomain/zero/1.0/" />
|
||||||
|
</cc:Work>
|
||||||
|
<cc:License
|
||||||
|
rdf:about="http://creativecommons.org/publicdomain/zero/1.0/">
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Reproduction" />
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Distribution" />
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
|
||||||
|
</cc:License>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 2.2 KiB |
|
@ -22,7 +22,7 @@ local get_app_volume = function(pid)
|
||||||
for key,process in pairs(get_pactl_data()) do
|
for key,process in pairs(get_pactl_data()) do
|
||||||
-- Match app by pid
|
-- Match app by pid
|
||||||
if process:match("application.process.id = \""..tostring(pid).."\"") then
|
if process:match("application.process.id = \""..tostring(pid).."\"") then
|
||||||
return process:match("Volume: .-(%d?%d?%d)%%")
|
return tonumber(process:match("Volume: .-(%d?%d?%d)%%"))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- Return nil and an error if not found matching process
|
-- Return nil and an error if not found matching process
|
||||||
|
@ -93,7 +93,7 @@ return function(args)
|
||||||
if value then
|
if value then
|
||||||
slider.value = value
|
slider.value = value
|
||||||
widget.children[2] = slider
|
widget.children[2] = slider
|
||||||
widget.children[1].image = get_icon(tonumber(value))
|
widget.children[1].image = get_icon(value)
|
||||||
else
|
else
|
||||||
warning_text.markup = err
|
warning_text.markup = err
|
||||||
widget.children[2] = warning_text
|
widget.children[2] = warning_text
|
||||||
|
@ -102,7 +102,7 @@ return function(args)
|
||||||
end)
|
end)
|
||||||
slider:connect_signal("widget::redraw_needed",function()
|
slider:connect_signal("widget::redraw_needed",function()
|
||||||
set_app_volume(client.focus.pid,slider.value)
|
set_app_volume(client.focus.pid,slider.value)
|
||||||
widget.children[1].image = get_icon(tonumber(slider.value))
|
widget.children[1].image = get_icon(slider.value)
|
||||||
end)
|
end)
|
||||||
else
|
else
|
||||||
warning_text.markup = "pactl is not available"
|
warning_text.markup = "pactl is not available"
|
||||||
|
|
|
@ -58,10 +58,14 @@ return function(args)
|
||||||
end
|
end
|
||||||
s.lockscreen = awful.popup({
|
s.lockscreen = awful.popup({
|
||||||
widget = {
|
widget = {
|
||||||
|
{
|
||||||
|
-- Bottom layer
|
||||||
|
{
|
||||||
{
|
{
|
||||||
--Top bar
|
--Top bar
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
|
-- Top bar contents
|
||||||
{
|
{
|
||||||
markup = "AwesomewWM",
|
markup = "AwesomewWM",
|
||||||
widget = wibox.widget.textbox
|
widget = wibox.widget.textbox
|
||||||
|
@ -70,22 +74,54 @@ return function(args)
|
||||||
widget = wibox.container.background
|
widget = wibox.container.background
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
require("widgets.battery")({percentage = true}),
|
require("widgets.battery")({
|
||||||
|
percentage = true
|
||||||
|
}),
|
||||||
wibox.widget.textclock(),
|
wibox.widget.textclock(),
|
||||||
widget = wibox.container.background,
|
widget = wibox.container.background,
|
||||||
layout = wibox.layout.fixed.horizontal
|
layout = wibox.layout.fixed.horizontal
|
||||||
},
|
},
|
||||||
layout = wibox.layout.align.horizontal,
|
layout = wibox.layout.align.horizontal,
|
||||||
},
|
},
|
||||||
|
widget = wibox.container.margin,
|
||||||
|
left = 5,
|
||||||
|
right = 5
|
||||||
|
},
|
||||||
widget = wibox.container.background,
|
widget = wibox.container.background,
|
||||||
forced_width = s.geometry.width,
|
forced_width = s.geometry.width,
|
||||||
forced_height = style.lockscreen_bar_height or 25,
|
forced_height = style.lockscreen_bar_height or 25,
|
||||||
bg = style.lockscreen_bar_bg or style.lockscreen_bg_normal
|
bg = style.lockscreen_bar_bg or
|
||||||
|
style.lockscreen_bg_normal
|
||||||
|
},
|
||||||
|
{
|
||||||
|
--Drop shadow
|
||||||
|
{
|
||||||
|
markup = "",
|
||||||
|
widget = wibox.widget.textbox,
|
||||||
|
},
|
||||||
|
widget = wibox.container.background,
|
||||||
|
forced_height = style.lockscreen_bar_shadow or 5,
|
||||||
|
forced_width = s.geometry.width,
|
||||||
|
bg = {
|
||||||
|
-- Gradient
|
||||||
|
type = "linear",
|
||||||
|
from = { 0, 0 },
|
||||||
|
to = { 0, style.lockscreen_bar_shadow or 5},
|
||||||
|
stops = {
|
||||||
|
{ 0, style.lockscreen_bar_shadow_color_start or
|
||||||
|
"#00000055" },
|
||||||
|
{ 1, style.lockscreen_bar_shadow_color_end or
|
||||||
|
"#00000000" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
layout = wibox.layout.fixed.vertical
|
||||||
},
|
},
|
||||||
widget = wibox.container.place,
|
widget = wibox.container.place,
|
||||||
valign = "top",
|
valign = "top",
|
||||||
halign = "center"
|
halign = "center"
|
||||||
},{
|
},
|
||||||
|
{
|
||||||
--Combo box (face, nickname, password entry)
|
--Combo box (face, nickname, password entry)
|
||||||
style.container({
|
style.container({
|
||||||
(read("./.face") and style.container {
|
(read("./.face") and style.container {
|
||||||
|
|
|
@ -21,7 +21,7 @@ return function(widget,list,max_elements)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function new_pager:next()
|
function new_pager:next()
|
||||||
if #list >= self.index*self.max then
|
if #list >= (self.index+1)*self.max then
|
||||||
self.index = self.index + 1
|
self.index = self.index + 1
|
||||||
new_pager:update()
|
new_pager:update()
|
||||||
end
|
end
|
||||||
|
|
|
@ -138,9 +138,13 @@ local function loader(options)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
elseif type(v[2]) == "function" then
|
elseif type(v[2]) == "function" then
|
||||||
new_button:connect_signal("button::press",v[2])
|
new_button:connect_signal("button::press",function()
|
||||||
|
cascade_close(tree_path,1)
|
||||||
|
v[2]()
|
||||||
|
end)
|
||||||
elseif type(v[2]) == "string" then
|
elseif type(v[2]) == "string" then
|
||||||
new_button:connect_signal("button::press",function()
|
new_button:connect_signal("button::press",function()
|
||||||
|
cascade_close(tree_path,1)
|
||||||
awful.spawn(v[2])
|
awful.spawn(v[2])
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
@ -152,9 +156,6 @@ local function loader(options)
|
||||||
menu.current_button = new_button
|
menu.current_button = new_button
|
||||||
menu.current_button.bg = button_bg_on
|
menu.current_button.bg = button_bg_on
|
||||||
end)
|
end)
|
||||||
new_button:connect_signal("button::press",function()
|
|
||||||
cascade_close(tree_path,1)
|
|
||||||
end)
|
|
||||||
table.insert(menu,new_button)
|
table.insert(menu,new_button)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -183,6 +184,9 @@ local function loader(options)
|
||||||
tree_path[1] = menu
|
tree_path[1] = menu
|
||||||
menu.visible = (not menu.visible)
|
menu.visible = (not menu.visible)
|
||||||
end
|
end
|
||||||
|
menu.show = function(self)
|
||||||
|
menu.toggle()
|
||||||
|
end
|
||||||
return menu
|
return menu
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ local awmtk = require("awmtk")
|
||||||
function unitybar(s,args)
|
function unitybar(s,args)
|
||||||
local style = awmtk.style(awmtk.defaults,args.style or {},"unitybar_")
|
local style = awmtk.style(awmtk.defaults,args.style or {},"unitybar_")
|
||||||
s.myunitybar = awful.wibar({
|
s.myunitybar = awful.wibar({
|
||||||
position = "left",
|
position = args.position or "left",
|
||||||
screen = s,
|
screen = s,
|
||||||
border_width = style.unitybar_border_width or 1,
|
border_width = style.unitybar_border_width or 1,
|
||||||
border_color = style.unitybar_border_color or "#262626AA",
|
border_color = style.unitybar_border_color or "#262626AA",
|
||||||
|
@ -13,7 +13,21 @@ function unitybar(s,args)
|
||||||
(type(style.bg_normal) == "string") and
|
(type(style.bg_normal) == "string") and
|
||||||
(style.bg_normal:len() < 8) and
|
(style.bg_normal:len() < 8) and
|
||||||
style.bg_normal.."AA"),
|
style.bg_normal.."AA"),
|
||||||
width = style.unitybar_width or 50,
|
width = (function()
|
||||||
|
if (not args.position) or
|
||||||
|
(args.position == "left") or
|
||||||
|
(args.position == "right")
|
||||||
|
then
|
||||||
|
return style.unitybar_width or 50
|
||||||
|
end
|
||||||
|
end)(),
|
||||||
|
height = (function()
|
||||||
|
if (args.position == "bottom") or
|
||||||
|
(args.posiiton == "top")
|
||||||
|
then
|
||||||
|
return style.unitybar_width or 50
|
||||||
|
end
|
||||||
|
end)()
|
||||||
})
|
})
|
||||||
local top_widgets = {
|
local top_widgets = {
|
||||||
layout = wibox.layout.fixed.vertical,
|
layout = wibox.layout.fixed.vertical,
|
||||||
|
@ -31,7 +45,15 @@ function unitybar(s,args)
|
||||||
widget = wibox.container.margin,
|
widget = wibox.container.margin,
|
||||||
margins = style.unitybar_inner_margin,
|
margins = style.unitybar_inner_margin,
|
||||||
{
|
{
|
||||||
layout = wibox.layout.align.vertical,
|
layout = (function()
|
||||||
|
if (s.myunitybar.position == "left") or
|
||||||
|
(s.myunitybar.position == "right")
|
||||||
|
then
|
||||||
|
return wibox.layout.align.vertical
|
||||||
|
else
|
||||||
|
return wibox.layout.align.horizontal
|
||||||
|
end
|
||||||
|
end)(),
|
||||||
top_widgets,
|
top_widgets,
|
||||||
{ --Middle spacer
|
{ --Middle spacer
|
||||||
widget = wibox.container.background
|
widget = wibox.container.background
|
||||||
|
|
Loading…
Reference in New Issue