t-wissmann / barpyrus Goto Github PK
View Code? Open in Web Editor NEWA python wrapper for lemonbar
License: Other
A python wrapper for lemonbar
License: Other
I cannot get siji symbols to display properly in the bar. All I get are small squares of color where the symbols should be:
The font appears to be installed correctly when I check fc-list and xlsfonts. And I am using the example gruvbox_config.py from the share folder. These are, essentially, the only lines of the code that I've changed so far:
# Widget configuration:
# font = '-*-fixed-medium-*-*-*-15-*-*-*-*-*-iso10646-1'
font = '-*-fixed-medium-*-*-*-13-*-*-*-*-*-iso8859-1'
symbol_font = '-wuncon-siji-medium-r-normal-*-10-100-75-75-c-80-iso10646-1'
bar = lemonbar.Lemonbar(
geometry=(x, y, width, height),
font=font,
symbol_font=symbol_font,
)
Any ideas would be appreciated, thanks!
For the purpose of saving some screen real estate and keep distractions away, I really like the default bar in i3wm, which is like a float frame and only show on mod key down with this setting:
bar {
mode hide
hidden_state hide
modifier $mod
workspace_buttons yes
}
The bar disappear when mod key is released. It is ideal for laptop with small screens.
I just got this when doing hc wmexec
:
Traceback (most recent call last):
File "/usr/bin/barpyrus", line 33, in <module>
sys.exit(load_entry_point('barpyrus==0.0.0', 'console_scripts', 'barpyrus')())
File "/usr/lib/python3.8/site-packages/barpyrus/mainloop.py", line 47, in main
main_loop(bar)
File "/usr/lib/python3.8/site-packages/barpyrus/mainloop.py", line 95, in main_loop
x.process()
File "/usr/lib/python3.8/site-packages/barpyrus/core.py", line 50, in process
for line in self.readlines():
TypeError: 'NoneType' object is not iterable
This seems to happen because:
Lines 38 to 42 in 73e094e
but the None
return value isn't actually handled:
Lines 49 to 51 in 73e094e
Not sure what the proper fix would be though - should it return []
instead?
It is a great bar for herbstluftwm.
I would like to ask you if it is possible to add clickable areas on conky items.
The custom color theme function does not seem to affect HLWMTags like it does the other elements.
gold = Theme(bg = '#ee121212', fg = '#ceaf51', padding = (3,3))
# Widget configuration:
bar = lemonbar.Lemonbar(geometry = (x,y,width,height))
bar.widget = W.ListLayout([
W.RawLabel('%{l}'),
gold(hlwm.HLWMTags(hc, monitor)),
W.RawLabel('%{c}'),
gold(hlwm.HLWMWindowTitle(hc)),
W.RawLabel('%{r}'),
gold(W.DateTime('%B %d, %H:%M |')),
])
How can the tag colors be changed?
I have three screens:
With that, I'm trying to set up xrandr so that I have my laptop screen, and the portable screen on the left of it, mirroring what people see on the projector. Thus, I run:
xrandr --output DisplayPort-0 --left-of eDP --auto
xrandr --output HDMI-A-0 --same-as DisplayPort-0 --auto
hc detect_monitors
which leads to xrandr reporting:
eDP connected primary 1920x1080+1920+0
HDMI-A-0 connected 1920x1080+0+0
DisplayPort-0 connected 1920x1080+0+0
and hc list_monitors
saying:
0: 1920x1080+1920+0 with tag "2" [FOCUS]
1: 1920x1080+0+0 with tag "1"
however, I can't get barpyrus to show up on my laptop screen anymore: When I run either barpyrus 0
or barpyrus 1
, the panel shows up on the left USB-C screen (probably picking DisplayPort and HDMI?). When I do barpyrus 2
, I get:
monitor_rect: Cannot parse argument "2": No such monitor: 2
Traceback (most recent call last):
File "/usr/bin/barpyrus", line 33, in <module>
sys.exit(load_entry_point('barpyrus==0.0.0', 'console_scripts', 'barpyrus')())
File "/usr/lib/python3.10/site-packages/barpyrus/mainloop.py", line 45, in main
conf = get_user_config()
File "/usr/lib/python3.10/site-packages/barpyrus/mainloop.py", line 39, in get_user_config
return get_config(user_config_path())
File "/usr/lib/python3.10/site-packages/barpyrus/mainloop.py", line 24, in get_config
exec(code, global_vars)
File "/home/florian/.config/barpyrus/config.py", line 309, in <module>
bar = main()
File "/home/florian/.config/barpyrus/config.py", line 261, in main
x, y, monitor_w, _monitor_h = hc.monitor_rect(monitor)
File "/usr/lib/python3.10/site-packages/barpyrus/hlwm.py", line 60, in monitor_rect
x = int(geometry[0])
ValueError: invalid literal for int() with base 10: ''
With:
from barpyrus import lemonbar, conky
cg = conky.ConkyGenerator(lemonbar.textpainter())
cg.space(50)
I get:
Traceback (most recent call last):
File "/home/florian/proj/barpyrus/barpyrus.py", line 7, in <module>
sys.exit(barpyrus.mainloop.main())
File "/home/florian/proj/barpyrus/barpyrus/mainloop.py", line 45, in main
conf = get_user_config()
File "/home/florian/proj/barpyrus/barpyrus/mainloop.py", line 39, in get_user_config
return get_config(user_config_path())
File "/home/florian/proj/barpyrus/barpyrus/mainloop.py", line 24, in get_config
exec(code, global_vars)
File "/home/florian/tmp/barp.py", line 4, in <module>
cg.space(50)
File "/home/florian/proj/barpyrus/barpyrus/lemonbar.py", line 103, in space
factor = self.lemonbar.spacing_font_width
File "/home/florian/proj/barpyrus/barpyrus/conky.py", line 208, in __getattr__
return self._painter.__getattribute__(name)
AttributeError: 'LBPainter' object has no attribute 'spacing_font_width'
which is a regression introduced in f330534 ("More spacing options").
I just tried this bar with herbstluftwm and works really nice :) I've did some small tweaks and added something to display the volume status. However, it only updates quite rarely. How can I control the refresh-rate, or ideally can it be configured to refresh when for example a certain key is pressed or headphones are plugged in?
Thanks in advance!
PS, here's my battery status, I added the following to the start of conky_text
:
conky_text = '%{F\\#9fbc00}%{T2}'
conky_text += '${if_match \"${exec getvolume}\" == \"off\"}\ue202$else\ue203$endif'
conky_text += '%{T-}%{F\\#989898}${exec getvolume} '
where getvolume
is a script I have to retrieve the volume from amixer
. Can I use the output of getvolume
in a variable to not have to call it twice? For example, where does the $battery
variable come from?
After an update on Arch Linux, and a subsequent re-install of barpyrus, barpyrus does not start anymore:
$ barpyrus
Traceback (most recent call last):
File "/usr/bin/barpyrus", line 33, in <module>
sys.exit(load_entry_point('barpyrus==0.0.0', 'console_scripts', 'barpyrus')())
File "/usr/bin/barpyrus", line 25, in importlib_load_entry_point
return next(matches).load()
File "/usr/lib/python3.9/importlib/metadata.py", line 77, in load
module = import_module(match.group('module'))
File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'barpyrus'
Any help would be appreciated!
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.