Commit Graph

4551 Commits (master)

Author SHA1 Message Date
Max Cohen c464a3f46e Add install doc 2022-07-11 14:20:50 +00:00
Max Cohen a6279e7f9f Update colors for catppuccin theme 2022-07-10 12:12:57 +02:00
Max Cohen e326ca25f6 Add psutils required for widgets 2022-03-24 17:53:02 +01:00
Max Cohen c8099b0f7d Swap up and down network widget 2022-03-24 17:51:57 +01:00
Max Cohen ee1fcf7d2d Default to Max layout 2022-03-24 17:51:44 +01:00
Max Cohen 05d49561e1 Merge branch 'qtile-master' 2021-12-23 15:49:32 +01:00
Max Cohen f6c9637651 Merge branch 'master' of https://github.com/qtile/qtile into qtile-master 2021-12-23 15:48:59 +01:00
Max Cohen 06117d3f2c Add keybinds for previous/next group 2021-12-23 15:36:32 +01:00
Tim Kilian a56eb1158d
Add place_right option to place the tab panel on the right side (#3127)
* Add place_right option to place the tab panel on the right side

* Update CHANGELOG
2021-12-23 02:03:45 +00:00
mcol b2467d5b05 Pin mypy to 0.930 in mypy tox env
This pins mypy to their current release, 0.930. Downstream users such as
packagers running `tox` for tests will now definitely pass for as long
as our own CI passed on master. We'll have to bump our mypy version when
there are releases, though no harm done if we miss some releases.
2021-12-22 20:01:19 +00:00
elParaguayo cde46d3bf8 Fix Imap widget
`poll()` method was modifying `self.text` in place before returning the
value. However, `self.text` is a property setter which sets the layout
text. The widget should only update the text value by returning the
value from `poll()`.
2021-12-22 17:29:56 +00:00
mcol ce94e6cfd3
v0.19.0 2021-12-22 15:13:17 +00:00
mcol 9e8f9b7d8d WL: Fix unfocussable static windows
There is a bug where focussing static windows fails because
`win.ftm_handle` for the static window is accessed in
`Core.focus_window` but this attribute doesn't exist on static windows.
This change sets the attribute on static windows and uses it to enable
close requests via the protocol. Other requests don't make sense for
static windows (i.e.  maximise, minimise etc) so are not listened for.
2021-12-21 12:47:05 +00:00
Arnas Udovič fa732aafb5
Add ability to update Image widget.
* fix #3094

* draw by bar if length is different

* updated CHANGELOG
2021-12-21 07:26:05 +00:00
mcol 4947b639a2 WL: ensure Drawers use Internal's current texture
Wayland backend internal windows use a fixed-size buffer that gets
replaced when the window is resized. Drawers are saving the window's
texture upon creation but are not using new buffers when the window
creates a new one. Instead, this makes Drawers always get the buffer
from the window so that it's always drawing to the correct buffer.

This fixes the TreeTab panel which appears to be broken under Wayland.
It will also be causing problems where internal window resizing is
required.
2021-12-20 20:50:36 +00:00
jwijenbergh 9f912fae3d Add focused window Match to lazy function's .when() check 2021-12-20 20:40:42 +00:00
elParaguayo 8bc192870c Add OpenWeather widget test 2021-12-20 20:31:59 +00:00
mcol 2ee1b94b35 Exclude some valid non-pep8 files from pep8 tox test
These files are (only now?) triggering a failure.
2021-12-18 16:30:29 +00:00
mcol 75bb86bc6d Remove old travis env vars from tox; add wayland display 2021-12-18 16:30:29 +00:00
mcol 6e0f5b9fe2 Remove '-W error' from py310 tox test
Otherwise it fails due to a warning emitted by pygoobject: https://gitlab.gnome.org/GNOME/pygobject/-/issues/476
2021-12-18 16:30:29 +00:00
mcol 9253b96a33 Add Python 3.10 tox env
This adds Python 3.10 to tox and github actions, and runs the non-test
tox envs (mypy, lint etc) with Python 3.10.

This change only adds the new env, and does not remove py37. For the
time being it might be worth supporting py37 while we can, along with
pypy which is only compatible with python 3.7.
2021-12-18 16:30:29 +00:00
elParaguayo bd21d0744e Fix max_chars in TextBox widget
max_chars was only being applied on a subsequent change of
text. This change allows max_chars to be applied to the initial
text set in the widget.
2021-12-18 16:31:55 +03:00
elParaguayo 8370dab3b9 Revert "Make keybinding swallow configurable"
This reverts commit 4c0988c2e1.

Fixes #3092
2021-12-18 12:10:14 +03:00
elParaguayo 198c25fee0 Fix mypy errors
A couple of mypy failures have cropped up recently. This addresses
both:
1) CommandObject.command can return None rather than Callable
2) alpha value in rgb gives a tuple of (int, int, int, float)
2021-12-17 18:57:18 +00:00
elParaguayo 18af6f3197 Replace os.system with cmd_spawn in CommandSet 2021-12-14 17:39:33 +00:00
elParaguayo 31ddcbec04 Fix Dmenu extension colour handling
Colours being set before `extension_defaults` had been applied.

Fixes #3093
2021-12-14 17:39:33 +00:00
Stefan Richter 3fe5e0d19e docs: Fix imports of autostart hook example 2021-12-12 01:31:36 +03:00
aurok 5cfad781ab fix(layouts): Fix deletion of TreeTab Sections
- Instead of always deleting the first section, the targeted section is deleted
- Targeted section is also deleted from Root.sections so another section with the same name can be added
2021-12-10 21:00:02 +03:00
mcol a708c8cd7c Tests: reduce duplicated code by adding FakeBar utility class
Many of the widget tests instantiate a `Bar` and override some
attributes and methods. Let's move that highly duplicate code into a
function to make things neater.
2021-12-09 17:36:49 +00:00
mcol f6bc955ee7 Split space equally between consecutive stretch widgest
Currently widgets are grouped into blocks by splitting the list of
widgets on stretch widgets, and the position of each of these blocks on
the bar is centred such that the the blocks are distributed equally
across the bar.

If you have 2 consecutive stretch widgets configured, this can cause
expected effects where between them you have an empty block containing 0
widgets. This is amongst the blocks distributed equally, which can make
other blocks appear shifted and is confusing. Consider:

```py
widgets = [Left(), WindowName(), Spacer(), Centred(), Spacer(), Right()]
```

Here one might expect the `Centred()` widget to be centred but it will
not, because `WindowName` is a stretch widget, there are actually four
blocks, where the second between `WindowName` and `Spacer` is empty.
This puts `Centred` at 2/3 rather tahn 1/2 across the bar.

This is hard to track down between `Spacer` is invisible and looks like
part of `WindowName`, and the boundary is unclear causing issues with
mouse clicks going to the wrong widget.

This commit makes any number of consecutive stretch widgets be
considered together for the positioning of these blocks and makes them
split the space betwee blocks amongst them. In the example above this
means that positioning is calculated is if there was no first `Spacer`,
and then after that is done, it gets half of `WindowName`s length and
`WindowName` gets only half, correctly centreing `Centred` as would be
expected.

While the obvious question is "what if a user wants two adjacent stretch
widgets", the rationale for implementing this solution (and forcing such
users to stick a 0-width widget between those adjacent stretch widgets)
is that there isn't really a use-case for doing so - how would you
distribute space among them?

Fixes #2487.
2021-12-09 17:36:49 +00:00
mcol bb7a1e2633 Don't trigger config error with assert
This is uninformative for the user and it's bad practice to user
assertions for runtime flow control. Users may have runtime assertions
disabled e.g. by running with `python -O`.
2021-12-09 17:36:49 +00:00
mcol 8d89216a1b Check widget orientation in _Widget._configure
This lets Qtile start up with the rest of the config even if a widget
fails this test, as it is caught in the `_configure` handling in
`Bar`. The issue with nosetests is no longer an issue as nosetests is no
longer used.
2021-12-09 17:36:49 +00:00
elParaguayo 9bc23adcba increase layout test coverage 2021-12-09 13:31:28 +00:00
elParaguayo 236e75cb2b Add extension tests 2021-12-09 13:31:28 +00:00
elParaguayo 81fed96783 Add tests for deprecated command_ modules 2021-12-09 13:31:28 +00:00
elParaguayo 57f20289f9 Add test for CPU widget 2021-12-09 13:29:10 +00:00
elParaguayo f5568fa84e Add coveralls to CI
This PR submits test results to coveralls.io.

Fixes #2054
2021-12-08 21:45:45 +00:00
elParaguayo f81de0b41b Allow TextBoxes in vertical bars
This PR enables TextBox widgets (and widgets that inherit
from this class) to be displayed in vertical bars.

Text on the left hand bar will read from bottom to top while
text on the right hand bar will read from top to bottom.
2021-12-08 15:57:33 +00:00
Ilyas B Arinov 9c583ed163
Thermal zone (#3061)
* Thermal zone monitoring for modern linux kernels.

* Widget description

* Thermal zone widget unit test

* Error handling

* Error handling and logging

* Using full thermal zone path as default zone value.

* Unit test update

* Remove unneeded print command

* Custumization over the output.

* Empty trailing lines removed

* Zone file path overhead removed

* Thermal zone widget trailing line removed

* Pep8 codestyle

* Colors

* Simplied condition statements, exact crit value covered

* Functionally to hide the widget for non-critical values

* Changelog formatting fixed

* Docstring

* Separate format for critical values

* Optimizing try/except code

* Using FakeLayout class to set the self.layout.colour and pass the test.

* isort

* Gap between imports

Co-authored-by: Ilyas Arinov <ilyas.arinov@aitudala.kz>
2021-12-08 12:54:29 +00:00
elParaguayo a50877a150 Fix StatusNotifier reconfigure bug
StatusNotifier._configure returns immediately if the widget is
configured, but this stops a new drawer object being created.

This, in turn, creates issues in `qtile-extras` when injecting
decoration code.

See: https://github.com/elParaguayo/qtile-extras/issues/12
2021-12-08 00:04:00 +03:00
elParaguayo 1d70bfd08c Add ability for multiple timers in widgets
`timeout_add` will now return a handle to the timer so that they
can be cancelled individually. Timers are added to a list and
all scheduled timers in the list will be cancelled when `finalize`
is called.

Closes #3042
2021-12-07 19:14:02 +03:00
1kyu e71cd3c6c8
docs: Fix autostart hook example (#3049)
docs: Fix autostart hook example
2021-12-07 19:08:16 +03:00
elParaguayo 577fd89114 Fix double parsing of 'fmt' in Pomodoro widget
By using a variable called 'fmt' which is also used by
`base._TextBox`, the string formatting happense twice.
This can be fixed by removing the formatting within
Pomodoro and just letting the base class handle it.

Closes #3070
2021-12-07 19:05:58 +03:00
elParaguayo ca1921ab7b Add os.path.expanduser to utils.scan_files
images.Loader uses utils.scan_files to locate files in folders.
If users have a theme_path including "~" then scan_files will not
convert this to the correct path and the Loader will fail.
See
https://github.com/elParaguayo/qtile-extras/issues/12#issuecomment-987137291
for an example.
2021-12-07 18:28:29 +03:00
elParaguayo 4167bd3eea Add mpd2 widget test 2021-12-05 21:08:25 +00:00
Tokariew 62c2e76a89 fix issue #2871 2021-12-05 21:08:25 +00:00
jwijenbergh 4c0988c2e1 Make keybinding swallow configurable
Click, Drag, Key and KeyChord now get another argument: a swallow boolean.

Possibly options:
- True: Execute the command of the (mouse) key binding and do not pass the key
to the focused window
- False: Execute the command of the (mouse) key binding and pass the key to
the focused window

Fixes #324 and implements the feature request in #2587

Co-authored-by: m-col <mcol@posteo.net>
2021-12-06 00:06:22 +03:00
mcol 47ded88357 Add FAQ section on sticking groups to screens
This is a frequently asked question so fits perfectly 😄

The implementations here are minimal but can serve as a starting points
if users want more specific behaviour (e.g. if you want to use
`toscreen(toggle=True)` then it does get a bit more complicated.)

Similarly this demonstrates some of what users can customise so if they
want to write a binding that scrolls between groups bound to a screen
they have a starting point of how to go about doing that.
2021-12-05 21:23:09 +03:00
mcol b19b3596c1 WL: support foreign toplevel management protocol
This adds supports for the wlr_foreign_toplevel_management_v1 protocol.
This provides an interface through which clients such as status bars and
other WM utilities can control windows belonging to regular clients.
This provides similar functionality as seen in X via e.g. xdotool,
wmctrl to manipulate windows in some ways.

Requires pywlroots 0.14.10
2021-12-05 09:49:18 +00:00
elParaguayo d830fbbe16 Testing StatusNotifier widget
Adds two basic tests for the StatusNotifier widget:
1) Check that icon is added and removed from widget
2) Check that left-clicking the widget triggers the
   item's "Activate" method.

There's probably more parts of the widget that should
be tested but this is a good start.
2021-12-04 21:57:49 +03:00