This commit introduces a new komorebic command, close-workspace. This
command will remove the focused workspace from the window manager state
if the following conditions are met:
1. The number of workspaces on the focused monitor are >1
2. The workspace is empty
3. The workspace is unnamed
The third condition is to ensure that we are not removing workspaces
which have been declared in the static configuration file.
This commit adds a new SocketMessage::Theme which allows for themes to
be set programmatically. This change has also been plumbed through to
komorebi-bar so that the bar theme will also update after komorebi
processes the message and passes it on to subscribers.
A new theme_manager module has been introduced to add notification-based
handling of theme changes, both from the static config file being
updated and from SocketMessage::Theme being received.
This commit replaces almost all uses of the egui Viewport API for bar
window positioning with calls to SetWindowPos via komorebi_client's
Window struct.
This seems to play much more smoothly with multi-monitor setups where
each monitor has a different scaling factor, opening the door for
multiple instances of komorebi-bar.exe to run against multiple monitors.
As a result of this change, the "viewport" configuration option has been
renamed to "position" and doc strings have been changed to remove the
reference to the egui crate docs. Similarly, "viewport.position" and
"viewport.inner_size" have been renamed to "position.start" and
"position.end" respectively. Backwards-compatibility aliases have been
included for all renames.
This commit ensures that the komorebi-bar.exe process is DPI aware and
applies DPI compensation to viewport.position and viewport.inner size
both on launch and on configuration reload. viewport.position changes
are now hotloaded wihtout having to restart the process.
re #1024
This commit adds a --quickstart flag to the komorebi-bar binary to
output an example komorebi.bar.json into the user's desired
configuration directory.
This is to avoid the case where running komorebic quickstart would
result in clobbering an existing komorebi.json file.
Additionally, if a user tries to run the bar for the first time without
a configuration file, the example configuration will be written to disk
for them.
Finally support for loading a komorebi.bar.yaml file has been removed
because I have no desire to support multiple configuration formats over
the long term.
Not a huge fan of these updates in the windows-rs crate which swap the
isize values which were previously wrapped in various handles with *mut
core::ffi:c_void pointers.
In order to at least keep this codebase sane, all of the wrapper
functions exposed in WindowsApi now take isize wherever they previously
took HWND, HMONITOR, HINSTANCE etc.
Going forward any pub fn in WindowsApi should prefer isize over Windows
handles which wrap c_void pointers.
This commit updates the various komorebic json schema generation
commands to generate the schemas locally, without requiring a running
instance of komorebi to communicate with over IPC.
This commit introduces a new SocketMessage, ReplaceConfiguration, which
attempts to replace a running instance of WindowManager with another
created from a (presumably) different komorebi.json file.
This will likely be useful for people who have multiple different
monitor setups that they connect and disconnect from throughout the day,
but definitely needs more testing.
An experimental sub-widget which calls this SocketMessage has been added
to komorebi-bar to aid with initial testing.
This commit abstracts the theme-related code from komorebi-bar into a
separate library which is now also consumed by komorebi.
The static configuration file for komorebi has been updated to allow
users to specify themes and provide palette overrides for various border
styles and stackbar configuration options.
In the event that both a theme and border-specific and/or
stackbar-specific colours have been specified, the theme will take
priority to make it as easy as possible for users who have already spent
time tweaking their colours to try out themes and quickly revert back if
they prefer their existing colours.
This change makes it easier for users to have unified themes between
komorebi and the komorebi status bar.
This commit adds an initial version of the komorebi status bar.
At this point the bar is still considered "alpha" and the configuration
format may see some small breaking changes based on usage and feedback.
There is an accompanying video series which details the creation of this
bar on YouTube: https://www.youtube.com/watch?v=x2Z5-K05bHs
Some high level notes on the bar:
* An external application which exclusively consumes komorebi_client's
public API surface - anyone can create this without hacking directly
on komorebi's internals
* Generally a very simple bar with limited configuration options - users
who want more configurability should use alternatives such as yasb or
zebar
* Scope is deliberately limited to provide a tighter, more focused
experience: Windows-only, komorebi-only, single-monitor-only,
horizontal-only
* No support for custom widgets or templating
* Colours are controlled exclusively through themes which adhere to a
palette framework such as Base16 or Catppuccin (and possibly others in
the future)
This commit contains all of the commits listed:
e5fa03c33c
feat(bar): initial commit
b3990590f3
feat(bar): add config struct with basic opts
bc2f4a172e
feat(bar): handle komorebi restarts gracefully
ca6bf69ac7
feat(bar): add basic widget config opts
18358efed8
feat(bar): add interactive layout and media widgets
92bb9f680b
perf(bar): use explicit redraw and data refresh strategies
8e74e97706
feat(bar): add battery and network widgets
fdc7706d23
feat(bar): add custom font loader
025162769b
feat(bar): allow right side widget ordering
a1688691cf
feat(bar): add app icon next to focused window title
9f78739c3f
feat(bar): add komorebi widget (+config) and themes
a4ef85859e
feat(bar): use phosphor icons for uniformity
e99138a97e
feat(bar): add first pass at configuration loader
d6ccf4cf9a
feat(bar): add logging and config hotwatch
34d2431947
feat(bar): handle monocle containers in komorebi widget
7907dfeb79
feat(bar): add optional data refresh intervals to config
96a9cb320e
feat(bar): add flag to list system fonts
42b7a13693
feat(bar): add activity to network widget
ac38f52407
feat(bar): to_pretty_bytes on network activity
6803ffd741
feat(bar): configurable network activity fill char len
7d7a5d758d99808cd2b81da2b3ddbb11c52aa92f
ci(github): add bar to wix and goreleaser configs
da307e36fc1faf84ecca3f91811fdd15f70ef2ff
feat(bar): expand theme sources
c580ff7899889309dfa849ad4fb05b80b6af8d9b
feat(bar): add accent config for themes
bc4dabda4a941c0c9764fae2c8d11abbfdc0a9f5
feat(bar): add accents to widget emojis
a574837529dd6c5add73edf394c1c9c2e6cc6315
feat(bar): add to hard-coded float identifiers
ff41b552613f911e56b1790e68389525ee7e603c
chore(deps): bump base16-egui-themes
This commit demotes the komorebi-core crate to a module (core) inside of
the komorebi lib, resulting in the komorebi-client crate lib becoming
the single public interface for programming in Rust against komorebi.
komorebic and komorebi-gui now consume komorebi-client exclusively as
the means for sending and receiving messages to and from komorebi, so
that anyone wishing to integrate with komorebi will have all of the same
functionality to them as I do.
This commit is the result of a long investigation with @berknam on
Discord which uncovered that when the channels used by the *_manager
modules are full, the window manager can enter a completely locked state
which will require a hard restart of komorebi.exe.
In order to avoid entering this locked state, *_manager modules now no
longer publicly expose event_tx for sending notifications.
Instead, a new public fn send_notification is exposed which will use
try_send to attempt to send notifications in a non-blocking manner and
log warnings if the channel is full and the notification is dropped.