Commit Graph

52 Commits

Author SHA1 Message Date
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
cc3acf8102 feature: created sway language submodule; added styles & config part for a sway language submodule 2020-10-10 19:09:18 +03: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
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
1dc557456e Add missing includes for libc++
In file included from ../src/modules/custom.cpp:1:
In file included from ../include/modules/custom.hpp:7:
../include/util/command.hpp:15:25: error: implicit instantiation of undefined template 'std::__1::array<char, 128>'
  std::array<char, 128> buffer = {0};
                        ^
../src/modules/pulseaudio.cpp:175:41: error: implicit instantiation of undefined template 'std::__1::array<std::__1::basic_string<char>, 9>'
static const std::array<std::string, 9> ports = {
                                        ^
/usr/include/c++/v1/__tuple:223:64: note: template is declared here
template <class _Tp, size_t _Size> struct _LIBCPP_TEMPLATE_VIS array;
                                                               ^
In file included from ../src/factory.cpp:1:
In file included from ../include/factory.hpp:8:
../include/modules/sway/workspaces.hpp:39:8: error: no template named 'unordered_map' in namespace 'std'
  std::unordered_map<std::string, Gtk::Button> buttons_;
  ~~~~~^
../src/factory.cpp:20:14: error: cannot initialize return object of type 'waybar::AModule *' with an rvalue of type 'waybar::modules::sway::Workspaces *'
      return new waybar::modules::sway::Workspaces(id, bar_, config_[name]);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2020-05-19 10:37:27 +00:00
e0c42ae415 fix(sway): add missing unordered_map include 2020-02-11 14:31:17 +01: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
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
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
1962caf144 refactor(window): gtk stuff in update method 2019-06-04 17:34:00 +02:00
fcf2d18a01 refactor: destroy threads first 2019-05-29 17:53:22 +02:00
2a9fa1a4b9 refactor(bar): onRealize, onMap 2019-05-25 17:50:45 +02:00
1a76aa0c8c Improving ordering 2019-05-18 11:58:01 -04:00
4d4cadb5ae refactor: simpler code 2019-05-17 09:59:37 +02:00
b45dcdf74e Allow scrolling on the entire bar surface 2019-05-16 22:18:43 +01:00
362c393b1d refactor: try/catch, sigc trackable 2019-05-13 15:15:50 +02:00
0c3c548bc0 fix(Window): avoid concurrency 2019-05-13 14:35:45 +02:00
5bf0ca85ac refactor: try/catch around json parse 2019-05-09 10:30:54 +02:00
5a44c8c6de refactor: avoid unneeded json parsing 2019-05-07 13:43:48 +02:00
b75e0bb0d0 refactor: remove useless bar param 2019-05-07 13:21:18 +02:00
d027243a19 fix: json thread safe 2019-05-02 14:24:54 +02:00
bb8ff5a99f feat(Bar): add class depend of window in the workspace 2019-04-25 16:47:51 +02:00
311c34ecbc feat(Bar): handle widget size changes 2019-04-24 12:37:24 +02:00
cccf60c30e fix(Workspaces): fix concurrence and move json parser to ipc client 2019-04-23 11:42:08 +02:00
cbb6f2a307 refactor(Workspaces, IPC): no more mutex in the workspaces modules, moved to the IPC client for a proper handling 2019-04-19 16:48:02 +02:00
e77c155ede fix(workspaces): avoid mutex block 2019-04-19 12:11:55 +02:00
bb1cf7570e refactor(IPC): use sigc signal 2019-04-19 11:09:06 +02:00
6ed8f94dab refactor: format code 2019-04-18 17:52:00 +02:00
bc9a49787a feat: enable pango markup on sway workspaces 2019-04-15 10:55:44 +02:00
22cddc5e26 refactor(workspaces): scroll output aware 2019-03-18 14:44:07 +01:00
737da3615f resolves #205 2019-03-03 21:35:32 +11:00
add9e925f4 fix(Workspaces): button order 2019-02-02 00:36:52 +01:00
399f61df98 refactor: proper modules destruction 2019-01-13 22:22:22 +01:00
29a2ee1744 refactor: Replace all occurencec of gtkmm.h and only use the necessary headers 2019-01-08 21:05:44 +01:00
8ea0659ee2 Remove ws index from sway ws names 2018-12-28 09:36:02 -08:00
b554094c7e feat: args && class id 2018-12-18 17:30:54 +01:00
691fb88057 refactor(modules): const bar 2018-12-01 00:10:41 +01:00
168415440f Fix clicking and scrolling through workspaces
The way waybar used the workspace "num", clicking a workspace called "1:
something" resulted in going to a newly created workspace called "1",
because the workspace ipc command expects the workspace name, not its number.
2018-11-05 20:16:19 +01:00
a042eea384 Add module to show sway binding mode 2018-10-30 13:39:30 +01:00
047473e5a4 add missing <cstring> include for strncpy, fixes musl
I/usr/include/libdbusmenu-glib-0.4 -flto -fdiagnostics-color=always -DNDEBUG -pipe -D_FILE_OFFSET_BITS=64 -std=c++17 -DHAVE_SWAY -DHAVE_LIBPULSE -DHAVE_DBUSMENU -D_FORTIFY_SOURCE=2 -mtune=generic -O2 -D_REENTRANT -pthread  -MD -MQ 'waybar@exe/src_modules_sway_ipc_client.cpp.o' -MF 'waybar@exe/src_modules_sway_ipc_client.cpp.o.d' -o 'waybar@exe/src_modules_sway_ipc_client.cpp.o' -c ../src/modules/sway/ipc/client.cpp
../src/modules/sway/ipc/client.cpp: In member function 'int waybar::modules::sway::Ipc::open(const string&) const':
../src/modules/sway/ipc/client.cpp:47:3: error: 'strncpy' was not declared in this scope
   strncpy(addr.sun_path, socketPath.c_str(), sizeof(addr.sun_path) - 1);
   ^~~~~~~
../src/modules/sway/ipc/client.cpp:47:3: note: 'strncpy' is defined in header '<cstring>'; did you forget to '#include <cstring>'?
../src/modules/sway/ipc/client.cpp:2:1:
+#include <cstring>

../src/modules/sway/ipc/client.cpp:47:3:
   strncpy(addr.sun_path, socketPath.c_str(), sizeof(addr.sun_path) - 1);
   ^~~~~~~
[36/44] Compiling C++ object 'waybar@exe/src_modules_custom.cpp.o'.
[37/44] Compiling C++ object 'waybar@exe/src_client.cpp.o'.
[38/44] Compiling C++ object 'waybar@exe/src_modules_cpu.cpp.o'.
ninja: build stopped: subcommand failed.
2018-10-28 04:06:07 -03:00
d5d620e72d feat(Window): handle closed window 2018-09-18 21:16:35 +02:00
7020af7653 feat(Workspaces): urgent, visible, focused icons 2018-09-05 00:16:56 +02:00
49232eed8d Clean (#31) 2018-08-20 14:50:45 +02:00
6705134034 Handle screens disconnection (#29) 2018-08-19 13:39:57 +02:00
38ede5b3d5 refactor(ipc): clean 2018-08-18 16:01:56 +02:00
b1fd4d7b82 feat(modules): generic label module to allow max-length on all labels 2018-08-18 11:43:48 +02:00