summaryrefslogtreecommitdiff
path: root/config.h
blob: a31c1df948e039f4c5a18d7152974e91e4e4b2aa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#pragma once

#include "commands.h"
#include <X11/X.h>
#include <X11/keysym.h>

#include <string>

struct Workspace
{
	std::string name;
	int* screenPreferences;
	int screenPreferencesc;
};

#define COMMAND(X) \
	const void X (const CommandArg* argv)

class Config
{  
	public:
		Config(CommandsModule& commandsModule);
		~Config();
		void free();
	
		Err loadFromFile(std::string path);
		Err reloadFile();
		// Startup
		std::string* startupBash;
		int startupBashc;

		// Main
		int gaps;
		int outerGaps;
		std::string logFile;

		// Workspaces
		std::vector<Workspace> workspaces;
		int numWS;
		std::string* workspaceNames;
		int workspaceNamesc;
		int maxMonitors;
		int** screenPreferences;
		int screenPreferencesc;

		// Config Commands
		COMMAND(gapsCmd);
		COMMAND(outerGapsCmd);
		COMMAND(logFileCmd);
		COMMAND(addWorkspaceCmd);

		// Keybind Commands
		COMMAND(exit);
		COMMAND(spawn);
		COMMAND(spawn_once);
		COMMAND(changeWS);
		COMMAND(wToWS);
		COMMAND(focChange);
		COMMAND(reload);
	private:
		CommandsModule& commandsModule;
		bool loaded = false;
		std::string file;
};