Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Update komorebi.sample.ahk with more sane defaults / window rules #62

Closed
da-rth opened this issue Oct 29, 2021 · 3 comments
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@da-rth
Copy link

da-rth commented Oct 29, 2021

This should perhaps be an on-going ticket as we discover more necessary window rules which should be applied when starting komorebi.

Currently, some example floating window rules are present in komorebi, however, a number of additional float-rules specific to both Windows 10 and Windows 11 could be applied - along with some developer-specific window rules for IDEs such as Jetbrains/Code etc. If anyone has a window rule which they believe should be added as a sane default, please include it within this discussion.

With the potential implementation of regex pattern matching based window rules (#60), I would like to propose the following rules be added to komorebi.sample.ahk

# Firefox / Chrome Picture-in-picture
komorebic.exe float-rule --title "Picture-in-picture" 

# Jetbrains IDE pop-up windows
komorebic.exe float-rule --class "jetbrains-(.*)" --title "Welcome to (.*)"
komorebic.exe float-rule --class "jetbrains-(.*)" --title="Go to Line/Column"
komorebic.exe float-rule --class "jetbrains-(.*)" --title="Rename"
komorebic.exe float-rule --class "jetbrains-(.*)" --title="Open Project"
komorebic.exe float-rule --class "jetbrains-(.*)" --title="win0"
komorebic.exe float-rule --class "jetbrains-(.*)" --title="Welcome to (.*)"

# Task Manager
komorebic.exe float-rule --exe "taskmg.exe"

Additionally, it would be quite good to have rules for as many popular minimise-to-tray apps as possible.

@LGUG2Z LGUG2Z added documentation Improvements or additions to documentation enhancement New feature or request good first issue labels Oct 29, 2021
@LGUG2Z
Copy link
Owner

LGUG2Z commented Oct 29, 2021

Definitely in favour of having the sample config file catch as many rough edges as possible!

Do the current float rules for IntelliJ popups and Task Manager not work as expected (or are they different on Windows 11?)

@xSTUDDSx
Copy link

xSTUDDSx commented Jan 7, 2022

Here's one for the little blue MS Teams Notification box that appears on the bottom right hand corner of the screen when a new message comes through. Worked on W10. Can't speak to W11, but assume it's the same title and would work just fine.

; Always float Teams Notifications, matching on title
Run, komorebic.exe float-rule title "Microsoft Teams Notifications", , Hide

LGUG2Z added a commit that referenced this issue Apr 2, 2022
This commit introduces a configuration generator for
application-specific config options passed to the cli via a file path.

The hope is to have a public repository that any user can contribute
application-specific configs and fixes to, and for the generated AHK to
be available to any new user as part of the initial setup to make the
onboarding as frictionless as possible.

re #62
@LGUG2Z LGUG2Z self-assigned this Apr 3, 2022
@LGUG2Z
Copy link
Owner

LGUG2Z commented Apr 3, 2022

Based on some discussions in the Discord, I am working on adding a configuration generator to komorebi-core and exposing it through komorebic. This is intended to be used with a central repository (or forked personal repositories) containing options that are known to be required for different applications to run seamlessly with komorebi.

I have started populating this repository based on my own komorebi.ahk file.

The CLI can be run against the YAML file containing the applications that you want to generate rules for (probably all of them, just in case), and the resulting file is output to $KOMOREBI_HOME and can be included at the top of your komorebi.ahk file.

This way, we have to rely less on a sample file commited to the repo for applicaiton window rules and just focus on a set of key bindings for the main functionality that will be familiar to most people with previous twm experience, and the documentation can reflect where the latest application window rule definitons can be sourced from and generated.

LGUG2Z added a commit that referenced this issue Apr 3, 2022
This commit adds a fmt command which allows users to prepare PRs to the
configuration repository in a unified way.

The 'custom' formatter basically just ensures that the yaml array is
sorted by application name to make for easier diffs.

Serializing of Option::None has been disabled to keep the yaml file more
concise.

Finally, an option for adding comments to float rules has been included
as some of these rules can be quite esoteric and there is value in
having them annotated with comments in the configuration to preserve and
pass down the knowledge.

The config generation command has been renamed to
'ahk-app-specific-configuration' (with a short alias of 'ahk-asc') to
emphasise that an ahk file is being generated (similar to
'ahk-library').

re #62
LGUG2Z added a commit that referenced this issue Apr 4, 2022
This commit adds a second optional argument to the ahk-asc command which
can take an override yaml file. This file can include either entirely
new entries that are not suitable for the asc definitions in the
community repo, or overrides for entries that exist in the community asc
definitions files which will take precedence in the generated ahk file.

This can be useful for example, when the default behaviour for an app is
to minimise to system tray, but that option has been disabled on a
user's computer, making the 'tray_and_multi_window' option no longer
appropriate for their komorebi configuration.

In the case of wanting to override an existing entry, only the "name"
key needs to match; upon a match the entry from the community asc
definitions will be entirely replaced with the entry from the override
definitions.

re #62
@LGUG2Z LGUG2Z closed this as completed in 7457d81 Aug 12, 2022
LGUG2Z added a commit that referenced this issue Aug 12, 2022
This commit introduces a new komorebi.sample.ahk in the repository root,
as well as adding the latest generated versions of komorebic.lib.ahk and
komorebi.generated.ahk.

Pushing new users to use the AHK library by default will significantly
simplify the process of building a new configuration, and including the
application-specific configuration generated from the configuration
repository will result in a better first impression of komorebi where
more and more applications "just work".

This new sample is focused on setting a few sane configuration defaults,
and as few keybinds as possible, really just enough to allow the user to
switch focus and move windows around. This significantly reduces the
possibility of the first-time user accidentally triggering a command
that leaves them confused, frustrated and would probably end in them
killing the komorebi.exe proc from the task manager.

The new sample configuration will no longer be bundled with scoop
starting from the next release, which is also expected to introduce
support for installation via winget.

Instead, instructions have been added for users to download the latest
example configuration and generated libs from GitHub in the getting
started section.

resolve #62
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants