@@ -39,17 +39,25 @@ impl Renamer {
39
39
. collect :: < FxHashMap < _ , _ > > ( ) ;
40
40
41
41
for client in clients {
42
- let class = client. class ;
42
+ let class = client. class . to_uppercase ( ) ;
43
43
if class. is_empty ( ) {
44
44
continue ;
45
45
}
46
46
47
- let title = client. title ;
48
- if self . cfg . lock ( ) ?. config . exclude . iter ( ) . any ( |( c, t) | {
49
- c == & class. to_uppercase ( ) && [ title. to_uppercase ( ) , "*" . to_string ( ) ] . contains ( t)
50
- } ) {
47
+ let title = client. title . to_uppercase ( ) ;
48
+ if self
49
+ . cfg
50
+ . lock ( ) ?
51
+ . config
52
+ . exclude
53
+ . iter ( )
54
+ . any ( |( c, t) | c == & class && ( t == & title || t == "*" ) )
55
+ {
51
56
if self . args . verbose {
52
- println ! ( "- window: class '{class}' with title '{title}' is exclude" )
57
+ println ! (
58
+ "- window: class '{}' with title '{}' is exclude" ,
59
+ client. class, client. title
60
+ )
53
61
}
54
62
continue ;
55
63
}
@@ -63,9 +71,12 @@ impl Renamer {
63
71
let should_dedup = self . args . dedup && is_dup;
64
72
65
73
if self . args . verbose && should_dedup {
66
- println ! ( "- window: class '{class }' is duplicate" )
74
+ println ! ( "- window: class '{}' is duplicate" , client . class )
67
75
} else if self . args . verbose {
68
- println ! ( "- window: class '{class}', title '{title}', got this icon '{icon}'" )
76
+ println ! (
77
+ "- window: class '{}', title '{}', got this icon '{icon}'" ,
78
+ client. class, client. title
79
+ )
69
80
} ;
70
81
71
82
self . workspaces . lock ( ) ?. insert ( workspace_id) ;
@@ -156,7 +167,7 @@ impl Renamer {
156
167
cfg. config
157
168
. icons
158
169
. get ( class)
159
- . or_else ( || cfg. config . icons . get ( class. to_uppercase ( ) . as_str ( ) ) )
170
+ . or_else ( || cfg. config . icons . get ( class) )
160
171
. unwrap_or_else ( || {
161
172
if self . args . verbose {
162
173
println ! ( "- window: class '{class}' need a shiny icon" ) ;
@@ -171,7 +182,7 @@ impl Renamer {
171
182
let cfg = & self . cfg . lock ( ) . expect ( "Unable to obtain lock for config" ) ;
172
183
cfg. config . title . get ( class) . and_then ( |x| {
173
184
x. iter ( )
174
- . find ( |( k, _) | title. to_uppercase ( ) . contains ( k. as_str ( ) ) )
185
+ . find ( |( k, _) | title. contains ( k. as_str ( ) ) )
175
186
. map ( |( _, v) | v. to_owned ( ) )
176
187
} )
177
188
}
0 commit comments