diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/firecfg/desktop_files.c | 24 | ||||
-rw-r--r-- | src/man/firecfg.1.in | 2 |
2 files changed, 23 insertions, 3 deletions
diff --git a/src/firecfg/desktop_files.c b/src/firecfg/desktop_files.c index 5ed15c02b..8bd54d3e9 100644 --- a/src/firecfg/desktop_files.c +++ b/src/firecfg/desktop_files.c | |||
@@ -118,6 +118,9 @@ void fix_desktop_files(const char *homedir) { | |||
118 | exit(1); | 118 | exit(1); |
119 | } | 119 | } |
120 | 120 | ||
121 | // build ignorelist | ||
122 | parse_config_all(0); | ||
123 | |||
121 | // destination | 124 | // destination |
122 | // create ~/.local/share/applications directory if necessary | 125 | // create ~/.local/share/applications directory if necessary |
123 | char *user_apps_dir; | 126 | char *user_apps_dir; |
@@ -173,8 +176,25 @@ void fix_desktop_files(const char *homedir) { | |||
173 | continue; | 176 | continue; |
174 | 177 | ||
175 | // skip if not .desktop file | 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 | continue; | 194 | continue; |
195 | } | ||
196 | |||
197 | free(exec); | ||
178 | 198 | ||
179 | // skip links - Discord on Arch #4235 seems to be a symlink to /opt directory | 199 | // skip links - Discord on Arch #4235 seems to be a symlink to /opt directory |
180 | // if (is_link(filename)) | 200 | // if (is_link(filename)) |
@@ -220,7 +240,7 @@ void fix_desktop_files(const char *homedir) { | |||
220 | } | 240 | } |
221 | 241 | ||
222 | // get executable name | 242 | // get executable name |
223 | char *ptr = strstr(buf,"\nExec="); | 243 | ptr = strstr(buf,"\nExec="); |
224 | if (!ptr || strlen(ptr) < 7) { | 244 | if (!ptr || strlen(ptr) < 7) { |
225 | if (arg_debug) | 245 | if (arg_debug) |
226 | printf(" %s - skipped: wrong format?\n", filename); | 246 | printf(" %s - skipped: wrong format?\n", filename); |
diff --git a/src/man/firecfg.1.in b/src/man/firecfg.1.in index e43a573de..79802156c 100644 --- a/src/man/firecfg.1.in +++ b/src/man/firecfg.1.in | |||
@@ -168,7 +168,7 @@ Configuration file syntax: | |||
168 | A line that starts with \fB#\fR is considered a comment. | 168 | A line that starts with \fB#\fR is considered a comment. |
169 | .br | 169 | .br |
170 | A line that starts with \fB!PROGRAM\fR means to ignore "PROGRAM" when creating | 170 | A line that starts with \fB!PROGRAM\fR means to ignore "PROGRAM" when creating |
171 | symlinks. | 171 | symlinks and fixing .desktop files. |
172 | .br | 172 | .br |
173 | A line that starts with anything else is considered to be the name of an | 173 | A line that starts with anything else is considered to be the name of an |
174 | executable and firecfg will attempt to create a symlink for it. | 174 | executable and firecfg will attempt to create a symlink for it. |