diff --git a/src/driver/lcd4l.cpp b/src/driver/lcd4l.cpp index 03362727f..e117a7a0e 100644 --- a/src/driver/lcd4l.cpp +++ b/src/driver/lcd4l.cpp @@ -113,6 +113,7 @@ static void lcd4linux(bool run) { const char *buf = "lcd4linux"; const char *conf = "/etc/lcd4linux.conf"; + std::string lcd4linux = find_executable(buf); chmod(conf,0x600); chown(conf,0,0); @@ -121,11 +122,11 @@ static void lcd4linux(bool run) { if (g_settings.lcd4l_dpf_type == 3) { - if (my_system(3, buf, "-o", PNGFILE) != 0) - printf("[CLCD4l] %s: executing '%s -o %s' failed\n", __FUNCTION__, buf, PNGFILE); + if (my_system(3, lcd4linux.c_str(), "-o", PNGFILE) != 0) + printf("[CLCD4l] %s: executing '%s -o %s' failed\n", __FUNCTION__, lcd4linux.c_str(), PNGFILE); } else { - if (my_system(1, buf) != 0) - printf("[CLCD4l] %s: executing '%s' failed\n", __FUNCTION__, buf); + if (my_system(1, lcd4linux.c_str()) != 0) + printf("[CLCD4l] %s: executing '%s' failed\n", __FUNCTION__, lcd4linux.c_str()); } sleep(2); } diff --git a/src/gui/miscsettings_menu.cpp b/src/gui/miscsettings_menu.cpp index 4e924a38e..fc33b64a8 100644 --- a/src/gui/miscsettings_menu.cpp +++ b/src/gui/miscsettings_menu.cpp @@ -306,7 +306,7 @@ int CMiscMenue::showMiscSettingsMenu() #ifdef ENABLE_LCD4LINUX // LCD4Linux Setup CLCD4lSetup lcd4lSetup; - mf = new CMenuForwarder(LOCALE_LCD4L_SUPPORT, ((access("/usr/bin/lcd4linux", F_OK) == 0) || (access("/var/bin/lcd4linux", F_OK) == 0)), NULL, &lcd4lSetup, NULL, CRCInput::RC_4); + mf = new CMenuForwarder(LOCALE_LCD4L_SUPPORT, !find_executable("lcd4linux").empty(), NULL, &lcd4lSetup, NULL, CRCInput::RC_4); misc_menue.addItem(mf); #endif diff --git a/src/gui/user_menue.cpp b/src/gui/user_menue.cpp index f536026ae..f14e7b0ce 100644 --- a/src/gui/user_menue.cpp +++ b/src/gui/user_menue.cpp @@ -494,7 +494,7 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) case SNeutrinoSettings::ITEM_LCD4LINUX: { keyhelper.get(&key,&icon); - menu_item = new CMenuForwarder(LOCALE_LCD4L_SUPPORT, ((access("/usr/bin/lcd4linux", F_OK) == 0) || (access("/var/bin/lcd4linux", F_OK) == 0)), NULL, CLCD4lSetup::getInstance(), NULL, key, icon); + menu_item = new CMenuForwarder(LOCALE_LCD4L_SUPPORT, !find_executable("lcd4linux").empty(), NULL, CLCD4lSetup::getInstance(), NULL, key, icon); menu_item->setHint(NEUTRINO_ICON_HINT_LCD4LINUX, LOCALE_MENU_HINT_LCD4L_SUPPORT); break; }