From a2c3312c01aa8b3a99733aea21d469d8acae10bf Mon Sep 17 00:00:00 2001 From: Marcel Rodrigues Date: Mon, 10 Aug 2015 13:33:10 -0300 Subject: [PATCH] Add executable file color customization. --- config.h | 1 + rover.c | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/config.h b/config.h index c9986cf..d37928f 100644 --- a/config.h +++ b/config.h @@ -39,6 +39,7 @@ #define RVC_SCROLLBAR CYAN #define RVC_LINK CYAN #define RVC_HIDDEN YELLOW +#define RVC_EXEC GREEN #define RVC_REG DEFAULT #define RVC_DIR DEFAULT #define RVC_CHR MAGENTA diff --git a/rover.c b/rover.c index d6cb6ba..bc192f2 100644 --- a/rover.c +++ b/rover.c @@ -391,9 +391,12 @@ update_view() wcolor_set(rover.window, RVC_LINK, NULL); else if (ishidden) wcolor_set(rover.window, RVC_HIDDEN, NULL); - else if (S_ISREG(EMODE(j))) - wcolor_set(rover.window, RVC_REG, NULL); - else if (S_ISDIR(EMODE(j))) + else if (S_ISREG(EMODE(j))) { + if (EMODE(j) & (S_IXUSR | S_IXGRP | S_IXOTH)) + wcolor_set(rover.window, RVC_EXEC, NULL); + else + wcolor_set(rover.window, RVC_REG, NULL); + } else if (S_ISDIR(EMODE(j))) wcolor_set(rover.window, RVC_DIR, NULL); else if (S_ISCHR(EMODE(j))) wcolor_set(rover.window, RVC_CHR, NULL); -- 2.11.4.GIT