Commit Graph

54 Commits

Author SHA1 Message Date
59a581a39e Emit error when workspace mapping has invalid format
Closes #2024
2022-02-21 20:04:12 +01:00
1a59599388 fix(modules): Avoid downcast in module constructor
The previous CAST_MOD(Impl) for the action_router constructor was
illegal because `this` is not yet of type Impl (because the subclass
constructor has not run yet).

The action_router now accepts std::function for its callbacks.

Fixes #2519
2021-10-03 03:18:39 +02:00
3b6a950380 Remove unused factory.hpp imports 2021-09-21 21:43:27 +02:00
0d1db206c6 Remove factory_util unique and shared
Equivalent to std::make_unique and std::make_shared
2021-09-21 21:43:27 +02:00
99900323b7 feat(conf): Option to always show urgent workspaces in i3 (#2378)
When `pin-workspaces` is set to true using `show-urgent` will show
urgent workspaces on the bar even when the workspace is not associated
with the current monitor.
2021-02-15 21:31:34 +01:00
26be83f893 module: Implement action router (#2336)
* module: Implement proof of concept action router

Action implementation inside module becomes much cleaner because each
module just registers action names together with a callback (pointer to
member function) and the action router does the rest.

* Make input function final

This forces all modules to use the action router

* modules: Catch exceptions in action handlers

* Use action router for all modules

* Use action_ prefix for function names

The mpd module's 'stop' action overwrote the base module's stop function
which caused difficult to debug behavior.

To prevent this in the future we now prefix each function that is
responsible for an action with 'action_'

* Cleanup

* actions: Throw exception when re-registering action

Action names are unique inside modules. Unfortunately there is no way to
ensure this statically, the next best thing is to crash the module and
let the user know that this is a bug.

* Formatting

* actions: Ignore data for actions without data

This is the same behavior as before.

* action_router: Write tests
2021-01-04 10:25:52 +01:00
658ed6974d Do not use reverse-scroll for prev/next actions
The next action should always select the next workspace, the same for
prev.

reverse-scroll should be directly used when setting the scroll actions.

This changes the behavior of `prev` and `next` actions in the i3 and
bspwm module.
But I don't think the impact will be significant and the old behavior
was misleading anyway.
2020-11-26 20:53:53 +01:00
9fb75779f3 Incorporate reviews 2020-11-26 20:53:53 +01:00
bc1b86c584 actions: Separate data from action string
Modules now no longer need to manually parse the action string and
extract data from it.
2020-11-26 20:53:53 +01:00
ae2350167b actions: Switch all modules over to new system
All modules now expose their actions as public static constants

Issues: The menu module no longer closes when an item is clicked (before
it would intercept any executed command and look if it matches one of
its exec commands)
2020-11-26 20:53:53 +01:00
e5783d4113 Include empty tokens when splitting if necessary (#1893)
Fixes #1881
2019-11-21 22:26:53 +01:00
c650513b67 fix(i3): Surround ws names with quotes (#1798)
Fixes #1797
2019-06-04 23:34:16 +02:00
b728fea5be fix(i3): crash without <label-state> (#1591)
Fixes #975
2019-01-09 18:38:44 +01:00
01fc545e09 fix(i3): Play nice with workspace_auto_back_and_forth (#1312)
This makes polybar play nice with the i3wm feature `workspace_auto_back_and_forth`, and it is harmless when that option isn't set.
2018-07-23 15:51:42 +02:00
a2ce4ed725 fix(i3): Reconnect i3 IPC socket on restart/error (#762) 2018-03-25 23:06:03 +02:00
d8414c6ec5 feat(i3): Add workspace separator (#938)
Puts a label-separator node between workspaces on the bar. Since the
separator uses a label it can be configured like any other label

Closes: #929
2018-01-06 16:19:02 -08:00
dc0edfb994 fix(i3): Check whether current ws is found (#826)
Fixes dereference of end() iterator in case current workspace is not found (#824).

Fixes #824
2017-11-01 16:47:07 +01:00
863c510903 fix(i3): Use ws name for click handling #520 2017-04-06 06:22:11 +03:00
68beb8d744 fix(i3): Check whether current ws is focused before issuing scroll commands #503 2017-03-31 22:26:24 +02:00
db0ab78d62 fix(i3): Handle scrolling internally #503 2017-03-31 22:26:24 +02:00
fb709aeab3 fix(i3): Workspace state when visible on unfocused monitor 2017-01-27 03:03:57 +01:00
2dfdbd240e feat(bspwm,i3): Fuzzy-matching names for icons
Added support for fuzzy matching workspace names when assigning icons.
This feature is enabled/disabled through a new option, 'fuzzy-match'.
It is disabled by default.
2017-01-23 17:01:30 +01:00
78bb3695e6 refactor(config): Deduce return type from default value 2016-12-30 23:32:05 +01:00
b422d1d1a4 refactor(modules): Input handling 2016-12-23 20:43:52 +01:00
788a7ca3a3 refactor(modules): Get rid of .inl files 2016-12-21 09:21:35 +01:00
7979f5b3d4 refactor(modules): Handle events using signal_receiver 2016-12-21 08:38:44 +01:00
c01f111e34 refactor(modules): Move setup to constructor 2016-12-21 08:00:09 +01:00
f9062d031c refactor(clang-tidy): Apply fixes 2016-12-15 03:30:41 +01:00
4c36d65cbe fix(eventloop): Acquire lock guard 2016-12-14 19:04:33 +01:00
4870204b4f feat(bspwm,i3): Configurable scroll direction 2016-12-14 17:18:20 +01:00
5077325044 refactor(string_util): Use rvalue references for *trim() 2016-12-14 11:01:44 +01:00
1a2a6e5fab refactor: Construction methods 2016-12-14 11:01:44 +01:00
08be86fbe1 wip(refactor): Improve signal and event handling 2016-12-14 11:01:44 +01:00
3a6ca90fcb refactor(i3): Remove wsname-maxlen 2016-12-14 04:45:34 +01:00
0ed173b96e refactor(i3): Output based wrapping 2016-12-14 04:45:31 +01:00
f4529dde99 feat(i3): Conditional wrap around on scroll
Ref #242
2016-12-14 00:46:54 +01:00
ec39859093 feat: Window click handlers
New parameters for defining fallback click handlers
that will be triggered for the whole window unless
a module action is matched.

Parameters added to all [bar/foo] sections:

- `click-left = ...`
- `click-middle= ...`
- `click-right= ...`
- `scroll-up= ...`
- `scroll-down= ...`

Ref #226
2016-12-05 13:17:15 +01:00
4f76d917f8 fix(build): GCC name error 2016-12-01 03:35:54 +01:00
9cadb681d4 feat(i3): Add mode label 2016-11-30 18:23:11 +01:00
ff9be848c7 refactor(clang-tidy): Apply fixes 2016-11-25 21:58:49 +01:00
84d58e7619 refactor: Cleanup handling of syntax tags 2016-11-25 04:34:24 +01:00
c6d85b2b92 refactor: Optimize build 2016-11-20 23:04:31 +01:00
88c8bbd940 refactor: Fwd declare drawtypes
Ref #164
2016-11-19 15:49:06 +01:00
fd57ab0f3d fix: project rename 2016-11-19 06:26:07 +01:00
2740e69a38 refactor(i3): Cleanup and configurable actions
- Do not throw on handle_event failure
- Add settings to disable mouse scroll/click actions
- Add fold markers
- Misc cleanup
2016-11-12 13:07:05 +01:00
12a64bd3d6 fix(i3): Trim workspace names
Closes #126
2016-11-03 15:43:46 +01:00
e7cb345cec wip: Separate source from definitions 2016-11-03 12:54:32 +01:00
d359ab6057 refactor: Application rewrite 2016-10-10 14:52:57 +02:00
f406f1eb9f Cleanup and compiler check fixes 2016-06-29 11:06:44 +02:00
35d84ccb8d fix(i3): Release wait lock 2016-06-28 17:16:46 +02:00