mirror of
https://github.com/swaywm/sway.git
synced 2026-04-24 06:46:22 -04:00
Display window title and icon in swaybar
Signed-off-by: Felix Weilbach <felix.weilbach@t-online.de>
This commit is contained in:
parent
c12169953a
commit
8fa71290af
13 changed files with 454 additions and 15 deletions
|
|
@ -13,6 +13,7 @@ struct swaybar_output;
|
|||
struct swaybar_tray;
|
||||
#endif
|
||||
struct swaybar_workspace;
|
||||
struct swaybar_window;
|
||||
struct loop;
|
||||
|
||||
struct swaybar {
|
||||
|
|
@ -44,6 +45,11 @@ struct swaybar {
|
|||
struct wl_list unused_outputs; // swaybar_output::link
|
||||
struct wl_list seats; // swaybar_seat::link
|
||||
|
||||
struct swaybar_window *focused_window;
|
||||
|
||||
// TOOD: Better name
|
||||
bool workspace_changed;
|
||||
|
||||
#if HAVE_TRAY
|
||||
struct swaybar_tray *tray;
|
||||
#endif
|
||||
|
|
@ -89,6 +95,12 @@ struct swaybar_workspace {
|
|||
bool urgent;
|
||||
};
|
||||
|
||||
struct swaybar_window {
|
||||
char *name;
|
||||
char *icon_name;
|
||||
cairo_surface_t *icon;
|
||||
};
|
||||
|
||||
bool bar_setup(struct swaybar *bar, const char *socket_path);
|
||||
void bar_run(struct swaybar *bar);
|
||||
void bar_teardown(struct swaybar *bar);
|
||||
|
|
@ -109,6 +121,7 @@ void set_bar_dirty(struct swaybar *bar);
|
|||
*/
|
||||
bool determine_bar_visibility(struct swaybar *bar, bool moving_layer);
|
||||
void free_workspaces(struct wl_list *list);
|
||||
void free_window(struct swaybar_window *window);
|
||||
|
||||
void status_in(int fd, short mask, void *data);
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
bool ipc_initialize(struct swaybar *bar);
|
||||
bool handle_ipc_readable(struct swaybar *bar);
|
||||
bool ipc_get_workspaces(struct swaybar *bar);
|
||||
bool ipc_set_focused_window(struct swaybar *bar);
|
||||
void ipc_send_workspace_command(struct swaybar *bar, const char *ws);
|
||||
void ipc_execute_binding(struct swaybar *bar, struct swaybar_binding *bind);
|
||||
|
||||
|
|
|
|||
|
|
@ -27,10 +27,12 @@ struct icon_theme {
|
|||
char *dir;
|
||||
list_t *subdirs; // struct icon_theme_subdir *
|
||||
};
|
||||
|
||||
list_t *get_basedirs(void);
|
||||
void init_themes(list_t **themes, list_t **basedirs);
|
||||
void finish_themes(list_t *themes, list_t *basedirs);
|
||||
|
||||
char *append_path_safe(const char *base_path, const char *append_path);
|
||||
|
||||
/*
|
||||
* Finds an icon of a specified size given a list of themes and base directories.
|
||||
* If the icon is found, the pointers min_size & max_size are set to minimum &
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue