From 94134d89dbdd2feef5dc953d643271e44ad22a9e Mon Sep 17 00:00:00 2001 From: netblue30 Date: Fri, 19 May 2017 09:25:46 -0400 Subject: bringing back firecfg --fix --- src/firecfg/main.c | 14 ++++++++++++++ src/man/firecfg.txt | 7 +++++++ 2 files changed, 21 insertions(+) (limited to 'src') diff --git a/src/firecfg/main.c b/src/firecfg/main.c index af5ebef98..4f957b4ae 100644 --- a/src/firecfg/main.c +++ b/src/firecfg/main.c @@ -47,6 +47,7 @@ static void usage(void) { printf("Usage: firecfg [OPTIONS]\n\n"); printf(" --clean - remove all firejail symbolic links.\n\n"); printf(" --debug - print debug messages.\n\n"); + printf(" --fix - fix .desktop files.\n\n"); printf(" --fix-sound - create ~/.config/pulse/client.conf file.\n\n"); printf(" --help, -? - this help screen.\n\n"); printf(" --list - list all firejail symbolic links.\n\n"); @@ -544,6 +545,19 @@ int main(int argc, char **argv) { clear(); return 0; } + else if (strcmp(argv[i], "--fix") == 0) { + // find home directory + struct passwd *pw = getpwuid(getuid()); + if (!pw) { + goto errexit; + } + char *home = pw->pw_dir; + if (!home) { + goto errexit; + } + fix_desktop_files(home); + return 0; + } else if (strcmp(argv[i], "--list") == 0) { list(); return 0; diff --git a/src/man/firecfg.txt b/src/man/firecfg.txt index 55b60dcac..8cb9bcb3e 100644 --- a/src/man/firecfg.txt +++ b/src/man/firecfg.txt @@ -35,6 +35,13 @@ For user-driven manual integration, see \fBDESKTOP INTEGRATION\fR section in \fB .TP \fB\-\-clean Remove all firejail symbolic links. + +.TP +\fB\-\-fix +Fix .desktop files. Some .desktop files use full path to executable. Firecfg will check .desktop files in +/usr/share/applications/, replace full path by name if it is in PATH, and write result to $HOME/.local/share/applications/. +This action is done by default when running "sudo firecfg". We have it as a separate option for regular users. + .TP \fB\-\-fix-sound Create a proper ~/.config/pulse/client.conf file without shm support. On some PulseAudio versions, -- cgit v1.2.3-70-g09d2