desktop, calendar, various other modules
This commit is contained in:
@@ -7,17 +7,13 @@ local awful = require("awful")
|
||||
local dpi = require("beautiful").xresources.apply_dpi
|
||||
local gears = require("gears")
|
||||
local wibox = require("wibox")
|
||||
require("src.core.signals")
|
||||
|
||||
local capi = {
|
||||
awesome = awesome,
|
||||
}
|
||||
|
||||
-- Icon directory path
|
||||
local icondir = gears.filesystem.get_configuration_dir() .. "src/assets/icons/date/"
|
||||
|
||||
-- Returns the date widget
|
||||
return function()
|
||||
return function(s)
|
||||
local cal = require("src.modules.calendar.init") { screen = s }
|
||||
|
||||
local date_widget = wibox.widget {
|
||||
{
|
||||
@@ -63,13 +59,24 @@ return function()
|
||||
widget = wibox.container.background
|
||||
}
|
||||
|
||||
local calendar_popup = awful.popup {
|
||||
widget = cal:get_widget(),
|
||||
screen = s,
|
||||
ontop = true,
|
||||
bg = "#00000000",
|
||||
visible = false,
|
||||
}
|
||||
|
||||
-- Signals
|
||||
Hover_signal(date_widget)
|
||||
|
||||
date_widget:buttons {
|
||||
gears.table.join(
|
||||
awful.button({}, 1, function()
|
||||
capi.awesome.emit_signal("calendar::toggle", date_widget)
|
||||
local geo = mouse.current_wibox:geometry()
|
||||
calendar_popup.x = geo.x
|
||||
calendar_popup.y = geo.y + Global_config.top_struts
|
||||
calendar_popup.visible = not calendar_popup.visible
|
||||
end)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ local capi = {
|
||||
local icon_dir = gears.filesystem.get_configuration_dir() .. "src/assets/icons/cpu/"
|
||||
|
||||
return function(widget)
|
||||
|
||||
local gpu_usage_widget = wibox.widget {
|
||||
{
|
||||
{
|
||||
|
||||
@@ -334,11 +334,25 @@ return function()
|
||||
-- Signals
|
||||
Hover_signal(network_widget)
|
||||
|
||||
network_widget:connect_signal(
|
||||
"button::press",
|
||||
function()
|
||||
awful.spawn("gnome-control-center wlan")
|
||||
end
|
||||
network_widget:buttons(
|
||||
gears.table.join(
|
||||
awful.button(
|
||||
{},
|
||||
1,
|
||||
nil,
|
||||
function()
|
||||
capi.awesome.emit_signal("NM::toggle_container")
|
||||
end
|
||||
),
|
||||
awful.button(
|
||||
{},
|
||||
3,
|
||||
nil,
|
||||
function()
|
||||
capi.awesome.emit_signal("NM::toggle_wifi")
|
||||
end
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
return network_widget
|
||||
|
||||
@@ -110,16 +110,6 @@ local list_update = function(widget, buttons, _, _, objects)
|
||||
strategy = "exact",
|
||||
layout = wibox.container.constraint,
|
||||
})
|
||||
|
||||
--[[ awful.spawn.easy_async_with_shell(
|
||||
"ps -o cmd " .. client.pid .. " | tail -n 1",
|
||||
function(stdout)
|
||||
local cmd = stdout:gsub("\n", "")
|
||||
local app_info = Gio.AppInfo.create_from_commandline(cmd, client.name, {})
|
||||
local exec = Gio.AppInfo.get_executable(app_info)
|
||||
icon:get_children_by_id("icon")[1].image = Get_icon(exec)
|
||||
end
|
||||
) ]]
|
||||
end
|
||||
|
||||
Hover_signal(tag_widget)
|
||||
|
||||
Reference in New Issue
Block a user