da-rth / yasb Goto Github PK
View Code? Open in Web Editor NEWA highly configurable cross-platform (Windows) status bar written in Python.
License: MIT License
A highly configurable cross-platform (Windows) status bar written in Python.
License: MIT License
Hey! Love the project, Everything seems super cool, but I am not able to get komorebi
support working out of the box. The error that led to the problem was:
Failed to subscribe komorebi to named pipe: error: Found argument 'subscribe' which wasn't expected, or isn't valid in this context
my komorebi
folder is in the PATH
so I normally just run komorebic start
from powershell
When komorebi is launched as admin, yasb fails to detect it whether yasb is admin or not.
Following the installation section in Wiki to setup, but can not start src/main.py
.
When running python src\main.py
, the programs should start.
Traceback (most recent call last):
File "C:\Users\...\yasb\src\main.py", line 2, in <module>
from PyQt6.QtWidgets import QApplication
ImportError: DLL load failed while importing QtGui: The specified procedure could not be found.
pip install --upgrade PyQt6
pip install -r requirements.txt
python src\main.py
System is a newly installed Windows 11. Tried both Conda and native Python 3.9 but none works.
The application should continue to run as normal after adding/removing a status bar when a display is connected / disconnected.
The application will crash with the following exit code and no log/traceback:
Process finished with exit code -1073740771 (0xC000041D)
Issue may be related to thread safety within BarManager when adding/removing Bars when signal slots for QApplication.screenAdded
and QApplication.screenRemoved
in main.py
Hey,
Despite installing all the packages from requirements.txt I think there is something missing in my system from QT.
python src/main.py
Yasb - Yet Another Status Bar
qt.qpa.plugin: Could not find the Qt platform plugin "windows" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
python --version
Python 3.9.12
Not sure what's missing (PyQT6 is installed from reqs)
Like yasb.exe -h
Output: useful information on how to customize.
About project the link to ur page
-r -reload reloads the bar
-a -apply apply css style example : yasb.exe -a path to css and path of the other
-e -edit edit css with defualt editor
Maybe a json file saying hey true or false bar top =true or false for bottom ... basic functions and what not hope this helps and doesnt make things to complicated.
-u -update
In the Readme it is documented that the user provided config should/could be placed in
C:/Users/{username}/.yasb/config.yaml
As this doesn't work for me, the config didn't load and the log doesn't give me an hint i look at the code.
In the config_utils.py
it is mentioned that the home dir is constructed from Path.home()
and DEFAULT_CONFIG_DIRECTORY
but the DEFAULT_CONFIG_DIRECTORY
in settings.py
is actually set to .yabar
.
So there are 2 possibilities in my eyes:
C:/Users/{username}/.yabar/config.yaml
should be usedDEFAULT_CONFIG_DIRECTORY
to .yasb
I would prefer option 2 as this fits more but that's just my 2ct ;)
top changes the top
left changes left
bottom changes the bottom
right changes the right
top changes the top and right?
left changes the bottom?
bottom changes the bottom and right?
right changes the bottom?
This could be me misunderstanding the use of these settings but my assumption would be that changing the top padding to say top: 10
would pad the bar 10 pixels from the top of the screen it was created on. As it stands now doing so seems to do that but also pad the the bar on the right side by the same value. Similar problems exist for left/bottom/right as stated above.
yasb - c03f296
Windows 11 - 22000.438
bars:
yasb-bar:
alignment:
position: "top"
center: true
dimensions:
width: "100%"
height: 25
padding:
top: 10
left: 0
bottom: 0
right: 0
Image showing the top left and right corners with pixel rulers in red.
Improve yasb's default stylesheet to something more aesthetically pleasing.
Make use of yasb's highlight colour #54A9A9
When I pause Komorebi, the little [P] shows on the yasb bar instead of the || // etc, as expected.
But when I unpause it, the [P] is stuck there.
On Windows 11, last working python build of yasb, and last release of komorebi.
A widget with the following config should open the explorer when clicked on:
test:
kind: CustomWidget
label: "Test Widget"
callbacks:
on_left: { exec: { cmd: "cmd.exe", args: ["/c", "explorer"] } }
The toggle_label
callback works as intended, but I can't open the json_viewer, calender, nor can I execute commands.
Callbacks on_left and on_right in a custom widget do nothing. For some reason right clicking on the active program opens a browser tab as intended, other left and right click interactions do nothing. I can't open the calendar or json viewer.
The issue is reproducible with the default config or the custom widget above.
I'm running my own build of the tauri-port without any modifications. Using Windows 10 22H2.
The log file shows the following errors on left click:
00:20:19 [WARN] RedrawEventsCleared emitted without explicit MainEventsCleared
00:21:10 [WARN] NewEvents emitted without explicit RedrawEventsCleared
ElevenClock uses win32mica (made by the same author) to add a Mica effect to their settings window.
Aside from the already existing Acrylic effect, a Mica blur is a must for Windows 11.
I'm not a python developer, so please have a look at this yourself ๐
When installing it gives this TypeError
ฮป python src/main.py
Traceback (most recent call last):
File "src/main.py", line 3, in
from core.bar_manager import BarManager
File "C:\Users\liamt\Documents\Python Scripts\yasb-main\src\core\bar_manager.py", line 7, in
from core.bar import Bar
File "C:\Users\liamt\Documents\Python Scripts\yasb-main\src\core\bar.py", line 17, in
class Bar(QWidget):
File "C:\Users\liamt\Documents\Python Scripts\yasb-main\src\core\bar.py", line 31, in Bar
padding: dict = BAR_DEFAULTS['padding']
TypeError: 'type' object is not subscriptable
Enable the ability to change the style of bar depending on whether a window is maximized or not within Komorebi.
For example when a window is not maximized it appears in this style:
When the window is maximized it appears like this instead:
Although preferably more flush fit and similar to the pre-tauri YASB where it bumps the window down instead of sitting ontop of it:
Could already be possible and I'm just not familiar enough haha.
When a window is not maximized it feels more open design wise to have it in the style it comes by default, but when maximized it feels nicer to have a more flush fit while also having the bar still in view.
Sadly not familiar with implementations, which is why i'm unsure if it's not already possible.
Thanks for your time and take care!
I have recently learned of ElevenClock which replaces the system clock and is also written in Python. One interesting feature I found there is its ability to hide in fullscreen mode despite it being an always-on-top window sitting on top of the taskbar.
I remember you sent a yasb config that places the workspace indicator on the bottom where the taskbar is located.
However, for it to be unobtrusive, one would have to use TranslucentTB or RoundedTB (or both, which I do). Some people may not want this and want it to look integrated into the taskbar like how ElevenClock does.
You may want to look at ElevenClock does it
cross-platform support including linux (wayland too) for the tauri port
.yasb dir should be automatically created
yasb just crashes
add code to logger.rs, where the crash occurs
attempt to start yasb when you don't have $HOME/.yasb
..
i already wrote the code for this
I'm honestly not sure if this is a yasb, komorebi, or both problem but I have decided to put this issue here for the time being. Let me know if I should move it or if I can provide any additional information.
Under certain conditions yasb being connected to komorebi can cause an error that will produce new komorebic.exe instances to spawn until a new window is focused by komorebi or yasb is terminated. These komorebic.exe instances will persist until yasb is terminated or each task is ended. This seems to be more common when dealing with windows that have had their window decorations removed but is not limited to such windows.
The easiest most consistent steps to reproduce on my system have been as followed:
I have tried a decent amount of komorebi revisions* to attempt to narrow down this problem but most if not all have given similar results. I have also tried the Nov 19th, Dec 4th, and Dec 5th revisions of yasb as well. This error occurring after closing a window and stopping when a new window is focused by komorebi is the only real consistent factor I have found sadly.
*
Windows 11 22000.348
*Yasb - ae15d7b
*komorebi - 9fd4dbf
*komorebi error (continues to repeat with each new komorebic.exe being spawned)
*the (os error 10061) mentioned in my previous issue seemed to also cause this behavior.
ERROR komorebi::process_command: could not get window title
*yasb log
Starting Yasb
Successfully loaded config file and stylesheet
Unknown property cursor
Created bar 0 on monitor \\.\DISPLAY1
Unknown property cursor
Created bar 1 on monitor \\.\DISPLAY2
Activating listener KomorebiEventListener
Activating listener SystemEventListener
SetWinEventHook Successful. Emitting focused window and waiting for events.
Waiting for Komorebi to subscribe to named pipe yasb
Unknown property cursor
Unknown property cursor
Unknown property cursor
Unknown property cursor
Komorebi connected to named pipe: yasb
A widget that displays information about the currently focused/active window.
Available information may include the window's class_name, hwnd, title, process, etc. Having access to this information is very useful when configuring tiling window managers such as komorebi.
Automatically copy default styles.scss and config.yaml to the user's configuration directory e.g. $HOME/.config/yasb
if files are not present.
If files cannot be copied, yasb should fall-back to using the default configuration files.
Decreases likelihood that users will edit styles / config files from the yasb src directory. If src directory config defaults are broken/corrupt/deleted, the user will have to manually retrieve the default configuration files from the source repository.
Widgets should display icons properly
Widgets only recognize first font defined in styles.css defined in font-family
I can reproduce this issue simply by running yasb with all default configurations.
I am not very experience with this kind of thing and hope I am not missing something foolish.
yasb.log
Adding more data options; I suggest real time CPU temps and battery charge/discharge rate (Wh).
I use BatteryBar or HardwareInfo to monitor my battery discharge rate because I want to maximize the battery life of my laptop.
CPU temperatures are just a nice touch for desktop, but on my laptop I want to monitor them so I can go fanless when the temperatures are low.
I appreciate your work a lot ๐๐ผ
I was wondering if it would be possible for you to package a release for easier installation.
This would be very helpful for users like me who would like to use Yasb without having to go through the process of setting it up manually.
Active workspace indicator should be updated by any action that switches the workspace.
Active workspace indicator seems like it can only be updated properly by komorebic focus-workspace <number>
EDIT: komorebic move-to-workspace <number>
also works properly.
komorebic cycle-workspace previous
or komorebic cycle-workspace next
, or click an app in the Windows taskbar that redirects focus into a window in another workspace, or click a link that redirects focus into a window in another workspace.Apart from komorebic focus-workspace <number>
, the active workspace indicator in the Komorebi workspaces widget doesn't update. For example, komorebic cycle-workspace previous
or komorebic cycle-workspace next
doesn't update the active workspace. Clicking an app icon in the Windows taskbar also doesn't update the active workspace. Being redirected into another workspace because of clicking a link also doesn't update the active workspace.
Python version is 3.9.13.
The window title widget should be working by default, I assume, but it is not. Komorebi is correctly connected, the window title widget is enabled, and the options are set to their default values in config.yaml. We have no errors being printed by main.py, but some esoteric Qt warnings.
The widget fails to appear entirely, unless we set label_no_window
, in which case it will flash briefly on startup before disappearing within 100ms or so.
I've tried running it in both a normal and elevated prompt.
As for reproduction, I'm not really sure since this is just running it exactly as it is on github, with all of the default settings, on Windows 11 and Komorebi 0.14
All of the fonts are installed correctly and every other widget is working as expected.
This is the output:
python src/main.py
Yasb - Yet Another Status Bar
Starting SystemEventListener...
Starting KomorebiEventListener...
Created named pipe yasb-5360e67d-98aa-11ed-a093-001a7dda7115
Waiting for Komorebi to subscribe to named pipe yasb-5360e67d-98aa-11ed-a093-001a7dda7115
Created file watcher for path C:\Users\amnesia\.yasb
Komorebi connected to named pipe: yasb-5360e67d-98aa-11ed-a093-001a7dda7115
QWindowsWindow::setDarkBorderToWindow: Unable to set dark window border.
QWindowsWindow::setDarkBorderToWindow: Unable to set dark window border.
QWindowsWindow::setDarkBorderToWindow: Unable to set dark window border.
QWindowsWindow::setDarkBorderToWindow: Unable to set dark window border.
QWindowsWindow::setDarkBorderToWindow: Unable to set dark window border.
QWindowsWindow::setDarkBorderToWindow: Unable to set dark window border.
QWindowsWindow::setDarkBorderToWindow: Unable to set dark window border.
When running yasb through pythonw with komorebi connected a komorebic.exe console window will temporarily spawn. This appears to be on a set interval and at the same time the state command is used. Running yasb alone through pythonw or running it normally with komorebi does not cause this behavior.
Windows 11 22000.348
python - 3.10.0
yasb - 277ee71
komorebi - 5e3f1cb
Not a huge deal for me personally but might bother some.
(also thanks for the CPU widget, works great so far.)
i want to run google from the bar how would i get a widget to show up with just plain text i want to click on the word chrome and it run chrome.exe or custom file path how would i go about that
active_window functions as expected unless komorebi is connected. When connected it will eventually* display "python" or [class_name='Qt621QWindowIcon' exe='python.exe' hwnd=9700656]
*This seems to happen after clicking on the bar a couple of times.
Windows 11 22000.348
*Yasb - b25fab7
*komorebi - 9fd4dbf
(komorebi - f9785be no longer gives the os error but Yasb still breaks and gives an error)
(komorebi - 4e6e2b3) no os error, no Yasb error, active_window still breaks)
*Yasb log
Starting Yasb
Successfully loaded config file and stylesheet
Created bar 0 on monitor \\.\DISPLAY1
Activating listener <class 'core.utils.komorebi.event_listener.KomorebiEventListener'>
Activating listener <class 'core.utils.win32.event_listener.SystemEventListener'>
SetWinEventHook Successful. Emitting focused window and waiting for events.
Waiting for Komorebi to subscribe to named pipe yasb
Komorebi connected to named pipe: yasb
Failed to emit event signal <bound PYQT_SIGNAL k_signal_update of WorkspaceWidget object at 0x00000214F31C5FC0> with args: (None,)
Traceback (most recent call last):
File "C:\Users\%USERPROFILE%\Python\yasb\yasb-main\src\core\event_service.py", line 25, in emit_event
event_signal.emit(*args)
TypeError: WorkspaceWidget.k_signal_update[dict].emit(): argument 1 has unexpected type 'NoneType'
Failed to emit event signal <bound PYQT_SIGNAL k_signal_update of WorkspaceWidget object at 0x00000214F31C5FC0> with args: (None,)
*komorebi log
ERROR komorebi::process_command: No connection could be made because the target machine actively refused it. (os error 10061)
Add a widget that shows system battery information
Tray and taskbar button support for Windows
In order to ditch the default taskbar, which received a very (IMO) terrible rewrite in Windows 11. Calling the tray popup with AHK is rather inconsistent/buggy.
https://github.com/cairoshell/ManagedShell - This repo might be useful in implementing this.
I understand that this is a gargantuan request - just implementing a tray widget would make a world of difference.
Assume there are two workspaces named 0
and 1
, active-layout of workspace 0
is bsp and active-layout of workspace 1
is monocle
Switching from workspace 0
to workspace 1
should update the layout status, from bsp to monocle
This is not a big problem though. But I like to take a glance at the current layout from time to time, just to make sure I'm not in the monocle layout since I can't remember how many windows are there. So probably it would be better if there's a fix to this little issue?
_update_active_layout
isn't triggered until there's a manual change
similarly, if the tiling is paused, then the inital status of komorebi-active-layout
after re-tiling won't get updated, but still in the pause-status.
yasb should run when python src/main.py
executed.
stops running with attached error meesage.
python -m pip install -r requirements.txt --user
python src/main.py
error message as below:
$ python src/main.py
Yasb - Yet Another Status Bar
Starting KomorebiEventListener...
Starting SystemEventListener...
Created named pipe yasb-5f4d3e0a-59aa-11ed-818b-dcf505ca6af6
Created file watcher for path C:\Users\canor\.yasb
Waiting for Komorebi to subscribe to named pipe yasb-5f4d3e0a-59aa-11ed-818b-dcf505ca6af6
Traceback (most recent call last):
File "C:\Users\canor\Downloads\yasb\src\core\utils\komorebi\event_listener.py", line 56, in run
self._wait_until_komorebi_online()
File "C:\Users\canor\Downloads\yasb\src\core\utils\komorebi\event_listener.py", line 100, in _wait_until_komorebi_online
logging.warning(f"Komorebi failed to subscribe named pipe. Waiting for subscription: {stderr.decode('utf-8')}")
^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc0 in position 15: invalid start byte
Add a widget that allows users to view and interact with their komorebi workspaces.
Widget allows for viewing and interacting with komorebi workspaces active on the display the bar is being shown on.
Can likely be ported from https://github.com/denBot/yasb/blob/main/src/core/widgets/komorebi/workspaces.py
ive followed what to do on the page but i get this error
Starting KomorebiEventListener...
Created named pipe yasb-c44170f9-1f49-11ed-b703-5cf3707bf232
Waiting for Komorebi to subscribe to named pipe yasb-c44170f9-1f49-11ed-b703-5cf3707bf232
Created file watcher for path C:\Users\eric.yasb
Komorebi failed to subscribe named pipe. Waiting for subscription: 'komorebic.exe' is not recognized as an internal or external command,
operable program or batch file.
Hi,
Thanks for making this. It's a really beautiful app.
I was trying to create a custom widget, but wasn't really able to determine what the units for run_interval are.
In the sample config.yaml
, I see
# run every hour
run_interval: 6000000
but I wasn't sure what unit that could be.
Looking through the code, it appears we're using QTimer
behind the scenes, and from what I could tell from their docs, it should be in milliseconds. In that case this comment would be wrong since it's 3600000 ms in an hour. I was thinking it might be a little bug.
A widget which enables the user to view and interact with system tray icons from within a configured yasb status bar.
Allows system tray applications to be managed via yasb, instead of relying on the windows built-in taskbar.
See examples for enumerating system tray icons via win32 api:
Icon information could be polled on a frequent basis e.g. 1000ms and sent to a vue widget which renders icons and handles onclick events. HICON images could be converted to base64 to allow for displaying in the frontend.
Add widgets that allow for CPU and system memory information to be shown within the status bar.
System information can be polled from the following crates:
A widget that displays information for currently playing media, e.g. song title, artist, play/pause status etc.
Lets user view information about the currently playing media source
Via win32 API or a rust windows media wrapper. Yasb 1.0 implementation can be used as a reference:
#13
use .config/yasb instead
..
..
It would be good if the changes were immediately applied on config save instead of having to restart yasb, much like how komorebic watch-configuration
works.
i even installed VS-code as it says , but still not workign
info :
OS : wind 11 ,
python = 3.11
copying psutil\tests\__init__.py -> build\lib.win-amd64-cpython-311\psutil\tests
copying psutil\tests\__main__.py -> build\lib.win-amd64-cpython-311\psutil\tests
running build_ext
building 'psutil._psutil_windows' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for psutil
Building wheel for winsdk (pyproject.toml) ... error
error: subprocess-exited-with-error
ร Building wheel for winsdk (pyproject.toml) did not run successfully.
โ exit code: 1
โฐโ> [332 lines of output]
After closing yasb, the space used by it seems to be still "blocked" and I'm left with an empty space that can't be used by my windows.
Not sure if this is related, but what is the expected way to close yasb? I'm assuming using exit through the tray icon menu is supported, what about killing the process running in the cmdline?
Add a command-line argument to specify config directory.
For users that keep their configs neat and tidy inside $Env:USERPROFILE/.config
, one may run yasb
with an argument specifying the location of the config directory.
Using argparse
one could define a command-line interface for running yasb
with arguments. Developers may optionally handle environment variables such as $Env:USERPROFILE
for better control and more flexibility.
Preferably, yasb
would be executed within a virtual environment. Here's how my launch command would look:
Start-Process -FilePath "$($Env:USERPROFILE)/.virtualenvs/yasb-zR90hDxo/Scripts/python.exe" -ArgumentList "$($Env:USERPROFILE)/yasb/src/main.py --config $($Env:USERPROFILE)/.config/yasb" -WindowStyle hidden
The above PowerShell command starts a Python process using a venv
created by pipenv
. The ArgumentList
consists of yasb_main_path
, a --config
option, and a config_dir
path. It opens yasb
in a hidden window so that yasb
won't close if the user closes the executing shell.
When I toggle to other window, the number on the left of the bar can not be updated if there is a float window
komorebi version:0.1.14
Battery status icon should change.
YASB doesn't display the battery widget and won't respond to click gestures.
status_icons
to config.yml
.widgets:
battery:
type: "yasb.battery.BatteryWidget"
options:
time_remaining_natural: true
label: "{icon} {percent}"
label_alt: "remaining: {time_remaining}"
update_interval: 1000
charging_options:
icon_format: "{icon}"
blink_charging_icon: false
status_thresholds:
critical: 10
low: 30
medium: 60
high: 80
full: 100
status_icons:
charging: "\uf583"
critical: "\uf579"
low: "\uf57b"
medium: "\uf57e"
high: "\uf580"
full: "\uf578"
callbacks:
on_left: "toggle_label"
on_middle: "do_nothing"
on_right: "do_nothing"
Log: yasb.log
Config: config.yml
Running on Windows 11 22H2.
Export .css file to .config/yasb
And bblean support
Mkdir ~./.config/yasb
Cp path to css configfile yourname/.config/yasb
Heck even micro text editor uses it
After i run pip install -r [requirements.txt](https://github.com/denBot/yasb/blob/main/requirements.txt)
it says that it cant open requirements folder
I have 2 monitors. The active window title should be shown exclusively for the bars on the active window screen, when the monitor_exclusive
is true
.
The active window title won't be shown on any of bars of both monitors.
Add logging.info(f"The monitor name is {monitor_name}, and the screen name is {self.screen().name()}")
in active_window.py
and the prints are as follow:
2023-04-27 19:24:16 INFO active_window.py: The monitor name is \\.\DISPLAY1, and the screen name is LF24T35
2023-04-27 19:24:16 INFO active_window.py: The monitor name is \\.\DISPLAY1, and the screen name is L24e-30
Since monitor_name
does not equal to both screens, the program will always execute self._window_title_text.hide()
.
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.