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
|
#include <X11/X.h>
#include <X11/keysym.h>
#include <X11/XF86keysym.h>
#include <stdlib.h>
#define BORDER_WIDTH 3 /* Border width around windows */
#define BORDER_FOCUSED 0x7287fd /* Selected window's border color */
#define BORDER_UNFOCUSED 0x1e1e2e /* Selectable window's border color */
#define BORDER_INACTIVE 0x11111b /* Unselectable window's border color */
#define GAPS 5 /* gaps around the window */
#define STACK_OFFSET 5 /* how the stacked window are separated */
#define TOPBAR_GAPS 30 /* gaps for the top bar */
#define BOTTOMBAR_GAPS 0 /* gaps for the bottom bar */
#define DEFAULT_MASTER_OFFSET 0 /* master window size by default */
#define METAKEY Mod4Mask /* key that will be used for bindings */
#define FOLLOW_WINDOWS True /* do you want to change workspace when sending a window to another workspace */
#define MAX_WINDOWS 10 /* number of windows per workspaces */
#define AUTO_FLOATING True /* When False, floating windows, will open in tiled layout */
// Helpers for configuration (don't change values)
#define FOCUS_TOP 10
#define FOCUS_BOTTOM 11
#define SLAVES_UP 12
#define SLAVES_DOWN 13
#define BIGGER_MASTER 14
#define SMALLER_MASTER 15
#define BASE_MASTER 16
#define STACKING_TOGGLE 17
#define FULLSCREEN_TOGGLE 18
#define SWAP_FOCUS 19
#define FLOATING_TOGGLE 20
#define FLOATING_HIDE_SHOW 21
// For now only single character names are working
// You might be able to change polybar config to handle nerdfont and other custom names
static const char *workspace_names[10] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", "0" };
typedef struct
{
unsigned int mod;
KeySym key;
void (*func)();
} Bindings;
/* These definitions are used for the execute command. You need to pass GUI for an app that will open a new window.
* Pass NOGUI if it's just a background script or app
* Be carefull with this, it can create bugs and and crashes ! */
#define GUI 30
#define NOGUI 31
// Functions that can be called from Keybinds
void fluorite_execute(char *argument, int mode);
void fluorite_close_window();
void fluorite_change_layout(int mode);
void fluorite_user_close();
void fluorite_change_workspace(int new_workspace, int mode);
// User functions (use it or create yours with these examples)
static void fluorite_terminal() { char prog[255] = "st"; fluorite_execute(prog, GUI); }
static void fluorite_filemanager() { char prog[255] = "thunar"; fluorite_execute(prog, GUI); }
// static void fluorite_dmenu() { char prog[255] = "rofi -show drun"; fluorite_execute(prog, GUI); }
static void fluorite_webbrowser() { char prog[255] = "librewolf"; fluorite_execute(prog, GUI); }
static void fluorite_exit() { fluorite_user_close(); }
static void fluorite_next_focus() { fluorite_change_layout(FOCUS_TOP); }
static void fluorite_prev_focus() { fluorite_change_layout(FOCUS_BOTTOM); }
static void fluorite_stack_rotate_up() { fluorite_change_layout(SLAVES_UP); }
static void fluorite_stack_rotate_down() { fluorite_change_layout(SLAVES_DOWN); }
static void fluorite_bigger_master() { fluorite_change_layout(BIGGER_MASTER); }
static void fluorite_smaller_master() { fluorite_change_layout(SMALLER_MASTER); }
static void fluorite_base_master() { fluorite_change_layout(BASE_MASTER); }
static void fluorite_stacking_toggle() { fluorite_change_layout(STACKING_TOGGLE); }
static void fluorite_fullscreen_toggle() { fluorite_change_layout(FULLSCREEN_TOGGLE); }
static void fluorite_swap_focus() { fluorite_change_layout(SWAP_FOCUS); }
static void fluorite_floating_toggle() { fluorite_change_layout(FLOATING_TOGGLE); }
static void fluorite_floating_hide_show() { fluorite_change_layout(FLOATING_HIDE_SHOW); }
static void fluorite_brightness_up() { char prog[255] = "brightnessctl set 50+"; fluorite_execute(prog, NOGUI); }
static void fluorite_brightness_down() { char prog[255] = "brightnessctl set 50-"; fluorite_execute(prog, NOGUI); }
static void fluorite_volume_up() { char prog[255] = "pamixer -i 5"; fluorite_execute(prog, NOGUI); }
static void fluorite_volume_down() { char prog[255] = "pamixer -d 5"; fluorite_execute(prog, NOGUI); }
static void fluorite_volume_mute() { char prog[255] = "pamixer -t"; fluorite_execute(prog, NOGUI); }
static void fluorite_locking() { char prog[255] = "glitchlock"; fluorite_execute(prog, NOGUI); }
// Workspaces switch function
static void fluorite_goto_workspace_one() { fluorite_change_workspace(0, 0); }
static void fluorite_goto_workspace_two() { fluorite_change_workspace(1, 0); }
static void fluorite_goto_workspace_three() { fluorite_change_workspace(2, 0); }
static void fluorite_goto_workspace_four() { fluorite_change_workspace(3, 0); }
static void fluorite_goto_workspace_five() { fluorite_change_workspace(4, 0); }
static void fluorite_goto_workspace_six() { fluorite_change_workspace(5, 0); }
static void fluorite_goto_workspace_seven() { fluorite_change_workspace(6, 0); }
static void fluorite_goto_workspace_eight() { fluorite_change_workspace(7, 0); }
static void fluorite_goto_workspace_nine() { fluorite_change_workspace(8, 0); }
static void fluorite_goto_workspace_ten() { fluorite_change_workspace(9, 0); }
// App workspaces switch function
static void fluorite_appto_workspace_one() { fluorite_change_workspace(0, 1); }
static void fluorite_appto_workspace_two() { fluorite_change_workspace(1, 1); }
static void fluorite_appto_workspace_three() { fluorite_change_workspace(2, 1); }
static void fluorite_appto_workspace_four() { fluorite_change_workspace(3, 1); }
static void fluorite_appto_workspace_five() { fluorite_change_workspace(4, 1); }
static void fluorite_appto_workspace_six() { fluorite_change_workspace(5, 1); }
static void fluorite_appto_workspace_seven() { fluorite_change_workspace(6, 1); }
static void fluorite_appto_workspace_eight() { fluorite_change_workspace(7, 1); }
static void fluorite_appto_workspace_nine() { fluorite_change_workspace(8, 1); }
static void fluorite_appto_workspace_ten() { fluorite_change_workspace(9, 1); }
static const Bindings bind[] = {
{METAKEY, XK_Return, fluorite_terminal},
{METAKEY, XK_a, fluorite_filemanager},
/*{METAKEY, XK_d, fluorite_dmenu},*/
{METAKEY, XK_h, fluorite_smaller_master},
{METAKEY, XK_j, fluorite_next_focus},
{METAKEY, XK_k, fluorite_prev_focus},
{METAKEY, XK_l, fluorite_bigger_master},
{METAKEY, XK_equal, fluorite_base_master},
{METAKEY, XK_w, fluorite_webbrowser},
{METAKEY, XK_s, fluorite_stacking_toggle},
{METAKEY, XK_f, fluorite_fullscreen_toggle},
{METAKEY, XK_n, fluorite_swap_focus},
{METAKEY, XK_space, fluorite_floating_toggle},
// Workspaces switching
{METAKEY, XK_ampersand, fluorite_goto_workspace_one},
{METAKEY, XK_eacute, fluorite_goto_workspace_two},
{METAKEY, XK_quotedbl, fluorite_goto_workspace_three},
{METAKEY, XK_apostrophe, fluorite_goto_workspace_four},
{METAKEY, XK_parenleft, fluorite_goto_workspace_five},
{METAKEY, XK_minus, fluorite_goto_workspace_six},
{METAKEY, XK_egrave, fluorite_goto_workspace_seven},
{METAKEY, XK_underscore, fluorite_goto_workspace_eight},
{METAKEY, XK_ccedilla, fluorite_goto_workspace_nine},
{METAKEY, XK_agrave, fluorite_goto_workspace_ten},
// App Workspaces switching
{METAKEY|ShiftMask, XK_ampersand, fluorite_appto_workspace_one},
{METAKEY|ShiftMask, XK_eacute, fluorite_appto_workspace_two},
{METAKEY|ShiftMask, XK_quotedbl, fluorite_appto_workspace_three},
{METAKEY|ShiftMask, XK_apostrophe, fluorite_appto_workspace_four},
{METAKEY|ShiftMask, XK_parenleft, fluorite_appto_workspace_five},
{METAKEY|ShiftMask, XK_minus, fluorite_appto_workspace_six},
{METAKEY|ShiftMask, XK_egrave, fluorite_appto_workspace_seven},
{METAKEY|ShiftMask, XK_underscore, fluorite_appto_workspace_eight},
{METAKEY|ShiftMask, XK_ccedilla, fluorite_appto_workspace_nine},
{METAKEY|ShiftMask, XK_agrave, fluorite_appto_workspace_ten},
{METAKEY|ShiftMask, XK_e, fluorite_exit},
{METAKEY|ShiftMask, XK_q, fluorite_close_window},
{METAKEY|ShiftMask, XK_j, fluorite_stack_rotate_up},
{METAKEY|ShiftMask, XK_k, fluorite_stack_rotate_down},
{METAKEY|ShiftMask, XK_x, fluorite_locking},
{METAKEY|ShiftMask, XK_space, fluorite_floating_hide_show},
{0, XF86XK_MonBrightnessUp, fluorite_brightness_up},
{0, XF86XK_MonBrightnessDown, fluorite_brightness_down},
{0, XF86XK_AudioLowerVolume, fluorite_volume_down},
{0, XF86XK_AudioRaiseVolume, fluorite_volume_up},
{0, XF86XK_AudioMute, fluorite_volume_mute},
};
typedef struct
{
char wm_class[255];
} Rules;
// Use xprop on a floating window to get the WM_CLASS name used by a window.
static const Rules default_floating[] = {
{"spectacle"},
{"ghidra-Ghidra"},
};
|