mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
stash dir into conf since it'll be of use
This commit is contained in:
parent
0d76265e23
commit
b06ddae624
9
calmwm.c
9
calmwm.c
@ -42,7 +42,6 @@ Atom cwmh[CWMH_NITEMS];
|
|||||||
Atom ewmh[EWMH_NITEMS];
|
Atom ewmh[EWMH_NITEMS];
|
||||||
struct screen_q Screenq = TAILQ_HEAD_INITIALIZER(Screenq);
|
struct screen_q Screenq = TAILQ_HEAD_INITIALIZER(Screenq);
|
||||||
struct conf Conf;
|
struct conf Conf;
|
||||||
const char *homedir;
|
|
||||||
volatile sig_atomic_t cwm_status;
|
volatile sig_atomic_t cwm_status;
|
||||||
|
|
||||||
static void sighdlr(int);
|
static void sighdlr(int);
|
||||||
@ -82,16 +81,16 @@ main(int argc, char **argv)
|
|||||||
if (signal(SIGCHLD, sighdlr) == SIG_ERR)
|
if (signal(SIGCHLD, sighdlr) == SIG_ERR)
|
||||||
err(1, "signal");
|
err(1, "signal");
|
||||||
|
|
||||||
if ((homedir = getenv("HOME")) == NULL || *homedir == '\0') {
|
if ((Conf.homedir = getenv("HOME")) == NULL || Conf.homedir[0] == '\0') {
|
||||||
pw = getpwuid(getuid());
|
pw = getpwuid(getuid());
|
||||||
if (pw != NULL && pw->pw_dir != NULL && *pw->pw_dir != '\0')
|
if (pw != NULL && pw->pw_dir != NULL && *pw->pw_dir != '\0')
|
||||||
homedir = pw->pw_dir;
|
Conf.homedir = pw->pw_dir;
|
||||||
else
|
else
|
||||||
homedir = "/";
|
Conf.homedir = "/";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (conf_file == NULL)
|
if (conf_file == NULL)
|
||||||
xasprintf(&conf_path, "%s/%s", homedir, CONFFILE);
|
xasprintf(&conf_path, "%s/%s", Conf.homedir, CONFFILE);
|
||||||
else
|
else
|
||||||
conf_path = xstrdup(conf_file);
|
conf_path = xstrdup(conf_file);
|
||||||
|
|
||||||
|
2
calmwm.h
2
calmwm.h
@ -293,6 +293,7 @@ struct conf {
|
|||||||
Cursor cursor[CF_NITEMS];
|
Cursor cursor[CF_NITEMS];
|
||||||
int xrandr;
|
int xrandr;
|
||||||
int xrandr_event_base;
|
int xrandr_event_base;
|
||||||
|
char *homedir;
|
||||||
char *wm_argv;
|
char *wm_argv;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -374,7 +375,6 @@ extern Atom cwmh[CWMH_NITEMS];
|
|||||||
extern Atom ewmh[EWMH_NITEMS];
|
extern Atom ewmh[EWMH_NITEMS];
|
||||||
extern struct screen_q Screenq;
|
extern struct screen_q Screenq;
|
||||||
extern struct conf Conf;
|
extern struct conf Conf;
|
||||||
extern const char *homedir;
|
|
||||||
|
|
||||||
__dead void usage(void);
|
__dead void usage(void);
|
||||||
|
|
||||||
|
2
conf.c
2
conf.c
@ -297,7 +297,7 @@ conf_init(struct conf *c)
|
|||||||
conf_cmd_add(c, "term", "xterm");
|
conf_cmd_add(c, "term", "xterm");
|
||||||
|
|
||||||
(void)snprintf(c->known_hosts, sizeof(c->known_hosts), "%s/%s",
|
(void)snprintf(c->known_hosts, sizeof(c->known_hosts), "%s/%s",
|
||||||
homedir, ".ssh/known_hosts");
|
c->homedir, ".ssh/known_hosts");
|
||||||
|
|
||||||
c->font = xstrdup("sans-serif:pixelsize=14:bold");
|
c->font = xstrdup("sans-serif:pixelsize=14:bold");
|
||||||
c->wmname = xstrdup("CWM");
|
c->wmname = xstrdup("CWM");
|
||||||
|
Loading…
Reference in New Issue
Block a user