File tree 2 files changed +23
-3
lines changed
2 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -118,6 +118,9 @@ void fix_desktop_files(const char *homedir) {
118
118
exit (1 );
119
119
}
120
120
121
+ // build ignorelist
122
+ parse_config_all (0 );
123
+
121
124
// destination
122
125
// create ~/.local/share/applications directory if necessary
123
126
char * user_apps_dir ;
@@ -173,8 +176,25 @@ void fix_desktop_files(const char *homedir) {
173
176
continue ;
174
177
175
178
// skip if not .desktop file
176
- if (strstr (filename , ".desktop" ) != (filename + strlen (filename ) - 8 ))
179
+ char * exec = strdup (filename );
180
+ if (!exec )
181
+ errExit ("strdup" );
182
+ char * ptr = strstr (exec , ".desktop" );
183
+ if (ptr == NULL || * (ptr + 8 ) != '\0' ) {
184
+ printf (" %s skipped (not a .desktop file)\n" , exec );
185
+ free (exec );
186
+ continue ;
187
+ }
188
+
189
+ // skip if program is in ignorelist
190
+ * ptr = '\0' ;
191
+ if (in_ignorelist (exec )) {
192
+ printf (" %s ignored\n" , exec );
193
+ free (exec );
177
194
continue ;
195
+ }
196
+
197
+ free (exec );
178
198
179
199
// skip links - Discord on Arch #4235 seems to be a symlink to /opt directory
180
200
// if (is_link(filename))
@@ -220,7 +240,7 @@ void fix_desktop_files(const char *homedir) {
220
240
}
221
241
222
242
// get executable name
223
- char * ptr = strstr (buf ,"\nExec=" );
243
+ ptr = strstr (buf ,"\nExec=" );
224
244
if (!ptr || strlen (ptr ) < 7 ) {
225
245
if (arg_debug )
226
246
printf (" %s - skipped: wrong format?\n" , filename );
Original file line number Diff line number Diff line change @@ -168,7 +168,7 @@ Configuration file syntax:
168
168
A line that starts with \fB # \fR is considered a comment.
169
169
.br
170
170
A line that starts with \fB !PROGRAM \fR means to ignore "PROGRAM" when creating
171
- symlinks.
171
+ symlinks and fixing .desktop files .
172
172
.br
173
173
A line that starts with anything else is considered to be the name of an
174
174
executable and firecfg will attempt to create a symlink for it.
You can’t perform that action at this time.
0 commit comments