From 8e8c4840da6fb99bb4c8bb367506bfde07b73686 Mon Sep 17 00:00:00 2001 From: Mark Date: Sat, 16 Jul 2022 15:47:42 -0700 Subject: [PATCH] Removed sound and mdadm wrappers --- desktop/init.lua | 3 --- desktop/widgets/mdadm.lua | 49 ---------------------------------- modules/volume/util.lua | 4 +-- rc.lua | 1 + wrapper/sound.lua => sound.lua | 0 wrapper/init.lua | 4 +-- wrapper/mdadm.lua | 38 -------------------------- 7 files changed, 4 insertions(+), 95 deletions(-) delete mode 100644 desktop/widgets/mdadm.lua rename wrapper/sound.lua => sound.lua (100%) delete mode 100644 wrapper/mdadm.lua diff --git a/desktop/init.lua b/desktop/init.lua index 6e3a0ea..0a36eb8 100755 --- a/desktop/init.lua +++ b/desktop/init.lua @@ -10,7 +10,6 @@ local desktop = { tagindicator = require("desktop.widgets.tagindicator"), launcher = require("desktop.widgets.launcher"), shortcut = require("desktop.widgets.shortcut"), - --mdadm = require("desktop.widgets.mdadm"), --winstat = require("desktop.widgets.window_status"), space = function(size) @@ -186,8 +185,6 @@ awful.screen.connect_for_each_screen( desktop.widgets.keymap, desktop.widgets.space(8), - --desktop.widgets.mdadm, - desktop.widgets.space(8) }) diff --git a/desktop/widgets/mdadm.lua b/desktop/widgets/mdadm.lua deleted file mode 100644 index 629bbd8..0000000 --- a/desktop/widgets/mdadm.lua +++ /dev/null @@ -1,49 +0,0 @@ -local raidw = {} - - -raidw.title_text = wibox.widget.textbox("Raid") -raidw.title_text.valign = "center" -raidw.title_text.align = "center" -raidw.title_text.font = "Hack NF 10" - -raidw.widget = wibox.widget { - { - { -- Right spacer - widget = wibox.widget.separator, - color = beautiful.color.transparent, - forced_width = beautiful.dpi(3) - }, - - wibox.widget { - raidw.title_text, - wrapper.mdadm.indicator_text, - - forced_num_cols = 1, - forced_num_rows = 2, - homogeneous = true, - expand = true, - layout = wibox.layout.grid - }, - - { -- Left spacer - widget = wibox.widget.separator, - color = beautiful.color.transparent, - forced_width = beautiful.dpi(3) - }, - - layout = wibox.layout.align.horizontal, - }, - layout = wibox.container.background, -} - - --- Change background when mouse is over widget -raidw.widget:connect_signal("mouse::enter", function(result) - raidw.widget.bg = beautiful.color.bar.hover_bg -end) - -raidw.widget:connect_signal("mouse::leave", function(result) - raidw.widget.bg = beautiful.color.transparent -end) - -return raidw.widget diff --git a/modules/volume/util.lua b/modules/volume/util.lua index 58aaf1a..505e6e2 100755 --- a/modules/volume/util.lua +++ b/modules/volume/util.lua @@ -81,7 +81,7 @@ volume.volume_up = function() end volume.commands:up() - wrapper.sound.play("volume_up") + Sound.play("volume_up") volume.exec_hooks() end @@ -92,7 +92,7 @@ volume.volume_down = function() end volume.commands:down() - wrapper.sound.play("volume_down") + Sound.play("volume_down") volume.exec_hooks() end diff --git a/rc.lua b/rc.lua index d6ac196..12368bc 100755 --- a/rc.lua +++ b/rc.lua @@ -37,6 +37,7 @@ wrapper = require("wrapper") beautiful.init(require("theme")) +Sound = require("sound") -- Load key bindings local binds = require("binds") diff --git a/wrapper/sound.lua b/sound.lua similarity index 100% rename from wrapper/sound.lua rename to sound.lua diff --git a/wrapper/init.lua b/wrapper/init.lua index 9dde4a8..1a2d722 100755 --- a/wrapper/init.lua +++ b/wrapper/init.lua @@ -1,5 +1,3 @@ return { - backlight = require("wrapper.backlight"), - sound = require("wrapper.sound"), - mdadm = require("wrapper.mdadm") + backlight = require("wrapper.backlight") } diff --git a/wrapper/mdadm.lua b/wrapper/mdadm.lua deleted file mode 100644 index 94c79e9..0000000 --- a/wrapper/mdadm.lua +++ /dev/null @@ -1,38 +0,0 @@ -local mdadm = {} - -mdadm.get = function(callback) - awful.spawn.easy_async("awk '/^md/ {printf \"%s: \", $1}; /blocks/ {print $NF}' /proc/mdstat", - function(stdout, stderr, exitreason, exitcode) - status = string.match(stdout, "%[(.*)%]") - callback(status) - - end) -end - - - -mdadm.indicator_text = wibox.widget.textbox("??") -mdadm.indicator_text.valign = "center" -mdadm.indicator_text.align = "center" -mdadm.indicator_text.font = "Hack NF 10" - - -mdadm.update_indicator = function(status) - mdadm.indicator_text.markup = status -end - --- Update the indicator -mdadm.update_timer = gears.timer { - timeout = 2, - call_now = false, - autostart = false, -- change to true to enable - single_shot = false, - - callback = function() - mdadm.get( - mdadm.update_indicator - ) - end -} - -return mdadm