finished application laucnher and bluetooth widget

This commit is contained in:
Rene Kievits
2022-11-27 10:58:27 +01:00
parent c6341f84e7
commit 10f56a7273
77 changed files with 2379 additions and 4938 deletions

View File

@@ -7,6 +7,8 @@ local dpi = require("beautiful").xresources.apply_dpi
local gears = require("gears")
local wibox = require("wibox")
require("src.tools.helpers.audio")
local capi = {
awesome = awesome,
}

View File

@@ -17,6 +17,22 @@ local icondir = gears.filesystem.get_configuration_dir() .. "src/assets/icons/bl
-- Returns the bluetooth widget
return function(s)
local bt_widget = require("src.modules.bluetooth.init") { screen = s }
local bluetooth_container = awful.popup {
widget = bt_widget:get_widget(),
ontop = true,
bg = Theme_config.bluetooth_controller.container_bg,
stretch = false,
visible = false,
forced_width = dpi(400),
screen = s,
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, dpi(12))
end
}
local bluetooth_widget = wibox.widget {
{
{
@@ -43,24 +59,23 @@ return function(s)
end,
widget = wibox.container.background
}
bt_widget:connect_signal("bluetooth::status", function(status)
bluetooth_widget:get_children_by_id("icon")[1].image = gears.color.recolor_image(status._private.Adapter1.Powered and
icondir .. "bluetooth-on.svg" or icondir .. "bluetooth-off.svg", Theme_config.bluetooth.fg)
end)
-- Hover signal to change color when mouse is over
Hover_signal(bluetooth_widget)
capi.awesome.connect_signal("state", function(state)
if state then
bluetooth_widget:get_children_by_id("icon")[1]:set_image(gears.color.recolor_image(icondir .. "bluetooth-on.svg",
Theme_config.bluetooth.fg))
else
bluetooth_widget:get_children_by_id("icon")[1]:set_image(gears.color.recolor_image(icondir .. "bluetooth-off.svg",
Theme_config.bluetooth.fg))
end
end)
bluetooth_widget:connect_signal(
"button::press",
function(_, _, _, key)
if key == 1 then
capi.awesome.emit_signal("bluetooth_controller::toggle", s)
local geo = mouse.current_wibox:geometry()
bluetooth_container.x = geo.x
bluetooth_container.y = geo.y + dpi(55)
bluetooth_container.visible = not bluetooth_container.visible
else
capi.awesome.emit_signal("toggle_bluetooth")
end

View File

@@ -11,6 +11,10 @@ local wibox = require("wibox")
local color = require("src.lib.color")
local rubato = require("src.lib.rubato")
require("src.tools.helpers.cpu_freq")
require("src.tools.helpers.cpu_temp")
--!Has to be disabled until rewritten to perform better require("src.tools.helpers.cpu_usage")
local capi = {
awesome = awesome,
}

View File

@@ -75,7 +75,7 @@ return function(s)
awful.button({}, 1, function()
local geo = mouse.current_wibox:geometry()
calendar_popup.x = geo.x
calendar_popup.y = geo.y + Global_config.top_struts
calendar_popup.y = geo.y + dpi(55)
calendar_popup.visible = not calendar_popup.visible
end)
)

View File

@@ -11,6 +11,9 @@ local wibox = require("wibox")
local color = require("src.lib.color")
local rubato = require("src.lib.rubato")
require("src.tools.helpers.gpu_temp")
require("src.tools.helpers.gpu_usage")
local capi = {
awesome = awesome,
}

View File

@@ -17,6 +17,7 @@ local capi = {
local icondir = gears.filesystem.get_configuration_dir() .. "src/assets/icons/kblayout/"
return function(s)
local kblayout_widget = wibox.widget {
{
{

View File

@@ -24,8 +24,10 @@ local interfaces = {
local network_mode = nil
local nm_widget = require("src.modules.network_controller.init")
-- Returns the network widget
return function()
return function(s)
local startup = true
local reconnect_startup = true
local wifi_strength
@@ -331,6 +333,21 @@ return function()
end
}
local network_container = awful.popup {
widget = nm_widget {},
bg = Theme_config.network_manager.bg,
screen = s,
stretch = false,
visible = false,
ontop = true,
placement = function(c) awful.placement.align(c,
{ position = "top_right", margins = { right = dpi(350), top = dpi(60) } })
end,
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, dpi(12))
end
}
-- Signals
Hover_signal(network_widget)
@@ -341,7 +358,7 @@ return function()
1,
nil,
function()
capi.awesome.emit_signal("NM::toggle_container")
network_container.visible = not network_container.visible
end
),
awful.button(

View File

@@ -9,6 +9,8 @@ local gears = require("gears")
local watch = awful.widget.watch
local wibox = require("wibox")
require("src.tools.helpers.ram")
local capi = {
awesome = awesome,
}