Commit Graph

193 Commits

Author SHA1 Message Date
8310700bbb Improve sway/language 2021-07-13 04:33:12 +03:00
999c1b6b81 sway-language: ignore events with empty layout 2021-06-05 15:03:52 +02:00
a03283d65f rewriteTitle: allow multiple sequential rewrites 2021-04-26 20:26:43 +02:00
af3c868a5b Catch exception on erroneous rules
std::regex and std::regex_replace may throw an std::regex_error if the
expression or replacement contain errors.

Log this error and carry on with the next rule, so that the title is
shown even if the config contains errors.
2021-04-21 12:24:47 +02:00
b16c8972c7 Add option to rewrite sway/window title
Rewrites window title according to config option "rewrite".
"rewrite" is an object where keys are regular expressions and values are
rewrite rules if the expression matches. Rules may contain references to
captures of the expression. Regex and replacement follow ECMA-script
rules. If no regex matches, the title is left unchanged.

example:
"sway/window": {
  "rewrite": {
    "(.*) - Mozilla Firefox": " $1",
    "(.*) - zsh": " $1",
  }
}
2021-04-21 12:24:47 +02:00
7eb2a6b709 Add a configuration entry to disable auto_back_and_forth on Sway workspaces 2021-02-02 21:58:26 +01:00
e19aa1d43a [sway/window] Add app_id to usable fields in title 2021-01-30 01:41:45 +01:00
cb7baee045 Fixed compile error 2020-12-18 18:17:17 -05:00
85ca5027f4 Fix Sway #waybar.solo CSS rule applying on split
This error occurs because of an incorrect assumption that the size of
the list of nodes that contains the focused window is the number of
windows in a workspace.

The windows in a workspace are stored as a tree by Sway, rather than a
list, so the number of windows has to be found by counting the leaves of
a workspace tree.
2020-12-18 18:14:14 -05:00
68b6136989 fix(sway/workspaces): ignore emulated scroll events
GDK Wayland backend can emit two events for mouse scroll: one is a
GDK_SCROLL_SMOOTH and the other one is an emulated scroll event with
direction. We only receive emulated events on a window, thus it is not
possible to handle these in a module and stop propagation.

Ignoring emulated events should be safe since those are duplicates of
smooth scroll events anyways.

Fixes #386
2020-12-04 01:09:42 -08:00
ebdeb86703 feat(swaybar-ipc): handle visibility_by_modifier update 2020-10-19 19:35:55 -07:00
bc13453155 feat(swaybar-ipc): handle mode update 2021-09-15 22:39:51 +07:00
23e5181cac feat(swaybar-ipc): add swaybar IPC client 2020-10-19 19:34:48 -07:00
8349316fcd Merge branch 'master' into sway-language-module 2020-10-12 13:31:39 +03:00
cc3acf8102 feature: created sway language submodule; added styles & config part for a sway language submodule 2020-10-10 19:09:18 +03:00
83d679bf72 Add format-icons for workspace's name entry 2020-09-26 23:06:12 +00:00
29fa74f621 Add IDs to sway workspace buttons for CSS styling
In case you want to style a specific workspace add IDs to the workspace
buttons. Styling is done by matching button#sway-workspace-${name}.
2020-08-13 11:36:19 +01:00
8f10c9056c Add option for no workspace switch on click
In sway/workspaces, just like disable-scroll turns on/off the ability to
change workspaces by scrolling the mouse add disable-click that turns
on/off the ability to change workspaces by clicking.
2020-08-12 11:38:48 +01:00
9ebfc54eb5 switch workspace on mouse-down to match swaybar
fixes #686
2020-08-06 16:04:30 +02:00
006850ea5e Changed helper function for workspace->num assignment to a static method of Workspaces class
and adapted comments/method name to be consistent with the rest
2020-07-27 10:56:49 +02:00
15fe73a252 duplicate the logic to assign numbers to workspaces from sway into waybar to handle perisstent workspaces 2020-07-22 16:13:24 +02:00
0080feb9af sway/workspaces: make clicking on workspaces idempotent
Previously, clicking on the same workspace you were on would throw you
to another workspace if `workspace_auto_back_and_forth yes` was
specified in your sway config. This also fixes workspace output moving
misbehaving and doing the same.
2020-06-09 20:43:43 -04:00
6fe764540c sway/workspaces: sort by the "num" property provided by sway, configurable whether numeric workspace names come first
Sway provides the workspace "num" property which is an integer number of
the workspace, i.e., workspace "3" -> 3 and also "3dev" -> "3". This
commit uses this property to sort the workspaces, which makes sense when
persistent workspaces or all-output is specified. This commit also adds
a new configuration option, whether the numeric workspaces come in front
or after workspaces that have non-numeric name.
2020-05-05 09:15:20 +02:00
c602d38c8e sway/workspaces added current_output CSS class to buttons.
All workspace buttons that are visible on the same output as the current waybar can be styled with the `current_output` css class.

This is really only useful in combination with the `"all-outputs":
true`. Then the workspaces that are on the current output can be styled
differently than the workspace on other outputs, while all are visible
in the waybar.
2020-05-04 16:16:09 +02:00
4a7dd400fe Merge branch 'master' into on-update 2020-04-12 18:32:19 +02:00
b40cdcb5bd refactor: call parent update 2020-04-12 18:30:21 +02:00
7c4ea39774 fix: add missing comma 2020-04-06 12:49:41 +02:00
27fbea2b5a refactor(workspaces): default value unstripped, fix man 2020-04-06 12:42:29 +02:00
bb2c16386b feat: format-icon for persistent workspaces 2020-04-04 21:13:25 +02:00
ae6ca36fa7 fix(sway): resolve destruction dependency between Ipc and SleeperThread
Ipc destructor closes socket and thus wakes up SleeperThread which was
waiting for socket data in Ipc::handleEvent.
Ipc::handleEvent then proceeds with sending signal to already destroyed
object, causing heap-use-after-free Address Sanitizer error.
2020-02-04 23:22:43 -08:00
7f7ebb5367 fix(workspaces): add int comparison 2019-10-19 16:19:35 +01:00
36fc8365ee Merge pull request #446 from bschacht/fix-typo-persistant
Fix typo: persistant -> persistent
2019-08-31 21:13:31 +02:00
2646390e28 Fix typo: persistant -> persistent 2019-08-31 19:57:44 +02:00
66f2cbed51 Fix typo
ouput -> output
2019-08-31 17:50:56 +00:00
e38df047fd sway/mode: enable pango markup on supported modes
IPC reports {"mode": "mode_string", "pango_markup": bool}.
Use this to conditionally enable pango markup.
2019-08-28 19:48:33 -05:00
a6c0bc5a52 Fix deadlock on workspace scrolling
Make the mutex guard lifecycle finish before the send ipc command
by adding scope around the code.

Fixes #395 .
2019-07-05 20:47:44 -07:00
a6980fca7f feat: ellipsize modules 2019-06-28 14:16:09 +02:00
bd5146fdcf fix(Label): ELLIPSIZE all label modules 2019-06-28 13:49:04 +02:00
ff9d598c16 fix: add proper mutex 2019-06-17 11:39:45 +02:00
340ec7be91 refactor: AModule 2019-06-15 14:57:52 +02:00
dabe2bebbb feat(sway/window): handle floating nodes 2019-06-14 11:27:40 +02:00
486b5a5d38 fix(sway/window): check output recursively 2019-06-14 10:57:22 +02:00
11bbc3b24d Fix twitchy scrolling on touchpads (#381)
Fix twitchy scrolling on touchpads
2019-06-14 10:38:25 +02:00
028b184f7b fix(workspaces): persistant class with empty outputs 2019-06-12 09:50:33 +02:00
396f7d4525 Workspaces: implement horizontal continuous scrolling 2019-06-11 18:44:54 +02:00
3c9b533997 fix(window): avoid hexpand 2019-06-11 17:57:17 +02:00
ed4521d113 Workspaces: fix twitchy scrolling on touchpads
Previously, any and all scroll events were interpreted as reason to switch
workspaces. This resulted in twitchy behaviour, where the scrolling was
practically unusable.

Now, we pool all scroll values, and only scroll if the value is larger than the
new config option "smooth-scrolling-threshold". If this option is not set, the
behaviour is unchanged.
2019-06-11 17:22:24 +02:00
c2e9ed6091 feat(workspaces): add class to persistant workspaces 2019-06-11 14:08:48 +02:00
a37b4687ff Revert "refactor(window): we don't need to subscribe workspace events"
This reverts commit 648eecdd83.
2019-06-11 14:06:31 +02:00
648eecdd83 refactor(window): we don't need to subscribe workspace events 2019-06-07 15:08:33 +02:00