Remove globalcolors, it's not necessary now that we only have global

colors. Compatibility option is still available which will enable or
disable xrdb entirely.
This commit is contained in:
Jacob 2023-07-29 18:44:17 +02:00
parent e7ad428fbe
commit f6e34668cf
7 changed files with 4 additions and 30 deletions

View file

@ -298,12 +298,6 @@ in the config files.
`-nxrdb, --no-xrdb` `-nxrdb, --no-xrdb`
: Don't load .Xresources on runtime (X11 only) : Don't load .Xresources on runtime (X11 only)
`-gbc, --global-colors`
: Recognize global colors (such as \*.color1) on runtime (X11 only)
`-ngbc, --no-global-colors`
: Don't recognize global colors (such as \*.color1) on runtime (X11 only)
`-m, --monitor monitor` `-m, --monitor monitor`
: Specify a monitor to run spmenu on (X11 only) : Specify a monitor to run spmenu on (X11 only)

View file

@ -219,7 +219,6 @@ spmenu = {
/* File options */ /* File options */
file = ( { xresources = 1; // Load .Xresources on startup (0/1) file = ( { xresources = 1; // Load .Xresources on startup (0/1)
global = 1; // Read global .Xresources colors, programs like Pywal use this. (*.color0, *.color1, etc.) (0/1)
theme = 1; // Load theme (~/.config/spmenu/theme.conf) on runtime theme = 1; // Load theme (~/.config/spmenu/theme.conf) on runtime
binds = 1; // Load binds (~/.config/spmenu/binds.conf) on runtime binds = 1; // Load binds (~/.config/spmenu/binds.conf) on runtime
themefile = "NULL"; // Path to theme file to load on runtime. NULL means default. themefile = "NULL"; // Path to theme file to load on runtime. NULL means default.

View file

@ -67,10 +67,6 @@ void readargs(int argc, char *argv[]) {
xresources = 1; xresources = 1;
} else if (!strcmp(argv[k], "-nxrdb") || (!strcmp(argv[k], "--no-xrdb"))) { } else if (!strcmp(argv[k], "-nxrdb") || (!strcmp(argv[k], "--no-xrdb"))) {
xresources = 0; xresources = 0;
} else if (!strcmp(argv[k], "-gbc") || (!strcmp(argv[k], "--global-colors"))) {
globalcolors = 1;
} else if (!strcmp(argv[k], "-ngbc") || (!strcmp(argv[k], "--no-global-colors"))) {
globalcolors = 0;
} }
} }
@ -284,10 +280,6 @@ void readargs(int argc, char *argv[]) {
|| !strcmp(argv[i], "--x11") || !strcmp(argv[i], "--x11")
|| !strcmp(argv[i], "--load-binds") || !strcmp(argv[i], "--load-binds")
|| !strcmp(argv[i], "--no-load-binds") || !strcmp(argv[i], "--no-load-binds")
|| !strcmp(argv[i], "-gbc")
|| !strcmp(argv[i], "-ngbc")
|| !strcmp(argv[i], "--global-colors")
|| !strcmp(argv[i], "--no-global-colors")
#if USECONFIG #if USECONFIG
|| !strcmp(argv[i], "-cf") || !strcmp(argv[i], "-cf")
|| !strcmp(argv[i], "--config-file") || !strcmp(argv[i], "--config-file")
@ -523,10 +515,6 @@ void readargs(int argc, char *argv[]) {
|| !strcmp(argv[i], "--x11") || !strcmp(argv[i], "--x11")
|| !strcmp(argv[i], "--load-binds") || !strcmp(argv[i], "--load-binds")
|| !strcmp(argv[i], "--no-load-binds") || !strcmp(argv[i], "--no-load-binds")
|| !strcmp(argv[i], "-gbc")
|| !strcmp(argv[i], "-ngbc")
|| !strcmp(argv[i], "--global-colors")
|| !strcmp(argv[i], "--no-global-colors")
#if USECONFIG #if USECONFIG
|| !strcmp(argv[i], "-cf") || !strcmp(argv[i], "-cf")
|| !strcmp(argv[i], "--config-file") || !strcmp(argv[i], "--config-file")
@ -704,8 +692,6 @@ void usage(int status) {
"spmenu -scl, --show-caps Show caps lock indicator\n" "spmenu -scl, --show-caps Show caps lock indicator\n"
"spmenu -xrdb, --xrdb Load .Xresources on runtime (X11 only)\n" "spmenu -xrdb, --xrdb Load .Xresources on runtime (X11 only)\n"
"spmenu -nxrdb, --no-xrdb Don't load .Xresources on runtime (X11 only)\n" "spmenu -nxrdb, --no-xrdb Don't load .Xresources on runtime (X11 only)\n"
"spmenu -gbc, --global-colors Recognize global colors (such as *.color1) on runtime (X11 only)\n"
"spmenu -ngbc, --no-global-colors Don't recognize global colors (such as *.color1) on runtime (X11 only)\n"
"spmenu -m, --monitor <monitor> Specify a monitor to run spmenu on (X11 only)\n" "spmenu -m, --monitor <monitor> Specify a monitor to run spmenu on (X11 only)\n"
"spmenu -w, --embed <window id> Embed spmenu inside <window id> (X11 only)\n" "spmenu -w, --embed <window id> Embed spmenu inside <window id> (X11 only)\n"
"spmenu -H, --hist-file <hist file> Specify a file to save the history to\n" "spmenu -H, --hist-file <hist file> Specify a file to save the history to\n"

View file

@ -672,8 +672,8 @@ void conf_init(void) {
config_setting_lookup_int(conf, "binds", &loadbinds); // spmenu.file.binds config_setting_lookup_int(conf, "binds", &loadbinds); // spmenu.file.binds
} }
config_setting_lookup_int(conf, "global", &globalcolors); // spmenu.file.global
config_setting_lookup_int(conf, "xresources", &xresources); // spmenu.file.xresources config_setting_lookup_int(conf, "xresources", &xresources); // spmenu.file.xresources
config_setting_lookup_int(conf, "global", &xresources); // spmenu.file.global
if (config_setting_lookup_string(conf, "themefile", &dest)) { if (config_setting_lookup_string(conf, "themefile", &dest)) {
themefile = strdup(dest); themefile = strdup(dest);

View file

@ -5,7 +5,6 @@ static char *class = "spmenu"; /* Class for spmenu */
static int protocol = 1; /* Protocol to try first (0: X11, 1: Wayland) */ static int protocol = 1; /* Protocol to try first (0: X11, 1: Wayland) */
static int fast = 0; /* Grab keyboard first */ static int fast = 0; /* Grab keyboard first */
static int xresources = 1; /* Enable .Xresources support */ static int xresources = 1; /* Enable .Xresources support */
static int globalcolors = 1; /* Recognize global colors (such as colors generated by Pywal) */
static int loadconfig = 1; /* Load configuration (~/.config/spmenu/spmenu.conf) on runtime */ static int loadconfig = 1; /* Load configuration (~/.config/spmenu/spmenu.conf) on runtime */
static int loadtheme = 1; /* Load theme (~/.config/spmenu/theme.conf) on runtime */ static int loadtheme = 1; /* Load theme (~/.config/spmenu/theme.conf) on runtime */
static int loadbinds = 1; /* Load keybind file (~/.config/spmenu/binds.conf) on runtime */ static int loadbinds = 1; /* Load keybind file (~/.config/spmenu/binds.conf) on runtime */

View file

@ -499,8 +499,7 @@ void theme_load(void) {
for (unsigned int i = 0; i < config_setting_length(file_setting); ++i) { for (unsigned int i = 0; i < config_setting_length(file_setting); ++i) {
config_setting_t *conf = config_setting_get_elem(file_setting, i); config_setting_t *conf = config_setting_get_elem(file_setting, i);
// look up config_setting_lookup_int(conf, "global", &xresources); // theme.file.global
config_setting_lookup_int(conf, "global", &globalcolors); // theme.file.global
} }
} }

View file

@ -41,11 +41,8 @@ void load_xresources(void) {
return; return;
db = XrmGetStringDatabase(resm); db = XrmGetStringDatabase(resm);
// recognize global colors
if (globalcolors) {
for (p = cols; p < cols + LENGTH(cols); p++) for (p = cols; p < cols + LENGTH(cols); p++)
resource_load(db, p->name, p->type, p->dst); resource_load(db, p->name, p->type, p->dst);
}
XCloseDisplay(display); XCloseDisplay(display);
} }