diff options
author | ivanp7 | 2021-11-28 00:48:21 +0300 |
---|---|---|
committer | ivanp7 | 2021-11-28 00:48:21 +0300 |
commit | 1d002d19682a3e5e56f3a049ebb020ab693acf70 (patch) | |
tree | 2ca58ed418bf177d1e1d1cc6841e3e4215bea69a | |
parent | cc9deaa736158199f668df9042fd301d07a9e1db (diff) | |
download | aur-1d002d19682a3e5e56f3a049ebb020ab693acf70.tar.gz |
Add support for another configuration location: $XDG_CONFIG_HOME/fbterm/fbtermrc
-rw-r--r-- | .SRCINFO | 14 | ||||
-rw-r--r-- | PKGBUILD | 4 | ||||
-rw-r--r-- | fbconfig.patch | 53 |
3 files changed, 49 insertions, 22 deletions
@@ -1,7 +1,7 @@ pkgbase = fbterm pkgdesc = Framebuffer terminal emulator pkgver = 1.7_5 - pkgrel = 2 + pkgrel = 3 url = https://salsa.debian.org/debian/fbterm arch = x86_64 arch = armv7h @@ -18,11 +18,11 @@ pkgbase = fbterm source = fix_ftbfs_epoll.patch source = fbtermrc sha256sums = b98d487e84618503887e3996162354c482e24884bad8bf2219b6776372f306ad - sha256sums = SKIP - sha256sums = SKIP - sha256sums = SKIP - sha256sums = SKIP - sha256sums = SKIP - sha256sums = SKIP + sha256sums = 0d1781e2654d32d5dfd1cbf17680b49aefbb124b7164ca1d70fcf4468563be7c + sha256sums = 5cd1c14c640679a40f8a9d9781c2a5af5db7543c2296cda99f2886aa40468735 + sha256sums = 8054410ab97da3df03406543c6a471acf3323b9e5712da6455d7c49cad7489ce + sha256sums = 73f0c87aaa5a74631c167fb765c0340dc28626b00d0a3cd065cebf71acc585f7 + sha256sums = 2b5daa2664adf1efb3e478c2f97376c055b1698422524d262fbae2e7a530a323 + sha256sums = 1759e8e3d4d9fd5b9f46f7813dbdc5df2fc9ef3b7b93f92c75d1267547666e45 pkgname = fbterm @@ -4,7 +4,7 @@ pkgname=fbterm _gitname=fbterm _majorver=1.7 pkgver=1.7_5 -pkgrel=2 +pkgrel=3 pkgdesc='Framebuffer terminal emulator' arch=('x86_64' 'armv7h') url='https://salsa.debian.org/debian/fbterm' @@ -16,7 +16,7 @@ source=("http://deb.debian.org/debian/pool/main/f/fbterm/fbterm_1.7.orig.tar.gz" 'fbconfig.patch' 'fbterm.patch' '0001-Fix-build-with-gcc-6.patch' 'fix_ftbfs_crosscompile.patch' 'fix_ftbfs_epoll.patch' 'fbtermrc') sha256sums=('b98d487e84618503887e3996162354c482e24884bad8bf2219b6776372f306ad' - '7932367ff7831fcc4585ef6050bf0c32d74f12e77f3f5683b0f5c2685285b7b0' + '0d1781e2654d32d5dfd1cbf17680b49aefbb124b7164ca1d70fcf4468563be7c' '5cd1c14c640679a40f8a9d9781c2a5af5db7543c2296cda99f2886aa40468735' '8054410ab97da3df03406543c6a471acf3323b9e5712da6455d7c49cad7489ce' '73f0c87aaa5a74631c167fb765c0340dc28626b00d0a3cd065cebf71acc585f7' diff --git a/fbconfig.patch b/fbconfig.patch index 5436b8479228..b5f861a63118 100644 --- a/fbconfig.patch +++ b/fbconfig.patch @@ -1,14 +1,15 @@ --- a/src/fbconfig.cpp 2010-10-18 11:20:11.000000000 +0300 -+++ b/src/fbconfig.cpp 2021-09-25 04:04:09.407720173 +0300 -@@ -28,6 +28,7 @@ ++++ b/src/fbconfig.cpp 2021-11-27 23:48:54.286721768 +0300 +@@ -28,6 +28,8 @@ #include "config.h" #include "fbconfig.h" ++#define CONFIG_DIR_NAME "fbterm" +#define CONFIG_FILE_NAME "fbtermrc" #define MAX_CONFIG_FILE_SIZE 10240 DEFINE_INSTANCE_DEFAULT(Config) -@@ -38,16 +39,19 @@ +@@ -38,18 +40,34 @@ mConfigBuf = 0; mConfigEntrys = 0; @@ -17,35 +18,61 @@ - if (getuid()) return; - home = "/root"; - } -+ s8 name[256]; - +- - s8 name[64]; - snprintf(name, sizeof(name), "%s/%s", home, ".fbtermrc"); ++ s8 name[256]; + +- checkConfigFile(name); + const s8 *home = getenv("XDG_CONFIG_HOME"); ++ const s8 *format_d = NULL, *format_f = NULL, *format_df = NULL; + if (!home || !home[0]) + { + home = getenv("HOME"); + if (!home || !home[0]) + return; - -- checkConfigFile(name); -+ snprintf(name, sizeof(name), "%s/.config/" CONFIG_FILE_NAME, home); ++ ++ format_d = "%s/.config/" CONFIG_DIR_NAME "/"; ++ format_f = "%s/.config/" CONFIG_FILE_NAME; ++ format_df = "%s/.config/" CONFIG_DIR_NAME "/" CONFIG_FILE_NAME; + } + else -+ snprintf(name, sizeof(name), "%s/" CONFIG_FILE_NAME, home); ++ { ++ format_d = "%s/" CONFIG_DIR_NAME "/"; ++ format_f = "%s/" CONFIG_FILE_NAME; ++ format_df = "%s/" CONFIG_DIR_NAME "/" CONFIG_FILE_NAME; ++ } ++ snprintf(name, sizeof(name), format_d, home); struct stat cstat; ++ if (stat(name, &cstat) == -1) ++ snprintf(name, sizeof(name), format_f, home); ++ else ++ snprintf(name, sizeof(name), format_df, home); ++ if (stat(name, &cstat) == -1) return; + if (cstat.st_size > MAX_CONFIG_FILE_SIZE) return; + --- a/doc/fbterm.1.in 2010-10-18 11:20:11.000000000 +0300 -+++ b/doc/fbterm.1.in 2021-09-25 04:27:09.778563998 +0300 -@@ -22,8 +22,8 @@ ++++ b/doc/fbterm.1.in 2021-11-27 23:11:43.270223092 +0300 +@@ -22,8 +22,9 @@ file. If that is not set, /bin/sh will be used. You should use the \fI--\fR argument to separate FbTerm's options from the arguments supplied to the \fIcommand\fR. -FbTerm first uses option value specified in command line arguments, then in the configure file \fI$HOME/.fbtermrc\fR. -If that file doesn't exist, FbTerm will create it with default options on startup. -+FbTerm first uses option value specified in command line arguments, then in the configure file \fI$XDG_CONFIG_HOME/fbtermrc\fR. -+If \fIXDG_CONFIG_HOME\fR is unset or empty, FbTerm uses \fI$HOME/.config/fbtermrc\fR instead. ++FbTerm first uses option value specified in command line arguments, then in the configure file \fI$XDG_CONFIG_HOME/fbtermrc\fR or ++\fI$XDG_CONFIG_HOME/fbterm/fbtermrc\fR (if directory \fI$XDG_CONFIG_HOME/fbterm/\fR exists). ++If \fIXDG_CONFIG_HOME\fR is unset or empty, FbTerm uses \fI$HOME/.config\fR for it instead. .TP \fB-h, --help\fR display the help and exit +@@ -77,7 +78,7 @@ + display available VESA video modes + + .TP +-see comments in \fI$HOME/.fbtermrc\fR for details of these options. ++see comments in the configure file for details of these options. + .SH "SHORTCUT SUMMARY" + keyboard: + CTRL_ALT_E: exit from FbTerm |