@@ -10,21 +10,14 @@ local awful = require("awful")
10
10
local wibox = require (" wibox" )
11
11
local watch = require (" awful.widget.watch" )
12
12
local spawn = require (" awful.spawn" )
13
- local naughty = require (" naughty " )
13
+ local beautiful = require (' beautiful ' )
14
14
15
15
local cmus_widget = {}
16
16
17
- local function show_warning (message )
18
- naughty .notify {
19
- preset = naughty .config .presets .critical ,
20
- title = " Cmus Widget" ,
21
- text = message }
22
- end
23
-
24
17
local function worker (user_args )
25
18
26
19
local args = user_args or {}
27
- local font = args .font or " Play 9 "
20
+ local font = args .font or beautiful . font
28
21
29
22
local path_to_icons = args .path_to_icons or " /usr/share/icons/Arc/actions/symbolic/"
30
23
local timeout = args .timeout or 10
@@ -44,6 +37,7 @@ local function worker(user_args)
44
37
font = font ,
45
38
widget = wibox .widget .textbox
46
39
},
40
+ spacing = space ,
47
41
layout = wibox .layout .fixed .horizontal ,
48
42
update_icon = function (self , name )
49
43
self :get_children_by_id (" playback_icon" )[1 ]:set_image (path_to_icons .. name )
@@ -53,7 +47,7 @@ local function worker(user_args)
53
47
end
54
48
}
55
49
56
- function update_widget (widget , stdout , _ , _ , code )
50
+ local function update_widget (widget , stdout , _ , _ , code )
57
51
if code == 0 then
58
52
local cmus_info = {}
59
53
@@ -63,12 +57,12 @@ local function worker(user_args)
63
57
if key and val then
64
58
cmus_info [key ] = val
65
59
else
66
- local key , val = string.match (s , " ^set (%a+) (.+)$" )
60
+ key , val = string.match (s , " ^set (%a+) (.+)$" )
67
61
68
62
if key and val then
69
63
cmus_info [key ] = val
70
64
else
71
- local key , val = string.match (s , " ^(%a+) (.+)$" )
65
+ key , val = string.match (s , " ^(%a+) (.+)$" )
72
66
if key and val then
73
67
cmus_info [key ] = val
74
68
end
@@ -96,7 +90,6 @@ local function worker(user_args)
96
90
widget .visible = true
97
91
else
98
92
widget .visible = false
99
- widget .width = 0
100
93
end
101
94
else
102
95
widget .visible = false
0 commit comments