summaryrefslogtreecommitdiff
path: root/config.h
blob: cfcf5bdcc2530323bb571c1a548931555403bb50 (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
65
66
67
68
69
70
71
72
73
74
75
#pragma once

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

#include <string>

enum MoveDir
{
	Up,
	Right,
	Down,
	Left
};

typedef union
{
	char* str;
	int num;
	MoveDir dir;
} KeyArg;

struct KeyBind
{
	unsigned int modifiers;
	KeySym keysym;
	void(* func) (const KeyArg arg);
	KeyArg args;
};

//Keybind commands
#define KEYCOM(X) \
	void X (const KeyArg arg)
KEYCOM(exit);
KEYCOM(spawn);
KEYCOM(toggle);
KEYCOM(kill);
KEYCOM(changeWS);
KEYCOM(wToWS);
KEYCOM(focChange);
KEYCOM(wMove);
KEYCOM(bashSpawn);
KEYCOM(reload);
KEYCOM(wsDump);
KEYCOM(nextMonitor);

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

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

		// Workspaces
		int numWS;
		std::string* workspaceNames;
		int workspaceNamesc;
		int maxMonitors;
		int** screenPreferences;
		int screenPreferencesc;

		// Keybinds
		KeyBind* binds;
		int bindsc;
};