Add popup border config in app_launcher (#190)

* fix(app_launcher): app_name_normal_color on initial entries

* use app_name_normal_color for initial entry names

* feat(app_launcher): allow configuring popup borders

* add border_color and border_width configuration args
This commit is contained in:
Jordan Callicoat 2023-01-19 04:41:52 -06:00 committed by GitHub
parent e6de047ced
commit 14196af7b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 5 deletions

View File

@ -4,7 +4,7 @@ A popup application launcher similar to Rofi
![](https://user-images.githubusercontent.com/33443763/140196352-07e444fe-cccd-45ad-93fa-5705f09e516b.png) ![](https://user-images.githubusercontent.com/33443763/140196352-07e444fe-cccd-45ad-93fa-5705f09e516b.png)
*image by [JavaCafe01](https://github.com/JavaCafe01)* _image by [JavaCafe01](https://github.com/JavaCafe01)_
### Usage ### Usage
@ -32,6 +32,7 @@ local app_launcher = bling.widget.app_launcher(args)
``` ```
### Available Options: ### Available Options:
```lua ```lua
local args = { local args = {
terminal = "alacritty" -- Set default terminal terminal = "alacritty" -- Set default terminal
@ -65,6 +66,8 @@ local args = {
shrink_width = true -- Automatically shrink width of launcher to fit varying numbers of apps in list (works on apps_per_column) shrink_width = true -- Automatically shrink width of launcher to fit varying numbers of apps in list (works on apps_per_column)
shrink_height = true -- Automatically shrink height of launcher to fit varying numbers of apps in list (works on apps_per_row) shrink_height = true -- Automatically shrink height of launcher to fit varying numbers of apps in list (works on apps_per_row)
background = "#FFFFFF" -- Set bg color background = "#FFFFFF" -- Set bg color
border_width = dpi(0) -- Set border width of popup
border_color = "#FFFFFF" -- Set border color of popup
shape = function(cr, width, height) shape = function(cr, width, height)
gears.shape.rectangle(cr, width, height) gears.shape.rectangle(cr, width, height)
end -- Set shape for launcher end -- Set shape for launcher

View File

@ -143,7 +143,7 @@ local function create_app_widget(self, entry)
widget = wibox.widget.textbox, widget = wibox.widget.textbox,
id = "name", id = "name",
font = self.app_name_font, font = self.app_name_font,
markup = entry.name markup = string.format("<span foreground='%s'>%s</span>", self.app_name_normal_color, entry.name)
} or nil } or nil
local generic_name = entry.generic_name ~= nil and self.app_show_generic_name == true and local generic_name = entry.generic_name ~= nil and self.app_show_generic_name == true and
@ -780,6 +780,8 @@ local function new(args)
args.shrink_width = args.shrink_width ~= nil and args.shrink_width or false args.shrink_width = args.shrink_width ~= nil and args.shrink_width or false
args.shrink_height = args.shrink_height ~= nil and args.shrink_height or false args.shrink_height = args.shrink_height ~= nil and args.shrink_height or false
args.background = args.background or "#000000" args.background = args.background or "#000000"
args.border_width = args.border_width or beautiful.border_width or dpi(0)
args.border_color = args.border_color or beautiful.border_color or "#FFFFFF"
args.shape = args.shape or nil args.shape = args.shape or nil
args.prompt_height = args.prompt_height or dpi(100) args.prompt_height = args.prompt_height or dpi(100)
@ -923,6 +925,8 @@ local function new(args)
visible = false, visible = false,
ontop = true, ontop = true,
placement = ret.placement, placement = ret.placement,
border_width = ret.border_width,
border_color = ret.border_color,
shape = ret.shape, shape = ret.shape,
bg = ret.background, bg = ret.background,
widget = widget =