This repository has been archived by the owner. It is now read-only.
forked from cococry/ragnar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.h
182 lines (148 loc) · 5.46 KB
/
config.h
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
#pragma once
#include <X11/X.h>
#include <stdint.h>
#include <X11/Xft/Xft.h>
// INTERNAL -- IGNORE
typedef struct {
XftFont* font;
XftColor color;
XftDraw* draw;
} FontStruct;
typedef struct {
uint32_t width, height;
} Monitor;
typedef struct {
const char* cmd;
float refresh_time;
float timer;
char text[512];
bool init;
} BarCommand;
typedef struct {
const char* cmd;
const char* icon;
Window win;
FontStruct font;
} BarButton;
typedef struct {
const char* cmd;
uint8_t key;
bool spawned, hidden;
Window win, frame;
} ScratchpadDef;
/* Commands */
#define TERMINAL_CMD "alacritty &"
#define WEB_BROWSER_CMD "chromium &"
#define APPLICATION_LAUNCHER_CMD "dmenu_run &"
#define WM_REFRESH_SPEED 1.0 // In seconds
/* Font */
/*
* IMPORTANT:
* Unicode characters often need some tweaking with positioning.
* If you use a unicode character as an icon and it is not correctly centered,
* just add spaces to the back or front of the icon to center it. */
#define FONT "monospace:size=11"
#define FONT_SIZE 11
#define FONT_COLOR "#ffffff"
/* Keybindings */
#define MASTER_KEY Mod4Mask
#define TERMINAL_OPEN_KEY XK_Return
#define WEB_BROWSER_OPEN_KEY XK_W
#define APPLICATION_LAUNCHER_OPEN_KEY XK_S
#define WM_TERMINATE_KEY XK_C
#define WINDOW_CLOSE_KEY XK_Q
#define WINDOW_FULLSCREEN_KEY XK_F
#define WINDOW_ADD_TO_LAYOUT_KEY XK_space
#define WINDOW_LAYOUT_CYCLE_UP_KEY XK_Up
#define WINDOW_LAYOUT_CYCLE_DOWN_KEY XK_Down
#define WINDOW_LAYOUT_INCREASE_MASTER_X_KEY XK_L
#define WINDOW_LAYOUT_DECREASE_MASTER_X_KEY XK_H
#define WINDOW_LAYOUT_INCREASE_SLAVE_Y_KEY XK_K
#define WINDOW_LAYOUT_DECREASE_SLAVE_Y_KEY XK_J
#define WINDOW_LAYOUT_FLOATING_KEY XK_R
#define WINDOW_LAYOUT_TILED_MASTER_KEY XK_T
#define WINDOW_CYCLE_KEY XK_Tab
#define WINDOW_GAP_INCREASE_KEY XK_plus
#define WINDOW_GAP_DECREASE_KEY XK_minus
#define BAR_TOGGLE_KEY XK_I
#define BAR_CYCLE_MONITOR_UP_KEY XK_N
#define BAR_CYCLE_MONITOR_DOWN_KEY XK_B
#define DECORATION_TOGGLE_KEY XK_U
/* Desktops */
#define DESKTOP_CYCLE_UP_KEY XK_D
#define DESKTOP_CYCLE_DOWN_KEY XK_A
#define DESKTOP_CLIENT_CYCLE_UP_KEY XK_P
#define DESKTOP_CLIENT_CYCLE_DOWN_KEY XK_O
#define DESKTOP_COUNT 10
/* Window properties */
#define WINDOW_BG_COLOR 0x32302f
#define WINDOW_BORDER_WIDTH 3 // In pixles
#define WINDOW_BORDER_COLOR 0x242424
#define WINDOW_BORDER_COLOR_ACTIVE 0x454545
#define WINDOW_MIN_SIZE_Y_LAYOUT 100 // In pixels
#define WINDOW_MAX_GAP 400 // In pixels
/* Window decoration */
#define SHOW_DECORATION true
#define DECORATION_TITLEBAR_SIZE 30
#define DECORATION_COLOR 0x2d2d2d // #2d2d2d
#define DECORATION_TITLE_COLOR 0x212121 // #212121
#define DECORATION_TRIANGLES true
#define DECORATION_SHOW_CLOSE_ICON true
#define DECORATION_CLOSE_ICON "X"
#define DECORATION_CLOSE_ICON_COLOR 0x212121 // #212121
#define DECORATION_CLOSE_ICON_SIZE 50
#define DECORATION_SHOW_MAXIMIZE_ICON true
#define DECORATION_MAXIMIZE_ICON "Max"
#define DECORATION_MAXIMIZE_ICON_COLOR 0x212121 // #212121
#define DECORATION_MAXIMIZE_ICON_SIZE 50
/* Bar */
/*
* ===============================================================================================
* |------------------------------\ \--------------\ |=| |=| |=| \---------|
* ===============================================================================================
* ^ ^ ^ ^
* | | | |
* Main Label. Content of this Info Label. Conent of this Button Label. Version Label.
* label is the output of label is information Icons which, when This shows the version of
* the BarCommands about the WM like the current clicked execute Ragnar WM that is running
* monitor or the current program. their given command.
* */
#define SHOW_BAR true
#define BAR_SHOW_INFO_LABEL true
#define BAR_SHOW_VERSION_LABEL true
#define BAR_SIZE 20 // In pixels
#define BAR_START_MONITOR 1 // Monitor on which the bar is on. (0 is most left)
#define BAR_COLOR 0x202020
#define BAR_LABEL_PADDING 100 // In pixels
#define BAR_MAIN_LABEL_COLOR 0x1e404f
#define BAR_INFO_LABEL_COLOR 0x1e404f
#define BAR_BUTTON_LABEL_COLOR 0x1e404f
#define BAR_VERSION_LABEL_COLOR 0x1e404f
#define BAR_INFO_PROGRAM_ICON "Program: "
#define BAR_INFO_MONITOR_ICON "Monitor: "
#define BAR_INFO_DESKTOP_ICON "Desktop: "
#define BAR_INFO_WINDOW_LAYOUT_ICON "Layout: "
#define BAR_SLICES_COUNT 1
#define BAR_BUTTON_COUNT 3
static BarCommand BarCommands[BAR_SLICES_COUNT] =
{
(BarCommand){.cmd = "echo \"$(date +%R) \"", .refresh_time = 1.0f},
};
static BarButton BarButtons[BAR_BUTTON_COUNT] =
{
(BarButton){.cmd = APPLICATION_LAUNCHER_CMD, .icon = "Search"},
(BarButton){.cmd = TERMINAL_CMD, .icon = "Terminal"},
(BarButton){.cmd = WEB_BROWSER_CMD, .icon = "Browser"},
};
/* Scratchpads */
#define SCRATCH_PAD_COUNT 2
static ScratchpadDef ScratchpadDefs[SCRATCH_PAD_COUNT] =
{
(ScratchpadDef){.cmd = "alacritty &", .key = XK_1},
(ScratchpadDef){.cmd = "alacritty -e vim &", .key = XK_2},
};
/* Monitors */
// Ordered From left to right (0 is most left)
#define MONITOR_COUNT 2
static const Monitor Monitors[MONITOR_COUNT] = {(Monitor){.width = 1920, .height = 1080}, (Monitor){.width = 2560, .height = 1440}};
static const uint32_t BarButtonLabelPos[MONITOR_COUNT] = { 1350, 1600 };