Commit Graph

1882 Commits

Author SHA1 Message Date
Thibaut CHARLES
50d8a1ba06
feat(network): Ability to change speed unit text (B/s) (#2068)
New config option `speed-unit = B/s` will be used to suffix the upload and download speeds.

* mod::network: udspeed-unit to set network speed unit suffix

* Changed udspeed-unit to speed-unit
2020-11-29 14:15:27 +01:00
patrick96
52eee95bf8 controller: Detach shell commands from polybar
Shell commands triggered from action tags used to block polybar until
they finished.

Since we are not actually interested in the output of the commands, it
makes sense to run them completely detached from polybar and have
polybar not block when executing these commands.

Now the spawned child processes no longer get killed when polybar
exits. This is fine because polybar is not responsible for these
processes since they were explicitly started by the user through click
commands.

Ref: #770
Ref: #1680
2020-11-29 03:53:59 +01:00
Michał Drozd
0416093edc
Display correct(binary) unit prefixes in memory module (#2211) 2020-11-27 23:30:09 +01:00
patrick96
5007dae35a If bar bg, fg, border, or line color is alpha only, apply to default 2020-11-27 22:08:03 +01:00
patrick96
53c6f3b042 refactor(color): Better channel function names
(alpha|red|green|blue)_(d|i) are used for the four channels using
doubles or integers, respectively.
2020-11-27 22:08:03 +01:00
patrick96
477189e443 Cleanup 2020-11-27 22:08:03 +01:00
patrick96
4dfbba11c4 Make rgba class immutable 2020-11-27 22:08:03 +01:00
patrick96
cc1efe12cd Add tests for apply_alpha 2020-11-27 22:08:03 +01:00
patrick96
413c911cd1 Move apply_alpha functionality into rgba 2020-11-27 22:08:03 +01:00
patrick96
eeab4f0d45 Print error message for invalid color strings 2020-11-27 22:08:03 +01:00
patrick96
c9efd09f71 Load rgba from config instead of strings. 2020-11-27 22:08:03 +01:00
patrick96
8e10c046fa Move all channel functions into rgba class
Since we use rgba everywhere, extracting channels from uint32_t directly
is not necessary anymore.
2020-11-27 22:08:03 +01:00
patrick96
3655106a14 Adapt the renderer side to always use rgba 2020-11-27 22:08:03 +01:00
patrick96
64fa6469ab Remove unused hex function
This allows us to also remove the cache class which was only used here
2020-11-27 22:08:03 +01:00
patrick96
b238ec3403 Move most color_util functions into rgba class
The intent is for every color to be stored in a rgba instance

The rgba class now stores the color in a 32 bit integer to save space

This also removes the unused class rgb and moves everything else into a
cpp file.

Many functions also had weird template parameters. For example
alpha_channel<unsigned short int> would give a 2 byte number with the
alpha channel byte in both bytes.
color_util::hex would return a hex string with alpha channel if unsigned
short int was given and without if unsigned char was given. Even more
curiously those parameters were passed to *_channel and the result
nevertheless truncated to 8bits.
2020-11-27 22:08:03 +01:00
patrick96
75eb41f5ad config: Better error messages when opening files
If a config file is a directory, ifstream would just read it as an empty
file without any errors.

Failing early here is a good idea.
2020-11-26 21:06:35 +01:00
patrick96
9d31b51a63 github: Cleanup issue templates
We no longer allow people to create issues from a blank template.

The templates for bug reports and build issues are also much more
explicit in what they want from the user.
2020-11-26 21:00:40 +01:00
patrick96
2f549575c7 github: Add PR template
Gives structure to pull requests and make it easier for us to review.
2020-11-26 21:00:40 +01:00
patrick96
874c9527be Add debugging guide to SUPPORT.md 2020-11-26 21:00:40 +01:00
patrick96
f28de58134 readme: Add contributing guideline 2020-11-26 21:00:40 +01:00
patrick96
0b67f67440 readme: Move installation instructions to wiki
All the information in the README was already duplicated on the wiki, it
makes sense to keep the README small and point the user to the wiki.
2020-11-26 21:00:40 +01:00
patrick96
36aa1d08d6 Add contributing guidelines
Only describes bug reports and PRs for now, should include things like
"How to contribute" in the future
2020-11-26 21:00:40 +01:00
patrick96
ff3340e062 controller: Cleanup process_inputdata 2020-11-26 20:53:53 +01:00
patrick96
1afb333858 doc(actions): Point user to doc when using legacy actions 2020-11-26 20:53:53 +01:00
patrick96
191fb2972c actions: Integrate input_handler into module
Only modules can now be action handlers.
This also slightly simplifies the controller because we don't need to
keep track of input handlers, we can just use the module list.
2020-11-26 20:53:53 +01:00
patrick96
0a1b58a2ed doc(actions): Finish migration documentation 2020-11-26 20:53:53 +01:00
patrick96
c427ec06d7 doc(actions): Finish list of available actions 2020-11-26 20:53:53 +01:00
patrick96
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
patrick96
5e64361ed8 doc(actions): Start supported actions table 2020-11-26 20:53:53 +01:00
patrick96
d45ae7954a doc: Finish legacy action migration table 2020-11-26 20:53:53 +01:00
patrick96
1d9365e74f doc: Allow using rtd theme locally 2020-11-26 20:53:53 +01:00
patrick96
3e4f8d402e doc: Initial action documentation 2020-11-26 20:53:53 +01:00
patrick96
1193b78e43 controller: Use unordered_map for legacy actions 2020-11-26 20:53:53 +01:00
patrick96
41ffc3607d controller: Make action shell command local 2020-11-26 20:53:53 +01:00
patrick96
9fb75779f3 Incorporate reviews 2020-11-26 20:53:53 +01:00
patrick96
5ddb6fc0c5 Move legacy action handling to separate function 2020-11-26 20:53:53 +01:00
patrick96
c60b488501 clang-format 2020-11-26 20:53:53 +01:00
patrick96
507004df87 actions: Move parsing to utility file 2020-11-26 20:53:53 +01:00
patrick96
0db8376222 menu: Emit exec actions
Now the menu closes properly again if any actions on it are clicked
2020-11-26 20:53:53 +01:00
patrick96
ef8f7c9d94 feat(menu): Add exec action to menu module
Can be used to execute menu actions through ipc and will also be used to
make sure the menu closes when an action on it is clicked.
2020-11-26 20:53:53 +01:00
patrick96
af5af1e497 Fix unused argument warning 2020-11-26 20:53:53 +01:00
patrick96
a30ac5f4a3 fix(actions): Separate data from action properly 2020-11-26 20:53:53 +01:00
patrick96
6618320947 actions: Use #name.action[.data] format
This looks a bit nicer than #name#action[.data]
2020-11-26 20:53:53 +01:00
patrick96
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
patrick96
8acedeef87 modules: Fix resolving of type of disabled modules 2020-11-26 20:53:53 +01:00
patrick96
002112df64 actions: Forward data of legacy actions
Some actions have data attached (e.g. xworkspaces-focus=N), the
forwarding logic now matches the keys in the legacy_actions map as
prefixes and everything afterwards is considered additional data and
appended to the new action string.
2020-11-26 20:53:53 +01:00
patrick96
a2b312cc84 actions: Add mapping for all legacy action names 2020-11-26 20:53:53 +01:00
patrick96
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
patrick96
816b73a95f actions: Add utility functions to produce action tags 2020-11-26 20:53:53 +01:00
patrick96
b2ba21c75d actions: Forward legacy actions to the right module
All the information about which action has to be delivered to which
module is kept in once place to make cleanup easier once the deprecated
actions are removed.

Right now only the date module is added as a proof of concept.
2020-11-26 20:53:53 +01:00