linux-qubasis
linux oasis port as a qubes template
git clone https://9o.is/git/linux-qubasis.git
commit ef7744ab447a6b58c8f764f0d1da212f8e4007b4 parent 516bcafac748012a475bb344c3e7b42d35636108 Author: Jul <jul@9o.is> Date: Thu, 7 Aug 2025 07:57:25 -0400 remove noice Diffstat:
| M | .gitmodules | | | 4 | ---- |
| D | pkg/noice/build | | | 26 | -------------------------- |
| D | pkg/noice/noiceconf.h | | | 86 | ------------------------------------------------------------------------------- |
| D | pkg/noice/nopenconf.h | | | 3 | --- |
| D | pkg/noice/patches/0001-nopen-exec-file-instead.patch | | | 25 | ------------------------- |
| D | pkg/noice/patches/0002-add-picker-flag.patch | | | 65 | ----------------------------------------------------------------- |
| D | pkg/noice/patches/0003-handle-regular-file-path-init.patch | | | 68 | -------------------------------------------------------------------- |
| D | pkg/noice/repo | | | 1 | - |
8 files changed, 0 insertions(+), 278 deletions(-)
diff --git a/.gitmodules b/.gitmodules @@ -23,10 +23,6 @@ path = pkg/ag/repo url = https://github.com/ggreer/the_silver_searcher.git ignore = all -[submodule "noice"] - path = pkg/noice/repo - url = git://git.2f30.org/noice - ignore = all [submodule "vis"] path = pkg/vis/repo url = https://github.com/martanne/vis diff --git a/pkg/noice/build b/pkg/noice/build @@ -1,26 +0,0 @@ -#!/bin/sh -set -euo pipefail - -gitref="bfe589ac" -repodir="$srcdir/repo" - -if [ "$skip_clean" != "true" ]; then - git -C "$repodir" clean -dx - git -C "$repodir" reset --hard "$gitref" - - for patch in $srcdir/patches/*.patch; do - git -C "$repodir" am --no-gpg-sign "$patch" - done -fi - -rm -rf "$outdir" -cp "$srcdir/noiceconf.h" "$repodir" -cp "$srcdir/nopenconf.h" "$repodir" - -make -C "$repodir" -make DESTDIR="$outdir" PREFIX=/usr -C "$repodir" install - -if [ "$local_install" == "true" ]; then - sudo make -C "$repodir" PREFIX=/usr install -fi - diff --git a/pkg/noice/noiceconf.h b/pkg/noice/noiceconf.h @@ -1,86 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#define CWD "" -#define CURSR " > " -#define EMPTY " " - -#define NOPEN "nopen" - -int dirorder = 1; /* Set to 1 to sort by directory first */ -int mtimeorder = 0; /* Set to 1 to sort by time modified */ -int icaseorder = 1; /* Set to 1 to sort by ignoring case */ -int versorder = 0; /* Set to 1 to sort by version number */ -int idletimeout = 0; /* Screensaver timeout in seconds, 0 to disable */ -int showhidden = 1; /* Set to 1 to show hidden files by default */ -int usecolor = 1; /* Set to 1 to enable color attributes */ -char *idlecmd = "rain"; /* The screensaver program */ - -/* See curs_attr(3) for valid video attributes */ -#define CURSR_ATTR A_NORMAL -#define DIR_ATTR A_NORMAL | COLOR_PAIR(4) -#define LINK_ATTR A_NORMAL | COLOR_PAIR(6) -#define SOCK_ATTR A_NORMAL | COLOR_PAIR(1) -#define FIFO_ATTR A_NORMAL | COLOR_PAIR(5) -#define EXEC_ATTR A_NORMAL | COLOR_PAIR(2) - -/* Colors to use with COLOR_PAIR(n) as attributes */ -struct cpair pairs[] = { - { .fg = 0, .bg = 0 }, - /* pairs start at 1 */ - { COLOR_RED, -1 }, - { COLOR_GREEN, -1 }, - { COLOR_YELLOW, -1 }, - { COLOR_BLUE, -1 }, - { COLOR_MAGENTA, -1 }, - { COLOR_CYAN, -1 }, -}; - -struct key bindings[] = { - /* Quit */ - { 'q', SEL_QUIT }, - /* Back */ - { KEY_BACKSPACE, SEL_BACK }, - { KEY_LEFT, SEL_BACK }, - { '-', SEL_BACK }, - /* Inside */ - { KEY_ENTER, SEL_GOIN }, - { KEY_RIGHT, SEL_GOIN }, - { '\r', SEL_GOIN }, - /* Filter */ - { '/', SEL_FLTR }, - /* Next */ - { KEY_DOWN, SEL_NEXT }, - /* Previous */ - { KEY_UP, SEL_PREV }, - /* Page down */ - { KEY_NPAGE, SEL_PGDN }, - { CONTROL('D'), SEL_PGDN }, - /* Page up */ - { KEY_PPAGE, SEL_PGUP }, - { CONTROL('U'), SEL_PGUP }, - /* Home */ - { KEY_HOME, SEL_HOME }, - { 'g', SEL_HOME }, - /* End */ - { KEY_END, SEL_END }, - { 'G', SEL_END }, - /* Change dir */ - { 'c', SEL_CD }, - { '~', 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 }, - /* Toggle sort by version number */ - { 'v', SEL_VERS }, - { CONTROL('L'), SEL_REDRAW }, - /* Run command */ - { '!', SEL_RUN, "sh", "SHELL" }, - /* Run command with argument */ - { 'e', SEL_RUNARG, "vi", "EDITOR" }, - { 'p', SEL_RUNARG, "less", "PAGER" }, -}; - diff --git a/pkg/noice/nopenconf.h b/pkg/noice/nopenconf.h @@ -1,3 +0,0 @@ -struct rule rules[] = { - { .regex = ".", .file = "less", .argv = { "less", "{}", NULL } }, -}; diff --git a/pkg/noice/patches/0001-nopen-exec-file-instead.patch b/pkg/noice/patches/0001-nopen-exec-file-instead.patch @@ -1,25 +0,0 @@ -From d2cf272d7ebd41e37405df40af08a8d93146ed27 Mon Sep 17 00:00:00 2001 -From: Jul <jul@qh.is> -Date: Wed, 30 Jul 2025 01:18:08 -0400 -Subject: [PATCH 1/3] nopen exec file instead - ---- - nopen.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/nopen.c b/nopen.c -index 96cc2ab..5cd7d7d 100644 ---- a/nopen.c -+++ b/nopen.c -@@ -36,7 +36,7 @@ run(struct rule *rule, char *arg) - argv[i] = rule->argv[i]; - } - argv[i] = NULL; -- return spawnvp(NULL, rule->file, argv); -+ return execvp(rule->file, argv); - } - - struct rule * --- -2.50.1 - diff --git a/pkg/noice/patches/0002-add-picker-flag.patch b/pkg/noice/patches/0002-add-picker-flag.patch @@ -1,65 +0,0 @@ -From 1d0aa7bb7162a9b34bf1ea7e6767e802058f9cb4 Mon Sep 17 00:00:00 2001 -From: Jul <jul@qh.is> -Date: Wed, 30 Jul 2025 02:18:47 -0400 -Subject: [PATCH 2/3] add picker flag - ---- - noice.c | 14 +++++++++++--- - 1 file changed, 11 insertions(+), 3 deletions(-) - -diff --git a/noice.c b/noice.c -index 41df8d9..66ad1e9 100644 ---- a/noice.c -+++ b/noice.c -@@ -73,6 +73,7 @@ struct entry *dents; - char *argv0; - int ndents, cur; - int idle; -+int pickermode; - - /* - * Layout: -@@ -215,7 +216,7 @@ initcurses(void) - { - char *term; - -- if (initscr() == NULL) { -+ if (newterm(NULL, stderr, stdin) == NULL) { - term = getenv("TERM"); - if (term != NULL) - fprintf(stderr, "error opening terminal: %s\n", term); -@@ -647,6 +648,10 @@ nochange: - goto begin; - case S_IFREG: - exitcurses(); -+ if (pickermode) { -+ printf("%s\n", newpath); -+ exit(0); -+ } - run = xgetenv("NOPEN", NOPEN); - r = spawnlp(path, run, run, newpath, (void *)0); - initcurses(); -@@ -811,6 +816,9 @@ main(int argc, char *argv[]) - case 'c': - usecolor = 1; - break; -+ case 'p': -+ pickermode = 1; -+ break; - default: - usage(); - } ARGEND -@@ -819,8 +827,8 @@ main(int argc, char *argv[]) - usage(); - - /* Confirm we are in a terminal */ -- if (!isatty(0) || !isatty(1)) { -- fprintf(stderr, "stdin or stdout is not a tty\n"); -+ if (!isatty(0)) { -+ fprintf(stderr, "stdin is not a tty\n"); - exit(1); - } - --- -2.50.1 - diff --git a/pkg/noice/patches/0003-handle-regular-file-path-init.patch b/pkg/noice/patches/0003-handle-regular-file-path-init.patch @@ -1,68 +0,0 @@ -From b8fdd4099c3dcfe1208a32c6cd16873111a3136e Mon Sep 17 00:00:00 2001 -From: Jul <jul@qh.is> -Date: Sun, 3 Aug 2025 22:44:37 -0400 -Subject: [PATCH 3/3] handle regular file path init - ---- - noice.c | 29 ++++++++++++++++++++++------- - 1 file changed, 22 insertions(+), 7 deletions(-) - -diff --git a/noice.c b/noice.c -index 66ad1e9..0d469ae 100644 ---- a/noice.c -+++ b/noice.c -@@ -132,6 +132,19 @@ xgetenv(char *name, char *fallback) - return value && value[0] ? value : fallback; - } - -+int filetype(char *path) { -+ int fd = open(path, O_RDONLY | O_NONBLOCK); -+ if (fd == -1) return 0; -+ -+ struct stat sb; -+ int r = fstat(fd, &sb); -+ -+ close(fd); -+ if (r == -1) return 0; -+ -+ return sb.st_mode & S_IFMT; -+} -+ - int - setfilter(regex_t *regex, char *filter) - { -@@ -579,9 +592,17 @@ browse(char *ipath, char *ifilter) - regex_t re; - int r, fd; - -- strlcpy(path, ipath, sizeof(path)); - strlcpy(fltr, ifilter, sizeof(fltr)); - oldpath[0] = '\0'; -+ -+ if (filetype(ipath) == S_IFREG) { -+ char *dirp = xdirname(ipath); -+ strlcpy(path, dirp, sizeof(path)); -+ strlcpy(oldpath, ipath, sizeof(oldpath)); -+ } else { -+ strlcpy(path, ipath, sizeof(path)); -+ } -+ - begin: - r = populate(path, oldpath, fltr); - if (r == -1) { -@@ -846,12 +867,6 @@ main(int argc, char *argv[]) - - signal(SIGINT, SIG_IGN); - -- /* Test initial path */ -- if (canopendir(ipath) == 0) { -- fprintf(stderr, "%s: %s\n", ipath, strerror(errno)); -- exit(1); -- } -- - /* Set locale before curses setup */ - setlocale(LC_ALL, ""); - initcurses(); --- -2.50.1 - diff --git a/pkg/noice/repo b/pkg/noice/repo @@ -1 +0,0 @@ -Subproject commit b8fdd4099c3dcfe1208a32c6cd16873111a3136e