Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
jovanlanik committed Apr 19, 2024
1 parent eb6982c commit 322b063
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
11 changes: 6 additions & 5 deletions gtklock-module.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// gtklock-powerbar-module
// Copyright (c) 2022 Jovan Lanik
// Copyright (c) 2024 Jovan Lanik

// Module header

Expand All @@ -21,13 +21,13 @@ struct Window {
GtkWidget *warning_label;
GtkWidget *clock_label;

gulong enter_notify_handler;

void *module_data[];
};

struct GtkLock {
GtkApplication *app;
void *lock;

GArray *windows;
GArray *messages;
GArray *errors;
Expand All @@ -39,13 +39,12 @@ struct GtkLock {
guint draw_clock_source;
guint idle_hide_source;

gboolean use_layer_shell;
gboolean use_input_inhibit;
gboolean use_idle_hide;

char *time;
char *time_format;
char *config_path;
char *layout_path;

GArray *modules;
};
Expand All @@ -55,6 +54,8 @@ void g_module_unload(GModule *m);
void on_activation(struct GtkLock *gtklock, int id);
void on_output_change(struct GtkLock *gtklock);
void on_focus_change(struct GtkLock *gtklock, struct Window *win, struct Window *old);
void on_idle_hide(struct GtkLock *gtklock);
void on_idle_show(struct GtkLock *gtklock);
void on_window_create(struct GtkLock *gtklock, struct Window *win);
void on_window_destroy(struct GtkLock *gtklock, struct Window *win);

Expand Down
5 changes: 3 additions & 2 deletions source.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct powerbar {
};

const gchar module_name[] = "powerbar";
const guint module_major_version = 2;
const guint module_major_version = 3;
const guint module_minor_version = 0;

static int self_id;
Expand Down Expand Up @@ -95,7 +95,7 @@ static void setup_powerbar(struct Window *ctx) {
}

if(suspend_command && suspend_command[0] != '\0') {
POWERBAR(ctx)->suspend_button = gtk_button_new_from_icon_name("media-playback-pause-symbolic", GTK_ICON_SIZE_BUTTON);
POWERBAR(ctx)->suspend_button = gtk_button_new_from_icon_name("weather-clear-night-symbolic", GTK_ICON_SIZE_BUTTON);
gtk_widget_set_name(POWERBAR(ctx)->suspend_button, "suspend-button");
//gtk_widget_set_tooltip_text(POWERBAR(ctx)->suspend_button, "Suspend");
gtk_button_set_always_show_image(GTK_BUTTON(POWERBAR(ctx)->suspend_button), TRUE);
Expand All @@ -105,6 +105,7 @@ static void setup_powerbar(struct Window *ctx) {
}

if(userswitch_command && userswitch_command[0] != '\0') {
// No suspend icon in GTK...
POWERBAR(ctx)->userswitch_button = gtk_button_new_from_icon_name("system-users-symbolic", GTK_ICON_SIZE_BUTTON);
gtk_widget_set_name(POWERBAR(ctx)->userswitch_button, "userswitch-button");
//gtk_widget_set_tooltip_text(POWERBAR(ctx)->userswitch_button, "Switch user");
Expand Down

0 comments on commit 322b063

Please sign in to comment.