From 526f481f0b7cfa9c622ec0b215a4871694267ee8 Mon Sep 17 00:00:00 2001 From: Gokul Swami Date: Thu, 18 Feb 2021 05:52:09 -0800 Subject: [PATCH 1/2] Added Beautiful Vars Added more variables for customizing, which defaults to the ones from the dev. --- editor.lua | 12 +++++++++--- switcher.lua | 16 ++++++++++++---- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/editor.lua b/editor.lua index 918a1d0..e0229c2 100644 --- a/editor.lua +++ b/editor.lua @@ -663,9 +663,15 @@ function module.create(data) local label_size = api.dpi(30) local info_size = api.dpi(60) -- colors are in rgba - local border_color = with_alpha(api.gears.color(api.beautiful.border_focus), 0.75) - local active_color = with_alpha(api.gears.color(api.beautiful.bg_focus), 0.5) - local open_color = with_alpha(api.gears.color(api.beautiful.bg_normal), 0.5) + local border_color = with_alpha(api.gears.color( + api.beautiful.editor_border_color or api.beautiful.border_focus), + api.beautiful.editor_border_opacity or 0.75) + local active_color = with_alpha(api.gears.color( + api.beautiful.editor_active_color or api.beautiful.bg_focus), + api.beautiful.editor_active_opacity or 0.5) + local open_color = with_alpha(api.gears.color( + api.beautiful.editor_open_color or api.beautiful.bg_normal), + api.beautiful.editor_open_opacity or 0.5) local closed_color = open_color screen = screen or api.screen.focused() diff --git a/switcher.lua b/switcher.lua index fbbc4de..dea08d0 100644 --- a/switcher.lua +++ b/switcher.lua @@ -50,10 +50,18 @@ function module.start(c, exit_keys) local font_color = with_alpha(api.gears.color(api.beautiful.fg_normal), 1) local font_color_hl = with_alpha(api.gears.color(api.beautiful.fg_focus), 1) local label_size = api.dpi(30) - local border_color = with_alpha(api.gears.color(api.beautiful.border_focus), 0.25) - local fill_color = with_alpha(api.gears.color(api.beautiful.bg_normal), 0.25) - local box_bg = with_alpha(api.gears.color(api.beautiful.bg_normal), 0.85) - local fill_color_hl = with_alpha(api.gears.color(api.beautiful.bg_focus), 1) + local border_color = with_alpha(api.gears.color( + api.beautiful.switcher_border_color or api.beautiful.border_focus), + api.beautiful.switcher_border_opacity or 0.25) + local fill_color = with_alpha(api.gears.color( + api.beautiful.switcher_fill_color or api.beautiful.bg_normal), + api.beautiful.switcher_fill_opacity or 0.25) + local box_bg = with_alpha(api.gears.color( + api.beautiful.switcher_box_bg or api.beautiful.bg_normal), + api.beautiful.switcher_box_opacity or 0.85) + local fill_color_hl = with_alpha(api.gears.color( + api.beautiful.switcher_fill_color_hl or api.beautiful.bg_focus), + api.beautiful.switcher_fill_hl_opacity or 1) -- for comparing floats local threshold = 0.1 local traverse_radius = api.dpi(5) From 88ee21dcdc74dc049bc70114b4cb9e8800113322 Mon Sep 17 00:00:00 2001 From: Gokul Swami Date: Mon, 1 Mar 2021 02:37:57 -0800 Subject: [PATCH 2/2] Prefix beautiful variables with "machi" --- editor.lua | 12 ++++++------ switcher.lua | 16 ++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/editor.lua b/editor.lua index e0229c2..bab862f 100644 --- a/editor.lua +++ b/editor.lua @@ -664,14 +664,14 @@ function module.create(data) local info_size = api.dpi(60) -- colors are in rgba local border_color = with_alpha(api.gears.color( - api.beautiful.editor_border_color or api.beautiful.border_focus), - api.beautiful.editor_border_opacity or 0.75) + api.beautiful.machi_editor_border_color or api.beautiful.border_focus), + api.beautiful.machi_editor_border_opacity or 0.75) local active_color = with_alpha(api.gears.color( - api.beautiful.editor_active_color or api.beautiful.bg_focus), - api.beautiful.editor_active_opacity or 0.5) + api.beautiful.machi_editor_active_color or api.beautiful.bg_focus), + api.beautiful.machi_editor_active_opacity or 0.5) local open_color = with_alpha(api.gears.color( - api.beautiful.editor_open_color or api.beautiful.bg_normal), - api.beautiful.editor_open_opacity or 0.5) + api.beautiful.machi_editor_open_color or api.beautiful.bg_normal), + api.beautiful.machi_editor_open_opacity or 0.5) local closed_color = open_color screen = screen or api.screen.focused() diff --git a/switcher.lua b/switcher.lua index dea08d0..ee41679 100644 --- a/switcher.lua +++ b/switcher.lua @@ -51,17 +51,17 @@ function module.start(c, exit_keys) local font_color_hl = with_alpha(api.gears.color(api.beautiful.fg_focus), 1) local label_size = api.dpi(30) local border_color = with_alpha(api.gears.color( - api.beautiful.switcher_border_color or api.beautiful.border_focus), - api.beautiful.switcher_border_opacity or 0.25) + api.beautiful.machi_switcher_border_color or api.beautiful.border_focus), + api.beautiful.machi_switcher_border_opacity or 0.25) local fill_color = with_alpha(api.gears.color( - api.beautiful.switcher_fill_color or api.beautiful.bg_normal), - api.beautiful.switcher_fill_opacity or 0.25) + api.beautiful.machi_switcher_fill_color or api.beautiful.bg_normal), + api.beautiful.machi_switcher_fill_opacity or 0.25) local box_bg = with_alpha(api.gears.color( - api.beautiful.switcher_box_bg or api.beautiful.bg_normal), - api.beautiful.switcher_box_opacity or 0.85) + api.beautiful.machi_switcher_box_bg or api.beautiful.bg_normal), + api.beautiful.machi_switcher_box_opacity or 0.85) local fill_color_hl = with_alpha(api.gears.color( - api.beautiful.switcher_fill_color_hl or api.beautiful.bg_focus), - api.beautiful.switcher_fill_hl_opacity or 1) + api.beautiful.machi_switcher_fill_color_hl or api.beautiful.bg_focus), + api.beautiful.machi_switcher_fill_hl_opacity or 1) -- for comparing floats local threshold = 0.1 local traverse_radius = api.dpi(5)