Adjust to noice-0.7 - pkgsrc-localpatches - leot's pkgsrc LOCALPATCHES
(HTM) hg clone https://bitbucket.org/iamleot/pkgsrc-localpatches
(DIR) Log
(DIR) Files
(DIR) Refs
---
(DIR) changeset 1c193f1024e1a0de7e26f7ca6de0a60061322568
(DIR) parent 4b3699e369a55819a5316d8141e668208fe1e4e1
(HTM) Author: Leonardo Taccari <iamleot@gmail.com>
Date: Wed, 30 Jan 2019 19:35:13
Adjust to noice-0.7
Diffstat:
sysutils/noice/patch-config.h | 39 ++++++++++++++++++++++++++++++++--
sysutils/noice/patch-noice.c | 47 +++++++++++++++++++++---------------------
2 files changed, 60 insertions(+), 26 deletions(-)
---
diff -r 4b3699e369a5 -r 1c193f1024e1 sysutils/noice/patch-config.h
--- a/sysutils/noice/patch-config.h Wed Jan 30 19:34:52 2019 +0100
+++ b/sysutils/noice/patch-config.h Wed Jan 30 19:35:13 2019 +0100
@@ -1,16 +1,45 @@
---- /dev/null 2017-08-03 19:16:31.068436057 +0200
-+++ config.h 2017-08-03 19:16:58.313077649 +0200
-@@ -0,0 +1,79 @@
+--- /dev/null 2019-01-30 12:37:45.330275625 +0100
++++ config.h 2019-01-30 12:37:25.854965000 +0100
+@@ -0,0 +1,112 @@
+/* See LICENSE file for copyright and license details. */
+#define CWD "cwd: "
+#define CURSR " > "
+#define EMPTY " "
+
++int dirorder = 0; /* Set to 1 to sort by directory first */
+int mtimeorder = 0; /* Set to 1 to sort by time modified */
++int icaseorder = 0; /* Set to 1 to sort by ignoring case */
+int idletimeout = 0; /* Screensaver timeout in seconds, 0 to disable */
+int showhidden = 0; /* Set to 1 to show hidden files by default */
+char *idlecmd = "rain"; /* The screensaver program */
+
++#ifdef USE_COLOR
++#define CURSR_ATTR A_REVERSE
++#define DIR_ATTR A_BOLD | COLOR_PAIR(4)
++#define LINK_ATTR A_BOLD | COLOR_PAIR(6)
++#define SOCK_ATTR A_BOLD | COLOR_PAIR(1)
++#define FIFO_ATTR A_BOLD | COLOR_PAIR(5)
++#define EXEC_ATTR A_BOLD | COLOR_PAIR(2)
++#else
++#define CURSR_ATTR A_REVERSE
++#define DIR_ATTR A_BOLD
++#define LINK_ATTR A_BOLD
++#define SOCK_ATTR A_BOLD
++#define FIFO_ATTR A_BOLD
++#define EXEC_ATTR A_BOLD
++#endif
++
++struct cpair pairs[] = {
++ { .fg = 0, .bg = 0 },
++ /* pairs start at 1 */
++ { COLOR_RED, 0 },
++ { COLOR_GREEN, 0 },
++ { COLOR_YELLOW, 0 },
++ { COLOR_BLUE, 0 },
++ { COLOR_MAGENTA, 0 },
++ { COLOR_CYAN, 0 },
++};
++
+struct assoc assocs[] = {
+ { "\\.(avi|mp4|mkv|mp3|ogg|flac|mov|m4a)$", "mpv" },
+ { "\\.(bmp|gif|jpg|jpeg|png|pnm|tiff)$", "sxiv" },
@@ -69,8 +98,12 @@
+ { '~', SEL_CDHOME },
+ /* Toggle hide .dot files */
+ { '.', SEL_TOGGLEDOT },
++ /* Toggle sort by directory first */
++ { 'd', SEL_DSORT },
+ /* Toggle sort by time */
+ { 't', SEL_MTIME },
++ /* Toggle case sensitivity */
++ { 'i', SEL_ICASE },
+ { CONTROL('L'), SEL_REDRAW },
+ /* Run command */
+ { 'z', SEL_RUN, "top" },
diff -r 4b3699e369a5 -r 1c193f1024e1 sysutils/noice/patch-noice.c
--- a/sysutils/noice/patch-noice.c Wed Jan 30 19:34:52 2019 +0100
+++ b/sysutils/noice/patch-noice.c Wed Jan 30 19:35:13 2019 +0100
@@ -4,9 +4,9 @@
bytes without any transformation (and hence also correctly displaying
Unicode characters).
---- noice.c.orig 2018-08-10 18:55:47.299592935 +0200
-+++ noice.c 2018-08-10 19:01:15.778111428 +0200
-@@ -293,7 +293,8 @@
+--- noice.c.orig 2019-01-20 12:19:46.000000000 +0000
++++ noice.c
+@@ -342,7 +342,8 @@ void
printmsg(char *msg)
{
move(LINES - 1, 0);
@@ -16,7 +16,7 @@
}
/* Display warning as a message */
-@@ -324,7 +325,7 @@
+@@ -373,7 +374,7 @@ void
printprompt(char *str)
{
clearprompt();
@@ -24,25 +24,26 @@
+ addstr(str);
}
- /* Returns SEL_* if key is bound and 0 otherwise.
-@@ -428,10 +429,16 @@
- if (strlen(name) > maxlen)
- name[maxlen] = '\0';
+ int xgetch(void)
+@@ -497,7 +498,9 @@ printent(struct entry *ent, int active)
+ }
-- if (cm == 0)
-- printw("%s%s\n", active ? CURSR : EMPTY, name);
-- else
-- printw("%s%s%c\n", active ? CURSR : EMPTY, name, cm);
-+ if (cm == 0) {
-+ addstr(active ? CURSR : EMPTY );
-+ addstr(name);
-+ addstr("\n");
-+ } else {
-+ addstr(active ? CURSR : EMPTY);
-+ addstr(name);
-+ addch(cm);
-+ addstr("\n");
-+ }
+ attron(attr);
+- printw("%s%s\n", active ? CURSR : EMPTY, name);
++ addstr(active ? CURSR : EMPTY);
++ addstr(name);
++ addstr("\n");
+ attroff(attr);
}
- int
+@@ -629,7 +632,9 @@ redraw(char *path)
+ cwd[ncols - strlen(CWD) - 1] = '\0';
+ realpath(cwd, cwdresolved);
+
+- printw(CWD "%s\n\n", cwdresolved);
++ addstr(CWD);
++ addstr(cwdresolved);
++ addstr("\n\n");
+
+ /* Print listing */
+ odd = ISODD(nlines);