elparaguayo / qtile-extras Goto Github PK
View Code? Open in Web Editor NEWSomewhere to store things I create for qtile that probably won't end up in the official repo
License: MIT License
Somewhere to store things I create for qtile that probably won't end up in the official repo
License: MIT License
I finally had some minutes (of procrastination) to replace my qtile StatusNotifier with your upgraded version. Judging from the docs it appears to be relatively drop-in so I changed nothing in my config except replacing which module I loaded StatusNotifier
from. The only parameter passed to it is padding=20
anyway.
The widget shows icons as expected, performing the same function as the native widget correctly.
However, right-clicking to open menus fails, with this exception:
File "/home/mcol/git/qtile/libqtile/bar.py", line 487, in process_button_click
widget.button_press(
File "/home/mcol/git/qtile/libqtile/widget/statusnotifier.py", line 656, in button_press
self.mouse_callbacks[name]()
File "/home/mcol/git/qtile-extras/qtile_extras/widget/statusnotifier.py", line 160, in show_menu
self.selected_item.get_menu(callback=self.display_menu)
File "/home/mcol/git/qtile-extras/qtile_extras/widget/statusnotifier.py", line 57, in get_menu
if self.menu:
AttributeError: 'StatusNotifierItem' object has no attribute 'menu'
From a look at the widget's module it seems that attach_menu
is never getting a chance to run so self.menu
is never set on the item. Perhaps it is relevant that the widget was first created during a config reload, so the host
had already start earlier in the session. This happens on icons from both deluge and keepassxc (all of my icons).
Unrelated but left-clicking on keepassxc opens keepassxc as expected, but not deluge. This might be expected behaviour (I don't know if deluge supports opening via icon click) but this error gets logged, which could either be a bug or an unclear "this is unsupported by the icon" message:
2022-10-11 16:30:57,027 ERROR libqtile loop.py:_handle_exception():L63 'ProxyInterface' object has no attribute 'call_activate'
NoneType: None
Systray icons take the back pixmap from the widget but this causes issues when using the rect decoration. Instead, the icons should just take the fillcolour from the decoration.
Needs a flag to prevent this
git version of qtile and qtile-extra
qtile-extras-git r142.e522e59-1
qtile-git 0.20.0.r33.gc1f50739-2
The systray icons appears behind the rectdecoration or are invisible (between launchbar and clock)
With main bar transparency:
With no main bar transparency:
Current qtile config:
https://github.com/Crystal4276/qtile
NB: Thx for the updated launchbar, it looks great !
qtile-extra: r142.e522e59-1
There is a clear issue visible here:
And it seems related to the problem described here :
https://www.reddit.com/r/qtile/comments/xbd6oq/qtileextras_grouping_rectdecoration/
decor = {
"decorations": [
RectDecoration(
colour=colors[6],
line_width= 2,
radius=20,
filled=True,
padding_y=5,
padding_x=0,
group=True,
)
],
}
widget.LaunchBar(progs=[
('org.gnome.Terminal', 'gnome-terminal', 'Launch terminal'),
('chromium', 'chromium', 'Launch Chromium'),
('steam', 'steam', 'Launch Steam'),
('evolution', 'evolution', 'Launch Evolution'),
('discord', 'discord', 'Launch Discord'),
('spotify', 'spotify', 'Launch Spotify'),
],
padding = 15,
**decor
Video with the bug: https://youtu.be/jZkR-MZvbZE
I have two monitors, one horizontal, one vertical, when using StatusNotifier
I get menu in wrong place
notifier_defaults = dict(
menu_background=colours[0],
menu_font='FiraCode Nerd Font',
menu_fontsize=font_size,
menu_foreground=colours[7],
opacity=opacity,
separator_colour=colours[8],
highlight_colour=colours[12],
)
notifier = widget.StatusNotifier(**notifier_defaults)
If I use Mirror on notifier
widget, then one monitor have menu in correct place, but another not
If i define StatusNotifier
for each bar then on both monitors i have menu in wrong place
Tested on git version of qtile and qtile-extras
If use_mask is set to True, the icon disappears.
Playing with foreground color doesn't fix the issue.
widget.CurrentLayoutIcon(scale = 0.66, use_mask = True, foreground=colors[2]),
Hey again,
I set up arch with qtile and qtile-extras in a virtual machine, and I've found that the GithubNotifications widget crashes, with the token I generated in ~/.config/qtile-extras/github.token
. Here's the output of the log:
2022-07-01 16:36:59,088 ERROR libqtile bar.py:_configure_widget():L340 GithubNotifications widget crashed during _configure with error: FileNotFoundError(2, 'No such file or directory')
2022-07-01 16:38:17,633 WARNING libqtile lifecycle.py:_atexit():L33 Restarting Qtile with os.execv(...)
2022-07-01 16:38:18,110 ERROR libqtile bar.py:_configure_widget():L340 GithubNotifications widget crashed during _configure with error: FileNotFoundError(2, 'No such file or directory')
2022-07-01 16:41:07,269 WARNING libqtile lifecycle.py:_atexit():L33 Restarting Qtile with os.execv(...)
2022-07-01 16:41:07,725 ERROR libqtile bar.py:_configure_widget():L340 GithubNotifications widget crashed during _configure with error: FileNotFoundError(2, 'No such file or directory')
2022-07-01 16:46:26,295 ERROR libqtile bar.py:_configure_widget():L340 GithubNotifications widget crashed during _configure with error: FileNotFoundError(2, 'No such file or directory')
I had installed the requests module with pacman and qtile-extras with yay, and I imported the requests module as well. Any suggestions for how to fix this?
Sorry again for all the issues!
when reloading the config, the internal async callbacks are being called multiple times (from previous config and from the new reload).
While this has no impact on functionality it essentially has a "leak" which is not desired.
Further overriding the update function to notify-send will get trigged multiple times then :P
whenever i restart qtile while cava is running wm just crash and i fell onto sddm my login manager
When I leave the visualizer enabled in my config, after a few hours my computer is highly unresponsive and htop shows qtile pegging 100% utilization. It goes away when I reload, but always comes back after a few hours. I think this might be related to some of my other performance-related tickets I have filed here or on the main repo. Disabling visualizer makes the problem go away.
If initial_focus
is set to None
and keyboard_navigation
is True
then keyboard_navigation
is never set to False
when there are no focusable controls. This can cause the popup to crash.
Must be possible to make a decoration that replicates the powerline effect but without the need to use text widgets in between every widget...
I think the GlobalMenu is amazing, frankly I don't understand why its not part of Qtile proper, since it makes such a massive difference in look and feel for the window management, anyway thats besides the point.
Today if you have Global Menu in your bar, and you have have a program active, that exports its menu out via dbus, the menu items show up in the bar where you placed the widget. All good.
I propose as a non-default option, called "collapsed root" (no idea what to call this), when it is enabled in the Global Menu, instead of showing the menu items directly in the bar, it shows the name of the Active application. When you press the name of the application, the items that would previously be shown in the bar horizontally (File , Edit , etc) show up vertically after pressing the application name in the bar.
Keyboard navigation shortcuts (to activate and navigate the menu might be easier too that way), although keyboard navigation shortcuts would be handy as a feature for both the current way of displaying a global menu, and this alternative way to show it.
Keep up the excellent work, ive been meaning to see if can help figure out why things like Inkscape, Gimp, Firefox and Thunderbird dont work with the global menu (i suppose they either dont use dbus, or they export via dbus in a weird way), but life keeps happening so.
As the title says, the context menu of the StatusNotifier widget no longer works.Before it worked in wayland (in X11 it still works)
I would like to show a popup only on the focused monitor, but by default it shows up on the main monitor, which, as it is still related to my group-popup-when-changing-group issue on qtile
, it does not make sense to have all these popups on an unfocused monitor 🤔
this is what i have right now
def text_popup(qtile, text, size=150):
"""
Opens a popup with a single string of text.
"""
controls = [
PopupText(
font=FONT,
fontsize=size,
text=text,
# other options
),
]
layout = PopupGridLayout(
qtile,
# other options
)
# isolate screen and group on that screen, e.g. group dev on screen 1
# this works fine
s = qtile.current_screen.index
g = qtile.screens[s].group.name
# show the layout, but only on main monitor (0) by default
layout.show(centered=True)
qtile.call_later(.5, layout.kill) # kill popup after 1 second
maybe add something like qtile.<window>.togroup(g)
it seems the layout.show
does not give the window id, nor its name, i have also seen the qtile.windows_map
field that list all window ids, but i do not know how to access the right popup window name or id...
Would allow users to specify the colour of icons.
widget ALSA WIDGET crashes when Icon mode and both is added
icon.
Message: Widget crashed: ALSAWidget (click to hide)
The bar opcion works fine
Whenever I try to use GlobalMenu, I don't get any response when reloading config. The module is correctly imported since I'm using ALSAWidget as well and it works fine. The logs only show a configuration error, but my configuration of that widget is only GlobalMenu(),
.
I use qtile cmd-obj -o cmd -f reload_config
but it doesn´t show any output.
logs: https://dpaste.com/67YXMXXZW
qtile check log: https://dpaste.com/HJBHSC7L3
When I execute de config.py as a Python program it shows the following output:
❯ python .config/qtile/config.py | wgetpaste Traceback (most recent call last): File "/home/javigo07/.config/qtile/config.py", line 1, in <module> from modules import * File "/home/javigo07/.config/qtile/modules/__init__.py", line 4, in <module> from modules.screens import screens, layouts, floating_layout File "/home/javigo07/.config/qtile/modules/screens.py", line 94, in <module> widget.GlobalMenu(), File "/usr/lib/python3.10/site-packages/qtile_extras/widget/__init__.py", line 104, in __getattr__ raise AttributeError AttributeError
Following the path, it shows me this section of code:
102 def __getattr__(name): 103 if name not in registry: 104 raise AttributeError 105 106 if name in widgets: 107 package = "qtile_extras.widget" 108 else: 109 package = "libqtile.widget" 110 111 module_path = f"{package}.{registry[name]}" 112 113 return import_class(module_path, name, fallback=fallback)
Bizarrely, I've just noticed that using this setting gives the opposite intended behaviour on Wayland: the decoration is filled with the bar background colour and any space outside the decoration uses the widget background colour.
No idea why it works on x11 and not wayland!
Whenever I make a Popup that has focusable widgets, it will disappear whenever I move my mouse off of the popup. It will also disappear if a new window appears. This never happens if no controls can be focused.
This is the code I have used to define my Popup:
def startPopups(qtile):
global PopupLayout
PopupLayout = PopupRelativeLayout(qtile, width=1000, height=200, controls=[
PopupWidget(
widget=widget.CPUGraph(),
width=0.45,
height=0.45,
pos_x=0.05,
pos_y=0.05,
highlight_method='border'
),
PopupWidget(
widget=widget.MemoryGraph(),
width=0.9,
height=0.45,
pos_x=0.05,
pos_y=0.5,
),
], background="00000060", inital_focus=None, close_on_click=False)
@lazy.function
def show_graphs(qtile):
startPopups(qtile)
PopupLayout.show(centered=True)
@lazy.function
def hide_graphs(qtile):
PopupLayout.hide()
This Popup will stay.
However, If I add a mouse callback, like so:
def startPopups(qtile):
global PopupLayout
PopupLayout = PopupRelativeLayout(qtile, width=1000, height=200, controls=[
PopupWidget(
widget=widget.CPUGraph(),
width=0.45,
height=0.45,
pos_x=0.05,
pos_y=0.05,
highlight_method='border'
),
PopupWidget(
widget=widget.MemoryGraph(),
width=0.9,
height=0.45,
pos_x=0.05,
pos_y=0.5,
mouse_callbacks={"Button1": hide_graphs()}
),
], background="00000060", inital_focus=None, close_on_click=False)
@lazy.function
def show_graphs(qtile):
startPopups(qtile)
PopupLayout.show(centered=True)
@lazy.function
def hide_graphs(qtile):
PopupLayout.hide()
This will disappear if I move the mouse off of the Popup, or if a new window appears.
I have noticed while writing this, that the Popup also disappears if the focus of the windows is changed, which if I have the follow_mouse_focus property set as true, in the qtile config, would explain why the popup disappears when my mouse moves off of the Popup. It would also explain why if a new window appears why the popup will also disappear.
Again none of this happens if the popup has no focusable controls.
Hi me again, is there a way to set a font color in the ALSA widget? i have already tried foreground but to no effect, the font is always white.
Thanks again.
This widget from qtile extra does not resize the icon when using the size=x option.
It does not crash qtile
2022-10-04 14:58:55,224 ERROR libqtile loop.py:_handle_exception():L63 list index out of range
Traceback (most recent call last):
File "/usr/lib/python3.10/asyncio/events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "/usr/lib/python3.10/site-packages/libqtile/core/manager.py", line 862, in f
func(*args)
File "/usr/lib/python3.10/site-packages/libqtile/widget/base.py", line 580, in draw
self.drawer.clear(self.background or self.bar.background)
File "/home/ervin/.config/qtile-x11/qtile_extras/widget/decorations.py", line 706, in new_clear
self._clear(colour)
File "/home/ervin/.config/qtile-x11/qtile_extras/widget/decorations.py", line 282, in draw
if self.is_first:
File "/home/ervin/.config/qtile-x11/qtile_extras/widget/decorations.py", line 255, in is_first
grouped = self._get_parent_group()
File "/home/ervin/.config/qtile-x11/qtile_extras/widget/decorations.py", line 218, in _get_parent_group
current = [grouped[0]]
IndexError: list index out of range
This is repeated twice consecutively.
Having investigated just a bit, the widgets seem to be initialized correctly( i.e. widgets
in _get_parent_group
is not None on reload). This is weird.
Tried removing widgets
in _get_grouped_widgets
and passing it as a parameter but that did nothing.
This is a minor issue, good luck on 2727 and on fixing the test suite :)
LE: Oops, didn't know it would reference it there :)
Can cause system to become non-responsive.
Hi,
This is not an error but could provide an example on how to use the TooltipMixin.
Thanks.
widget.StatusNotifier(icon_size=40, icon_theme="oomox-Catppuccin_Mid_Dark"),
In my autostart.sh, i have those apps:
nm-applet &
blueberry-tray &
volumeicon &
deluge &
discord &
Only discord app is shown by widget.StatusNotifier
Those app properly appear when using widget.Systray
From reddit:
Global menu widget is interesting and reminds me back when I was using Unity desktop on Ubuntu. I always loved the global menu, but in Qtile it is even more useful. Now the first thing I noticed is that, that the menu is not drawn when an application with such a menu has focus and Qtile is reloaded. I have to unfocus and focus back to make the menu appear again (after a reload).
Hi, playing around with the popuptoolkit.
As far as i know, you can only center the window with center=True as a parameter to layout.show
It would be cool to specify also the postition when not centering, I imagine something like this:
layout.show(x=100px,y=500px)
or
layout.show(x=5%,y=10%)
Thanks :)
Adapt this into a widget: https://github.com/ray-pH/polybar-cava
Hi, thank you for the PowerLineDecoration! I love it!
I'd like to report two visual anomalies that are visible on my setup:
Used background definitions from left to right:
background="88888888",
background="aaaaaa88",
background="88888888",
background="aaaaaa88",
Is not a bug, but i have a question. How import qtile-extras to config.py? Nice Work!!
Hi,
I was trying to add qtile-extras
to a custom Arch ISO, that I am making, by creating a custom local repository. While doing this I tried to build qtile-extras
in clean chroot
, and the build failed due to these missing dependencies: "git" "python-setuptools" "python-wheel" "python-pip"
. So, I thought that I should let you know. Let me know if I should open a pull request, or if you think it's just a minor change, you can do it yourself.
Thanks
Can cause system to become non-responsive.
I'm on Arch and I have the qtile-extras-git package installed. I tried:
from qtile_extras import widget as ewidget
ewidget.StatusNotifier(
highlight_colour=dviolet,
menu_foreground = gray,
#menu_background = dgray,
menu_font = widget_defaults['font'],
menu_fontsize = widget_defaults['fontsize'],
menu_row_height = 11,
icon_size=18,
padding=5,
),
The menu popup doesn't draw when I click on the icon.
What I wanted to do
I wanted to add a widget in my qtile
bar, next to the networking ones, to display the IP address of my machine.
The problem I encountered
However, I did not find any such widget in neither the code base of qtile
nor the code base of qtile-extras
... I looked at the Net
and Wlan
widgets, but did not find any format option called ip
: there are interface
, up
, down
and total
in the Net
widget, and essid
, quality
and percent
in the Wlan
widget.
Am I missing the widget, does it exist in the first place? 😮
Enhancement
If it does not, would you be okey to add one to the repo? Most likely in qtile-extras
, I think.
I would be more than happy to help you in a PR if you accept others to contribute 😉
First draft
import subprocess
from libqtile import widget
class IP(widget.base.ThreadPoolText):
"""A simple widget to display the IP address of the system."""
defaults = [
("update_interval", 3600, "Update interval for the IP widget"),
(
"format", "IP {address}", "IP address display format",
),
]
def __init__(self, **config):
super().__init__("", **config)
self.add_defaults(IP.defaults)
def poll(self):
variables = dict()
address = subprocess.check_output(["dig", "+short", "myip.opendns.com", "@resolver1.opendns.com"])
variables["address"] = str(address).strip()
return self.format.format(**variables)
according to this article. There are many ways to get one's public IP address on a linux machine, dig
appears to be quite common.
I am not sure about the exact formating you want there, this can be adapted of course, and any detail should be discussed 😋
Hi.
I like this repository a lot, and I am willing to help with this feature request.
I would like to add a color option for the border when the battery is full.
However, I am not sure how to test those changes in my live qtile session and thus I am not sure how to make sure the changes take effect.
If this idea sounds good, would you mind describing or linking to a description on how to change and test this lib?
I was going to experiment with popups but found that I couldn't create any.
Looking through the logs I found that it crashed on line 107 of qtile_extras/popup/toolkit, doing something with the keyboard mapping.
It seems the error here is the call to key.lower()
, which turns the valid key 'Left'
into an invalid key 'left'
(I confirmed in a Python shell that my libqtile.backend.x11.xkeysyms.keysyms
does not contain 'left'
).
To solve the issue I monkeypatched _PopupLayout.defaults
to set 'keymap'
to an empty dict, which allowed the class to be created.
Could anyone confirm this?
When manipulating the volume, this does not respect the window decorations.
Hi, I am using your WiFi Widget, I added a mousecallback for button3, but nothing happens when I click it.
Expanding it with Button 1 works.
Nothing in the logs exept:
2022-09-08 09:52:54,405 DEBUG libqtile core.py:_xpoll():L301 X11 event: ButtonPress (targets: 2)
2022-09-08 09:52:54,539 DEBUG libqtile core.py:_xpoll():L301 X11 event: ButtonRelease (targets: 2)
2022-09-08 09:52:55,735 DEBUG libqtile core.py:_xpoll():L301 X11 event: ButtonPress (targets: 2)
2022-09-08 09:52:55,869 DEBUG libqtile core.py:_xpoll():L301 X11 event: ButtonRelease (targets: 2)
Here is the relevant config:
def open_wifi():
qtile.cmd_spawn("iwgtk")
...
w_wlan = (
widget.WiFiIcon(
active_colour=colors[11],
inactive_colour=colors[16],
background=colors[12],
foreground=colors[11],
font="JetBrainsMono Nerd Font",
# disconnected_message="",
fontsize=12,
interface="wlan0",
update_interval=5,
mouse_callbacks={"Button3": open_wifi},
padding=8,
decorations=_left_decor(colors[19]),
),
separator(),
)
i'd like upowerwidget to have a different fill colour when its being charged, and from the docs, ive seen that i can only change the border colour for the charging state. would it be possible to add a fill_charge that acts similar to fill_critical, fill_low and fill_normal
So i've been using the global_menu branch of yours for a while, but after noticing its now merged into main, i gave main a go.
The only problem was the menu no longer registers mouse clicks.
The only real difference I could see in code between my global_menu branch checkout, and main, was a tiny addition added to toolkit.py line 107
In main the code is like this:
self.keys = {k: [keysyms[key.lower()] for key in v] for k, v in self.keymap.items()}
but in the checkout
self.keys = {k: [keysyms[key] for key in v] for k, v in self.keymap.items()}
i tried to remove the .lower call in main, and the menu started working again with mouseclicks.
So might be some scenarios where key.lower() fails, or something like that?
I got the following error in the logs after adding the visualizer widget. I have not played any music yet:
2022-09-30 14:33:49,877 ERROR libqtile loop.py:_handle_exception():L63 Got a 8000 bytes buffer, needs at least 9200.
Traceback (most recent call last):
File "/usr/lib/python3.10/asyncio/events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "/usr/lib/python3.10/site-packages/libqtile/core/manager.py", line 862, in f
func(*args)
File "/usr/lib/python3.10/site-packages/libqtile/bar.py", line 616, in _actual_draw
i.draw()
File "/usr/lib/python3.10/site-packages/qtile_extras/widget/visualiser.py", line 209, in draw
self._draw()
File "/usr/lib/python3.10/site-packages/qtile_extras/widget/visualiser.py", line 213, in _draw
surface = cairocffi.ImageSurface.create_for_data(
File "/usr/lib/python3.10/site-packages/cairocffi/surfaces.py", line 743, in create_for_data
return cls(format, width, height, data, stride)
File "/usr/lib/python3.10/site-packages/cairocffi/surfaces.py", line 730, in __init__
raise ValueError('Got a %d bytes buffer, needs at least %d.'
ValueError: Got a 8000 bytes buffer, needs at least 9200.
Tried to use some widget from this repo, but form some reason popup part don't install when using python setup.py install
or pip install git+https://github.com/elParaguayo/qtile-extras
Hey there,
Thanks for creating this package; I've enjoyed being able to use it in my personal config.
I've been getting ready to switch to NixOS but haven't been able to install this properly unless I completely rebuild qtile with the package. Would it be possible for you to package this for Nix and NixOS?
awesome work , thanks for this great stuff
i have some questions
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.