update
This commit is contained in:
parent
eb6982cca9
commit
322b063a6c
2 changed files with 9 additions and 7 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
// gtklock-powerbar-module
|
// gtklock-powerbar-module
|
||||||
// Copyright (c) 2022 Jovan Lanik
|
// Copyright (c) 2024 Jovan Lanik
|
||||||
|
|
||||||
// Module header
|
// Module header
|
||||||
|
|
||||||
|
|
@ -21,13 +21,13 @@ struct Window {
|
||||||
GtkWidget *warning_label;
|
GtkWidget *warning_label;
|
||||||
GtkWidget *clock_label;
|
GtkWidget *clock_label;
|
||||||
|
|
||||||
gulong enter_notify_handler;
|
|
||||||
|
|
||||||
void *module_data[];
|
void *module_data[];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct GtkLock {
|
struct GtkLock {
|
||||||
GtkApplication *app;
|
GtkApplication *app;
|
||||||
|
void *lock;
|
||||||
|
|
||||||
GArray *windows;
|
GArray *windows;
|
||||||
GArray *messages;
|
GArray *messages;
|
||||||
GArray *errors;
|
GArray *errors;
|
||||||
|
|
@ -39,13 +39,12 @@ struct GtkLock {
|
||||||
guint draw_clock_source;
|
guint draw_clock_source;
|
||||||
guint idle_hide_source;
|
guint idle_hide_source;
|
||||||
|
|
||||||
gboolean use_layer_shell;
|
|
||||||
gboolean use_input_inhibit;
|
|
||||||
gboolean use_idle_hide;
|
gboolean use_idle_hide;
|
||||||
|
|
||||||
char *time;
|
char *time;
|
||||||
char *time_format;
|
char *time_format;
|
||||||
char *config_path;
|
char *config_path;
|
||||||
|
char *layout_path;
|
||||||
|
|
||||||
GArray *modules;
|
GArray *modules;
|
||||||
};
|
};
|
||||||
|
|
@ -55,6 +54,8 @@ void g_module_unload(GModule *m);
|
||||||
void on_activation(struct GtkLock *gtklock, int id);
|
void on_activation(struct GtkLock *gtklock, int id);
|
||||||
void on_output_change(struct GtkLock *gtklock);
|
void on_output_change(struct GtkLock *gtklock);
|
||||||
void on_focus_change(struct GtkLock *gtklock, struct Window *win, struct Window *old);
|
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_create(struct GtkLock *gtklock, struct Window *win);
|
||||||
void on_window_destroy(struct GtkLock *gtklock, struct Window *win);
|
void on_window_destroy(struct GtkLock *gtklock, struct Window *win);
|
||||||
|
|
||||||
|
|
|
||||||
5
source.c
5
source.c
|
|
@ -21,7 +21,7 @@ struct powerbar {
|
||||||
};
|
};
|
||||||
|
|
||||||
const gchar module_name[] = "powerbar";
|
const gchar module_name[] = "powerbar";
|
||||||
const guint module_major_version = 2;
|
const guint module_major_version = 3;
|
||||||
const guint module_minor_version = 0;
|
const guint module_minor_version = 0;
|
||||||
|
|
||||||
static int self_id;
|
static int self_id;
|
||||||
|
|
@ -95,7 +95,7 @@ static void setup_powerbar(struct Window *ctx) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(suspend_command && suspend_command[0] != '\0') {
|
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_name(POWERBAR(ctx)->suspend_button, "suspend-button");
|
||||||
//gtk_widget_set_tooltip_text(POWERBAR(ctx)->suspend_button, "Suspend");
|
//gtk_widget_set_tooltip_text(POWERBAR(ctx)->suspend_button, "Suspend");
|
||||||
gtk_button_set_always_show_image(GTK_BUTTON(POWERBAR(ctx)->suspend_button), TRUE);
|
gtk_button_set_always_show_image(GTK_BUTTON(POWERBAR(ctx)->suspend_button), TRUE);
|
||||||
|
|
@ -105,6 +105,7 @@ static void setup_powerbar(struct Window *ctx) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(userswitch_command && userswitch_command[0] != '\0') {
|
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);
|
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_name(POWERBAR(ctx)->userswitch_button, "userswitch-button");
|
||||||
//gtk_widget_set_tooltip_text(POWERBAR(ctx)->userswitch_button, "Switch user");
|
//gtk_widget_set_tooltip_text(POWERBAR(ctx)->userswitch_button, "Switch user");
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue