Commit Graph

176 Commits

Author SHA1 Message Date
Carlos Ortega
48d2759df5 add layout as class to language module 2022-07-17 16:13:32 +01:00
Alex
4d1aeb7eb8
Merge pull request #1525 from FlexW/feature/icon-heuristics
sway/window: Add heuristics for finding icons
2022-05-23 13:42:26 +02:00
Alex
89be55b00b
Merge pull request #1510 from towoe/sway-bar-show
Show hidden bar
2022-04-20 05:13:53 +02:00
Felix Weilbach
3f123d9c4e sway/window: Add heuristics for finding icons
This adds heuristics for finding the applications icon.
2022-04-18 03:09:25 +02:00
Felix Weilbach
fc6f5741b1 sway/window: Allow the user to change the size of the app icon
Fixes #1461
2022-04-17 23:57:57 +02:00
Felix Weilbach
45988b3dbb Sway/window: Only update icon from main thread
If Gtk objects get updated from other threads than the main thread GTK
can get confused. This is a regression of bcadf64031.

Fixes #1464, #1474
2022-04-17 22:55:58 +02:00
Tobias Wölfel
7763d50691 Add reset behaviour of modifier key
Add an option to change the behaviour of the modifier key to reset the
visibility.
2022-04-15 20:04:58 +02:00
Tobias Wölfel
5a0e42cc76 Limit visibility updates
Prevent visibility updates to occur for inactive modules.
Check active modules and subscribe to only those events.
2022-04-15 20:04:56 +02:00
Tobias Wölfel
1dcd36b06c Show bar on sway mode
Display the bar if the sway mode is not the default mode.
2022-04-15 19:58:50 +02:00
Tobias Wölfel
93f9b3d213 Clear urgency hint with modifier press
If the modifier is pressed and release without another event, the
intended behaviour is to clear an urgency hint and hide the bar again.

Note that if multiple workspaces have the urgency hint set, the bar is
hidden again and an urgent workspace is focused, the bar does not stay
hidden anymore.
2022-04-15 19:55:06 +02:00
Tobias Wölfel
e3700b924e Show bar if a workspace becomes urgent
Add a second reason to show the bar besides visible by modifier.
Update the visibility based on changes in the workspace urgency.
Check all workspaces for urgency and keep the bar visible if at least
one has an urgency hint.
2022-04-14 19:08:11 +02:00
Aleksei Bavshin
13fdbc13c3
refactor: change enum ipc_command_type to uint32_t
As we always use the enum to compare or initialize uint32_t values, it
would be better to declare it with the right type. This way we could
avoid `-Wnarrowing` warnings or unnecessary type casts.
2022-04-10 12:52:46 -07:00
Alex
f2fcadbf62 refactor: lint 2022-04-06 08:37:19 +02:00
Alex
5c1c07a035
Merge pull request #1480 from avdv/xkb-load-exotic-rules
sway/language: Load exotic xkb rules too
2022-03-13 22:32:00 +01:00
Claudio Bley
caa24f0647 sway/language: Load exotic xkb rules too 2022-03-13 09:40:32 +01:00
Alex
35d6da3965
Merge pull request #1292 from FlexW/feature/sway-app-icon
Show application icon when using sway window module
2022-03-06 14:50:41 +01:00
Oto Šťáva
f4f1267a71 sway/language: fix segmentation fault for layouts not found in XKBContext 2022-01-25 20:03:19 +01:00
Felix Weilbach
bcadf64031 Show application icon when using sway window module
Signed-off-by: Felix Weilbach <felix.weilbach@t-online.de>
2022-01-24 17:37:51 +01:00
Johannes Wienke
4a85ec0f59 fix: match sway workspace order with sway one
Ensure that sway workspaces are always displayed in the same order as
used internally by sway. The previous sorting code always sorted
unnumbered workspaces lexicographically. This isn't the order used by
sway internally. Therefore, commands such as "workspace next" might have
jumped arbitrarily in waybar.

This commit reworks the sorting code such that the internal order is
always obeyed. Additionally, numbered persistent workspaces are inserted
at their natural position at the front of the workspace list while
unnumbered ones are appended. This should match the expectations of
workspace ordering known from sway's behavior.

The changes make the configuration property "numeric-first" unnecessary
as this will always be the case now. There's also no reasonable way
around this behavior now. Otherwise, persistent workspaces would jump
around in the visual representation as soon as they become known to
sway.

Fixes #802
2022-01-07 10:26:27 +01:00
Alex
7069429c03
Merge pull request #1229 from kraftwerk28/sway-language-country-flag
`sway/language` country flag
2021-12-01 11:49:39 +01:00
Aleksei Bavshin
cf5ddb2a5e
fix(swaybar-ipc): avoid unnecessary copy of struct swaybar_config 2021-11-28 11:34:21 -08:00
kraftwerk28
89afa8e149 Checking if emoji byte doesn't get out of bounds 2021-11-24 02:15:10 +02:00
kraftwerk28
59040c53e4 Move definition to .cpp 2021-11-24 02:15:10 +02:00
kraftwerk28
0472d279e4 Add {flag} format replacement 2021-11-24 02:15:10 +02:00
Aleksei Bavshin
2290fe10aa
fix(bar): handle ipc connection errors.
Try to use the default bar id (`bar-0`) if none is set.
2021-11-23 08:46:58 -08:00
Aleksei Bavshin
6bfb674d1b
fix(swaybar-ipc): better logs 2021-11-21 17:28:47 -08:00
Rene D. Obermueller
9972384597 sway/window: include floating_nodes when considering window count for class 2021-10-02 18:35:38 +02:00
Gavin Beatty
fe547901fa sway/language: remove tabs, indent with 2 spaces 2021-09-18 15:28:45 -05:00
Gavin Beatty
9ee701974f
Fix memory leak and data race
- Delete previous Layout before creating next one, and in destructor
- Use stack XKBContext instead of local new+delete
- Lock mutex in update() as it is called from a different thread than onEvent(res)
2021-08-20 10:06:35 -05:00
dmitry
c058a2d196 Add number to shortDescripton 2021-08-20 01:09:16 +03:00
dmitry
a87a967a97 Fix leak 2021-08-17 05:29:35 +03:00
dmitry
a57e431437 Add shortDescription 2021-08-17 05:28:41 +03:00
dmitry
68e4457f3a Add tooltip-formay 2021-07-24 17:24:37 +03:00
dmitry
8310700bbb Improve sway/language 2021-07-13 04:33:12 +03:00
Maxim Baz
999c1b6b81
sway-language: ignore events with empty layout 2021-06-05 15:03:52 +02:00
Patrick Hilhorst
a03283d65f
rewriteTitle: allow multiple sequential rewrites 2021-04-26 20:26:43 +02:00
Matthias Richter
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
Matthias Richter
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
Genesis
7eb2a6b709
Add a configuration entry to disable auto_back_and_forth on Sway workspaces 2021-02-02 21:58:26 +01:00
Thomas Sarboni
e19aa1d43a
[sway/window] Add app_id to usable fields in title 2021-01-30 01:41:45 +01:00
Harit Kapadia
cb7baee045 Fixed compile error 2020-12-18 18:17:17 -05:00
Harit Kapadia
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
Aleksei Bavshin
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
Aleksei Bavshin
ebdeb86703
feat(swaybar-ipc): handle visibility_by_modifier update 2020-10-19 19:35:55 -07:00
Aleksei Bavshin
bc13453155
feat(swaybar-ipc): handle mode update 2021-09-15 22:39:51 +07:00
Aleksei Bavshin
23e5181cac
feat(swaybar-ipc): add swaybar IPC client 2020-10-19 19:34:48 -07:00
nikto_b
8349316fcd
Merge branch 'master' into sway-language-module 2020-10-12 13:31:39 +03:00
nikto_b
cc3acf8102
feature: created sway language submodule; added styles & config part for a sway language submodule 2020-10-10 19:09:18 +03:00
lrhel
83d679bf72 Add format-icons for workspace's name entry 2020-09-26 23:06:12 +00:00
Pedro Côrte-Real
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