WillPower3309 / swayfx

SwayFX: Sway, but with eye candy!
MIT License
1.18k stars 48 forks source link

Workspace movement with touchpad gestures #269

Open ErikReider opened 5 months ago

ErikReider commented 5 months ago

Switch between workspaces with touchpad gestures

https://github.com/WillPower3309/swayfx/assets/35975961/667d1420-be25-404c-a61e-2aa7db7c0178

TODO:

To test:

bindworkspacegesture 4:horizontal
# bindworkspacegesture --inverted 4:horizontal
# bindworkspacegesture 4:vertical
# bindworkspacegesture --inverted 4:vertical
WillPower3309 commented 5 months ago

Will respond to the implementation notes today when I take a deeper look! Great stuff Erik! I can probably get this working as an animation in an evening once it's in

WillPower3309 commented 5 months ago

Mind linking this PR to the issue for touchpad gestures? This should fix #142

ozwaldorf commented 5 months ago

Just to mention, nix build seems to be broken:

error: builder for '/nix/store/9sg0wwdj4wdkxskw6wjp2qh0mvcjrydn-sway-unwrapped-1.8.1.drv' failed with exit code 1;
       last 10 log lines:
       > [137/344] Compiling C object sway/sway.p/commands_blur_contrast.c.o
       > [138/344] Compiling C object sway/sway.p/commands_blur_radius.c.o
       > [139/344] Compiling C object sway/sway.p/commands_blur_saturation.c.o
       > [140/344] Compiling C object sway/sway.p/commands_border.c.o
       > [141/344] Compiling C object sway/sway.p/commands_blur_noise.c.o
       > [142/344] Compiling C object sway/sway.p/config_output.c.o
       > [143/344] Compiling C object sway/sway.p/commands_corner_radius.c.o
       > [144/344] Compiling C object sway/sway.p/commands_bind.c.o
       > [145/344] Compiling C object sway/sway.p/commands_client.c.o
       > ninja: build stopped: subcommand failed.
       For full logs, run 'nix log /nix/store/9sg0wwdj4wdkxskw6wjp2qh0mvcjrydn-sway-unwrapped-1.8.1.drv'.
WillPower3309 commented 5 months ago

Just to mention, nix build seems to be broken:

error: builder for '/nix/store/9sg0wwdj4wdkxskw6wjp2qh0mvcjrydn-sway-unwrapped-1.8.1.drv' failed with exit code 1;
       last 10 log lines:
       > [137/344] Compiling C object sway/sway.p/commands_blur_contrast.c.o
       > [138/344] Compiling C object sway/sway.p/commands_blur_radius.c.o
       > [139/344] Compiling C object sway/sway.p/commands_blur_saturation.c.o
       > [140/344] Compiling C object sway/sway.p/commands_border.c.o
       > [141/344] Compiling C object sway/sway.p/commands_blur_noise.c.o
       > [142/344] Compiling C object sway/sway.p/config_output.c.o
       > [143/344] Compiling C object sway/sway.p/commands_corner_radius.c.o
       > [144/344] Compiling C object sway/sway.p/commands_bind.c.o
       > [145/344] Compiling C object sway/sway.p/commands_client.c.o
       > ninja: build stopped: subcommand failed.
       For full logs, run 'nix log /nix/store/9sg0wwdj4wdkxskw6wjp2qh0mvcjrydn-sway-unwrapped-1.8.1.drv'.

The errors here are:

p/desktop_render.c.o -c ../sway/desktop/render.c
../sway/desktop/render.c: In function 'adjust_box_to_workspace_offset':
../sway/desktop/render.c:102:9: error: 'box_coord' may be used uninitialized [-Werror=maybe-uninitialized]
  102 |         *box_coord -= ws_dimen * scroll_percent;
      |         ^~~~~~~~~~
../sway/desktop/render.c:88:14: note: 'box_coord' was declared here
   88 |         int *box_coord;
      |              ^~~~~~~~~
../sway/desktop/render.c:102:32: error: 'ws_dimen' may be used uninitialized [-Werror=maybe-uninitialized]
  102 |         *box_coord -= ws_dimen * scroll_percent;
      |                       ~~~~~~~~~^~~~~~~~~~~~~~~~
../sway/desktop/render.c:87:13: note: 'ws_dimen' was declared here
   87 |         int ws_dimen;
      |             ^~~~~~~~
In function 'adjust_damage_to_workspace_bounds',
    inlined from 'render_fullscreen_con' at ../sway/desktop/render.c:1985:3:
../sway/desktop/render.c:135:16: error: 'coord' may be used uninitialized [-Werror=maybe-uninitialized]
  135 |         *coord = round(-ws_dimen * scroll_percent);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../sway/desktop/render.c: In function 'render_fullscreen_con':
../sway/desktop/render.c:121:14: note: 'coord' was declared here
  121 |         int *coord;
      |              ^~~~~
In function 'adjust_damage_to_workspace_bounds',
    inlined from 'render_fullscreen_con' at ../sway/desktop/render.c:1985:3:
../sway/desktop/render.c:138:32: error: 'ws_dimen' may be used uninitialized [-Werror=maybe-uninitialized]
  138 |                         *coord += ws_dimen;
      |                                ^~
../sway/desktop/render.c: In function 'render_fullscreen_con':
../sway/desktop/render.c:120:13: note: 'ws_dimen' was declared here
  120 |         int ws_dimen;
      |             ^~~~~~~~
cc1: all warnings being treated as errors
ErikReider commented 5 months ago

Might have an idea of how to improve the config command syntax. Converting to draft

ErikReider commented 5 months ago

Might have an idea of how to improve the config command syntax. Converting to draft

Maybe something like this:

bindgesture --invert fluid_swipe:3:horizontal workspace_switch
WillPower3309 commented 4 months ago

Might have an idea of how to improve the config command syntax. Converting to draft

Maybe something like this:

bindgesture --invert fluid_swipe:3:horizontal workspace_switch

Looks good to me!

ErikReider commented 4 months ago

I'll wait with refining this until the sway 1.9 rebase is merged :)

parmjotsinghrobot commented 2 months ago

the rebase has rebased (adding comment to see progress in future)

swwwee commented 2 months ago

the rebase has rebased (adding comment to see progress in future)

also commenting for the same reason.

ErikReider commented 2 months ago

Y'all don't need to comment here to get notifications, just creates spam. The right side panel has a button for notifications :)

ErikReider commented 2 months ago

Rebased from master