aboutsummaryrefslogtreecommitdiff
path: root/src/comet.c
diff options
context:
space:
mode:
authorFederico Angelilli <code@fedang.net>2024-02-08 12:40:56 +0100
committerFederico Angelilli <code@fedang.net>2024-02-08 12:40:56 +0100
commita81b8b36afad38e93ab2051e26d21d6125a46eca (patch)
treecfa3ff11138783f7a85c6658a3f3284269e9a366 /src/comet.c
parent09505cb480274bdc154c1b4ae3dd6988e56b4368 (diff)
Add dwm tags
Diffstat (limited to 'src/comet.c')
-rw-r--r--src/comet.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/comet.c b/src/comet.c
index 825cb25..586245f 100644
--- a/src/comet.c
+++ b/src/comet.c
@@ -222,16 +222,6 @@ static void menu_action(Button *btn)
static void register_buttons(State *state, Color color, Color line_color, Color text_color)
{
- // Tags button
- // TODO: They don't do anything now...
- for (int i = 0; i < 9; ++i) {
- char text[] = { '1' + i, '\0' };
- Button *btn = button_simple_create(PANGO_ALIGN_LEFT, color, line_color);
- button_simple_set_text(btn, g_strdup(text), text_color);
- button_simple_set_action(btn, show_action, NULL);
- state_add_button(state, btn);
- }
-
// Cpu usage button
Button *cpu_btn = button_simple_create(PANGO_ALIGN_RIGHT, color, line_color);
button_simple_set_text(cpu_btn, g_strdup(" 0%"), text_color);
@@ -296,8 +286,17 @@ int main(int argc, char **argv)
State *state = state_create(win, draw);
Color color = { 0.4, 0.4, 0.4, 1 };
+ Color purple = { 0.502, 0.168, 0.886, 1 };
Color line_color = { 0.8, 0.8, 0.8, 1 };
Color text_color = { 0.9, 0.9, 0.9, 1 };
+
+ // Dwm tags
+ DwmIpc *dwm = dwm_create(state, "/tmp/dwm.sock");
+
+ // FIXME: BUG! Explodes if the buttons are not loaded with the left first!!!
+ // And I have no clue as to why!!!!!
+ dwm_register_tags(dwm, color, purple, text_color, line_color);
+
register_buttons(state, color, line_color, text_color);
// Buttons with special handling
@@ -321,7 +320,6 @@ int main(int argc, char **argv)
date_update(date_btn);
// Quit button
- Color purple = { 0.502, 0.168, 0.886, 1 };
Button *q_btn = button_simple_create(PANGO_ALIGN_RIGHT, purple, line_color);
button_simple_set_text(q_btn, g_strdup(""), text_color);
button_simple_set_action(q_btn, quit_action, mainloop);
@@ -365,8 +363,6 @@ int main(int argc, char **argv)
button_group_append(group, menu);
state_add_button(state, group);
- DwmIpc *dwm = dwm_create(state, "/tmp/dwm.sock");
-
connect_attach_state(con, state);
connect_attach_source(con);