mirror of
https://github.com/swaywm/sway.git
synced 2026-04-23 06:46:27 -04:00
swaybar: add bindgesture support
Co-authored-by: Michael Weiser <michael.weiser@gmx.de>
This commit is contained in:
parent
b896841824
commit
2e64eeda42
9 changed files with 268 additions and 0 deletions
|
|
@ -6,6 +6,7 @@
|
|||
#include "pool-buffer.h"
|
||||
#include "wlr-layer-shell-unstable-v1-client-protocol.h"
|
||||
#include "xdg-output-unstable-v1-client-protocol.h"
|
||||
#include "pointer-gestures-unstable-v1-client-protocol.h"
|
||||
|
||||
struct swaybar_config;
|
||||
struct swaybar_output;
|
||||
|
|
@ -31,6 +32,7 @@ struct swaybar {
|
|||
struct zwlr_layer_shell_v1 *layer_shell;
|
||||
struct zxdg_output_manager_v1 *xdg_output_manager;
|
||||
struct wl_shm *shm;
|
||||
struct zwp_pointer_gestures_v1 *pointer_gestures;
|
||||
|
||||
struct swaybar_config *config;
|
||||
struct status_line *status;
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
#include <stdint.h>
|
||||
#include <wayland-client.h>
|
||||
#include "../include/config.h"
|
||||
#include "gesture.h"
|
||||
#include "list.h"
|
||||
#include "util.h"
|
||||
|
||||
|
|
@ -24,6 +25,11 @@ struct swaybar_binding {
|
|||
bool release;
|
||||
};
|
||||
|
||||
struct swaybar_gesture {
|
||||
struct gesture gesture;
|
||||
char *command;
|
||||
};
|
||||
|
||||
struct swaybar_config {
|
||||
char *status_command;
|
||||
bool pango_markup;
|
||||
|
|
@ -40,6 +46,7 @@ struct swaybar_config {
|
|||
bool workspace_buttons;
|
||||
uint32_t workspace_min_width;
|
||||
list_t *bindings;
|
||||
list_t *gestures;
|
||||
struct wl_list outputs; // config_output::link
|
||||
int height;
|
||||
int status_padding;
|
||||
|
|
@ -90,5 +97,6 @@ struct swaybar_config *init_config(void);
|
|||
void free_config(struct swaybar_config *config);
|
||||
uint32_t parse_position(const char *position);
|
||||
void free_binding(struct swaybar_binding *binding);
|
||||
void free_gesture(struct swaybar_gesture *gesture);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include <wayland-client.h>
|
||||
#include <stdbool.h>
|
||||
#include "gesture.h"
|
||||
#include "list.h"
|
||||
|
||||
#define SWAY_SCROLL_UP KEY_MAX + 1
|
||||
|
|
@ -66,6 +67,10 @@ struct swaybar_seat {
|
|||
struct wl_seat *wl_seat;
|
||||
struct swaybar_pointer pointer;
|
||||
struct swaybar_touch touch;
|
||||
struct zwp_pointer_gesture_hold_v1 *hold;
|
||||
struct zwp_pointer_gesture_pinch_v1 *pinch;
|
||||
struct zwp_pointer_gesture_swipe_v1 *swipe;
|
||||
struct gesture_tracker gestures;
|
||||
struct wl_list link; // swaybar_seat:link
|
||||
struct swaybar_scroll_axis axis[2];
|
||||
};
|
||||
|
|
|
|||
|
|
@ -8,5 +8,6 @@ bool handle_ipc_readable(struct swaybar *bar);
|
|||
bool ipc_get_workspaces(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);
|
||||
void ipc_execute_gesture(struct swaybar *bar, struct swaybar_gesture *gest);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue