zshell-img-tools #104

Merged
zach merged 25 commits from zshell-img-tools into main 2026-05-31 00:30:12 +02:00
Owner

Added new binary zshell-img-tools to add post-processing to screenshots taken with the shell's region picker.

Settings now has a new category to configure the effects applied either using manual or auto mode where auto will pull the values set in your Hyprland config to mimic your decoration style for windows. Manual is self explanatory, you set the values for the effects which can also be configured in the settings category.

Which brings me to that Hyprland config fetching has been fixed, too.

Added new binary `zshell-img-tools` to add post-processing to screenshots taken with the shell's region picker. Settings now has a new category to configure the effects applied either using manual or auto mode where auto will pull the values set in your Hyprland config to mimic your decoration style for windows. Manual is self explanatory, you set the values for the effects which can also be configured in the settings category. Which brings me to that Hyprland config fetching has been fixed, too.
zach added 5 commits 2026-05-26 18:42:14 +02:00
fetch necessary hyprland options for screenshot tool
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 20s
Python / test (pull_request) Successful in 45s
Python / lint-format (pull_request) Successful in 51s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m50s
a3f38e6414
zach added 1 commit 2026-05-26 18:42:19 +02:00
Merge branch 'main' into zshell-img-tools
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 25s
Python / lint-format (pull_request) Successful in 31s
Python / test (pull_request) Failing after 54s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m13s
74ce5bb868
AramJonghu added 1 commit 2026-05-26 18:54:19 +02:00
Merge branch 'main' into zshell-img-tools
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 13s
Python / lint-format (pull_request) Successful in 24s
Python / test (pull_request) Successful in 49s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m10s
93ffe6ca2d
Collaborator

Add a description and add me as a reviewer once it is ready for testing. I will look into it then.

Add a description and add me as a reviewer once it is ready for testing. I will look into it then.
zach added 1 commit 2026-05-26 23:03:30 +02:00
Merge branch 'main' into zshell-img-tools
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 13s
Python / lint-format (pull_request) Successful in 21s
Python / test (pull_request) Successful in 43s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m4s
54e8a265d0
zach added 1 commit 2026-05-28 17:06:20 +02:00
Merge branch 'main' into zshell-img-tools
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 12s
Python / lint-format (pull_request) Successful in 21s
Python / test (pull_request) Successful in 51s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m3s
239de807d4
Inorishio added 2 commits 2026-05-28 18:56:25 +02:00
Merge branch 'zshell-img-tools' of git.zach-dev.cc:zach/z-bar-qt into zshell-img-tools
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 12s
Python / lint-format (pull_request) Successful in 20s
Python / test (pull_request) Successful in 50s
Lint & Format (Rust) / lint-format (pull_request) Failing after 1m2s
6e43bac52b
zach added 1 commit 2026-05-28 20:21:28 +02:00
respect new arguments
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 21s
Python / lint-format (pull_request) Successful in 36s
Python / test (pull_request) Successful in 1m11s
Lint & Format (Rust) / lint-format (pull_request) Failing after 1m16s
9a026b2484
Inorishio added 3 commits 2026-05-28 22:07:33 +02:00
Merge branch 'zshell-img-tools' of git.zach-dev.cc:zach/z-bar-qt into zshell-img-tools
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 15s
Python / lint-format (pull_request) Successful in 19s
Python / test (pull_request) Successful in 43s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m3s
1d0ee72498
AramJonghu marked the pull request as work in progress 2026-05-28 22:50:56 +02:00
zach added 1 commit 2026-05-28 23:16:09 +02:00
pass hyprland options when auto is enabled
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 12s
Python / lint-format (pull_request) Successful in 21s
Python / test (pull_request) Successful in 53s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m4s
760b8bfb93
zach added 1 commit 2026-05-28 23:20:01 +02:00
incorrect color channel assignment fixed
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 17s
Python / lint-format (pull_request) Successful in 24s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m11s
Python / test (pull_request) Successful in 1m16s
1d667bedfd
zach added 1 commit 2026-05-28 23:24:29 +02:00
Merge branch 'main' into zshell-img-tools
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 11s
Python / lint-format (pull_request) Successful in 25s
Python / test (pull_request) Successful in 50s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m8s
84ecd1481b
zach requested review from AramJonghu 2026-05-29 00:05:33 +02:00
zach marked the pull request as ready for review 2026-05-29 00:05:35 +02:00
zach added 1 commit 2026-05-29 11:50:28 +02:00
Merge branch 'main' into zshell-img-tools
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 11s
Python / lint-format (pull_request) Successful in 32s
Python / test (pull_request) Successful in 47s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m3s
84db7f41af
zach added 1 commit 2026-05-29 12:28:14 +02:00
Merge branch 'main' into zshell-img-tools
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 11s
Python / lint-format (pull_request) Successful in 24s
Python / test (pull_request) Successful in 45s
Lint & Format (Rust) / lint-format (pull_request) Successful in 50s
c4cca73fd9
AramJonghu requested changes 2026-05-29 18:42:35 +02:00
AramJonghu left a comment
Collaborator

I do not know rust at all, so code review is limited for rust. I know some basic cpp, but it looked fine. As far as I can read, qml changes are mostly config changes or changes to fit hyprland's changes.

Features I have tested

  • Screenshot tool with all settings. I switched them off and I also on on auto. Lastly, on with each setting changed to verify if they work properly.
  • Screenshot tool app itself, drawing for example.
  • Game mode/battery save mode (indirectly tests hyprland config fetching).
  • Battery toast.
  • Binary ran in terminal.
  • Settingswindow itself.

What I found

I do wish there was an issue linked to this PR. Makes it easier what feature was not within scope. I only found #109, which I assume is not within scope of this PR. I will mention what I found regardless of what I assume is part of the work.

Screenshot app/feature

Swappy app

  • App cannot be resized. Sometimes I'd want to make the window smaller for any reason. Is this planned?
  • The app takes 2-3 seconds to launch. Turning effects off or on. Can this be reduced?
  • No feedback if a screenshot is saved, copied or trashed using the buttons. I'd say closing the app is not the way, but perhaps a small popout message that hits that you saved or copied the image.
  • Should there be a limit of how much radius/shadow is added? The size of swappy increases dramatically when shadow is set very high. Include the offset and it could be an ugly look, especially if it is not possible to resize it.

Settings window

  • Enable effects bool should hide the effects settings below. Effects mode does do this, which is good.
  • The order of settings could use improvements. Now Corner radius and Enable rounded corners are separated and confusing. My suggested order (after Corner radius): Enable rounded corners -> Corner radius -> Enable shadow -> Shadow blur amount -> last two remain the same.

For context, see image.

image.png

Binary

  • Binary returns nothing. No feedback. This could be found by a user without an apparent use case. Does it have a function outside of the app?

What works

Screenshot tool effects.

  • The effects work and are consistent.

Battery toast #106

  • It works, single toast at 20%. log shows nothing of note. I did not read the code, but perhaps a toast for 5% is also neat.
  • When plugged in, and unplugging, the battery notice pops up. Great!

Hypr config fetching with game mode

  • Game mode works, successfully disables and enables power hungry settings.
I do not know rust at all, so code review is limited for rust. I know some basic cpp, but it looked fine. As far as I can read, qml changes are mostly config changes or changes to fit hyprland's changes. ## Features I have tested - Screenshot tool with all settings. I switched them off and I also on on auto. Lastly, on with each setting changed to verify if they work properly. - Screenshot tool app itself, drawing for example. - Game mode/battery save mode (indirectly tests hyprland config fetching). - Battery toast. - Binary ran in terminal. - Settingswindow itself. ## What I found I do wish there was an issue linked to this PR. Makes it easier what feature was not within scope. I only found #109, which I assume is not within scope of this PR. I will mention what I found regardless of what I assume is part of the work. ### Screenshot app/feature #### Swappy app - App cannot be resized. Sometimes I'd want to make the window smaller for any reason. Is this planned? - The app takes 2-3 seconds to launch. Turning effects off or on. Can this be reduced? - No feedback if a screenshot is saved, copied or trashed using the buttons. I'd say closing the app is not the way, but perhaps a small popout message that hits that you saved or copied the image. - Should there be a limit of how much radius/shadow is added? The size of swappy increases dramatically when shadow is set very high. Include the offset and it could be an ugly look, especially if it is not possible to resize it. ### Settings window - `Enable effects` bool should hide the effects settings below. `Effects mode` does do this, which is good. - The order of settings could use improvements. Now `Corner radius` and `Enable rounded corners` are separated and confusing. My suggested order (after `Corner radius`): `Enable rounded corners` -> `Corner radius` -> `Enable shadow` -> `Shadow blur amount` -> last two remain the same. For context, see image. ![image.png](/attachments/78ff9ca3-11ba-4a2d-aa45-d738b26fcca8) #### Binary - Binary returns nothing. No feedback. This could be found by a user without an apparent use case. Does it have a function outside of the app? ## What works ### Screenshot tool effects. - The effects work and are consistent. ### Battery toast #106 - It works, single toast at 20%. log shows nothing of note. I did not read the code, but perhaps a toast for 5% is also neat. - When plugged in, and unplugging, the battery notice pops up. Great! ### Hypr config fetching with game mode - Game mode works, successfully disables and enables power hungry settings.
2.0 MiB
@@ -1,12 +1,12 @@
import Quickshell.Io
JsonObject {
Collaborator

Should the default value of screenshot effects be enabled? I can see a reason for either option.

Should the default value of screenshot effects be enabled? I can see a reason for either option.
@@ -154,6 +163,7 @@ fn rgba_image_to_pixmap(img: &RgbaImage) -> Pixmap {
pixmap
}
// Shadow
Collaborator

This is a nitpick, perhaps a pet peeve of mine; Is it not obvious that shadow_img is a shadow above at line 94? If you need a comment for the contents of pixmap_to_rgba_image, then do the contents not need better naming to reflect its function?

This is a nitpick, perhaps a pet peeve of mine; Is it not obvious that `shadow_img` is a shadow above at line 94? If you need a comment for the contents of `pixmap_to_rgba_image`, then do the contents not need better naming to reflect its function?
@@ -137,3 +126,3 @@
let image_path = image_path.context("Missing --image <path>")?;
let config = config::Config::load().context("Failed to load config")?;
// Check if any arguments were provided
Collaborator

cli_args_provided says the same as the comment.

`cli_args_provided` says the same as the comment.
Collaborator

Also resolve the Rust formatting check (it shows checkmark, but in details, it did not pass).

Also resolve the Rust formatting check (it shows checkmark, but in details, it did not pass).
AramJonghu added the enhancement label 2026-05-29 20:21:21 +02:00
zach added 1 commit 2026-05-29 23:25:08 +02:00
Merge branch 'main' into zshell-img-tools
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 11s
Python / lint-format (pull_request) Successful in 33s
Python / test (pull_request) Successful in 44s
Lint & Format (Rust) / lint-format (pull_request) Failing after 1m9s
1d0fc63177
Author
Owner

I'll be working on options being greyed out when effects are disabled.

I'll be working on options being greyed out when effects are disabled.
zach added 1 commit 2026-05-29 23:44:44 +02:00
disable screenshot options in gui when disabling effects
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 17s
Python / lint-format (pull_request) Successful in 27s
Python / test (pull_request) Successful in 52s
Lint & Format (Rust) / lint-format (pull_request) Failing after 1m7s
164c0a18c2
Collaborator
  1. Swappy App
    Swappy takes from your own config in ~/.config/swappy/config.json so anything it does or doesn’t do can be changed there.

Do you want this to be editable from the settings window or is knowing that enough?

  1. Settings window
    As Zach already said he’ll look into the out greying of the options
    The names indeed still need to be changed.
    These are still old as we already changed them in the backend.
    Lastly agreed they should be reordered.

  2. Binary
    On standalone execution of the binary whenever it fails it should give feedback. I’d like to see whatever happens for you and try and solve it then.
    Make sure you made packaged when using the /usr/bin/zshell-img-tools else run it from zshell/plugins/zshell-img-tools/target/release/zshell-img-tools.

  3. Screenshot.qml
    Personally as it is a feature of the bar I think it should be enabled by default.

  4. Rust
    Honestly when writing this I had horrible comments purely so I didn’t have to skim over it and immediately know as a mental note what it was for.
    They could be made clearer or removed entirely.
    I’ll go over it tomorrow.

1) Swappy App Swappy takes from your own config in ~/.config/swappy/config.json so anything it does or doesn’t do can be changed there. Do you want this to be editable from the settings window or is knowing that enough? 2) Settings window As Zach already said he’ll look into the out greying of the options The names indeed still need to be changed. These are still old as we already changed them in the backend. Lastly agreed they should be reordered. 3) Binary On standalone execution of the binary whenever it fails it should give feedback. I’d like to see whatever happens for you and try and solve it then. Make sure you made packaged when using the /usr/bin/zshell-img-tools else run it from zshell/plugins/zshell-img-tools/target/release/zshell-img-tools. 4) Screenshot.qml Personally as it is a feature of the bar I think it should be enabled by default. 5) Rust Honestly when writing this I had horrible comments purely so I didn’t have to skim over it and immediately know as a mental note what it was for. They could be made clearer or removed entirely. I’ll go over it tomorrow.
Collaborator

Swappy was discussed. Not much to do with the complaints. The delay seems exclusive to my laptop. Other things are indeed config related.
Shadow limits are considered for the reasons to have guardrails against bugs (accidental huge number can be ugly).

Settingswindow will be resolved indeed.

The issue with the binary is its mystery outside the project where it is used. What does it do when ran outside of its designed environment? There is no --help tooltip or flags. For example, running zshell-cli will suggest the user to check --help. Another example is tlp for (laptop) power management. Running tlp does nothing executable apart from printing information. I think this is important when it is not intended to run the command standalone.

If it is enabled by default was discussed. Conclusion was that it is enabled by default on auto mode (taking what the user has in hypr config). The advantage is that if the user has no shadows and rounding, it will not include them (as if it is disabled). Solid for both ends.

It looks partially vibe coded. That is ok if so. Cleanup would be appreciated. But know, naming things is hard regardless of my comments on naming functions/variables.

Swappy was discussed. Not much to do with the complaints. The delay seems exclusive to my laptop. Other things are indeed config related. Shadow limits are considered for the reasons to have guardrails against bugs (accidental huge number can be ugly). Settingswindow will be resolved indeed. The issue with the binary is its mystery outside the project where it is used. What does it do when ran outside of its designed environment? There is no `--help` tooltip or flags. For example, running `zshell-cli` will suggest the user to check `--help`. Another example is `tlp` for (laptop) power management. Running tlp does nothing executable apart from printing information. I think this is important when it is not intended to run the command standalone. If it is enabled by default was discussed. Conclusion was that it is enabled by default on auto mode (taking what the user has in hypr config). The advantage is that if the user has no shadows and rounding, it will not include them (as if it is disabled). Solid for both ends. It looks partially vibe coded. That is ok if so. Cleanup would be appreciated. But know, naming things is hard regardless of my comments on naming functions/variables.
Collaborator

The binary is something that will be worked on separately. As it is a tool for zshell but we give the user access to it outside of it as well. I'll create an issue with your comments that you made from this PR as enhancements for the tool itself.

For this PR however it is not mandatory for the standalone binary to be complete as the focus right now is mainly the bar.

The binary is something that will be worked on separately. As it is a tool for zshell but we give the user access to it outside of it as well. I'll create an issue with your comments that you made from this PR as enhancements for the tool itself. For this PR however it is not mandatory for the standalone binary to be complete as the focus right now is mainly the bar.
Inorishio added 1 commit 2026-05-30 20:40:35 +02:00
Some prework for the binary, linter issue is resolved, unnecessary comments removed
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 11s
Python / lint-format (pull_request) Successful in 19s
Python / test (pull_request) Successful in 50s
Lint & Format (Rust) / lint-format (pull_request) Failing after 49s
8ea295d1ce
Collaborator
  1. Rustfmt lint & format failing
    Lint format failing is because rustfmt is running on rust edition 2015 on base.
    I specifically want to write it in the newest edition which is 2024.
    If we were to change the lint format we'd be forcing us to use 2024 on every rust project within zshell.
    Instead I created .rustfmt.toml` to tell rustfmt that specifcally zshell-img-tools is written in edition 2024.
    If we want to globally force ourselves to write it this way then we should discuss that first.

  2. Removed unnecessary comments

  3. Found a new bug which will be added to #109

1) Rustfmt lint & format failing Lint format failing is because rustfmt is running on rust edition 2015 on base. I specifically want to write it in the newest edition which is 2024. If we were to change the lint format we'd be forcing us to use 2024 on every rust project within zshell. Instead I created .rustfmt.toml` to tell rustfmt that specifcally zshell-img-tools is written in edition 2024. If we want to globally force ourselves to write it this way then we should discuss that first. 2) Removed unnecessary comments 3) Found a new bug which will be added to #109
Inorishio requested review from AramJonghu 2026-05-30 20:55:49 +02:00
Inorishio added 1 commit 2026-05-30 20:59:31 +02:00
Update zshell-img-tools/src/main.rs
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 11s
Python / lint-format (pull_request) Successful in 19s
Python / test (pull_request) Successful in 47s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m2s
0d7c5d199a
Lint had issues with --help so for now I'm just removing it.
Collaborator

Lint format failing is because rustfmt is running on rust edition 2015 on base.

I assume you mean 2025?

> Lint format failing is because rustfmt is running on rust edition 2015 on base. I assume you mean 2025?
AramJonghu reviewed 2026-05-30 22:28:08 +02:00
AramJonghu left a comment
Collaborator

Rust codebase still has comments. We can create issues resolving the issue I remarked about the binary and code cleanup. Code works fine which for now is fine.

I leave it up for @zach to merge. Settingswindow hides settings items when disabled. Only limiter to shadow to do, or make a separate issue to tackle this.

Rust codebase still has comments. We can create issues resolving the issue I remarked about the binary and code cleanup. Code works fine which for now is fine. I leave it up for @zach to merge. Settingswindow hides settings items when disabled. Only limiter to shadow to do, or make a separate issue to tackle this.
Inorishio added 1 commit 2026-05-31 00:23:18 +02:00
changes comments
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 12s
Python / lint-format (pull_request) Successful in 19s
Python / test (pull_request) Successful in 42s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m4s
7f3397e27c
zach merged commit d041ce2471 into main 2026-05-31 00:30:12 +02:00
zach deleted branch zshell-img-tools 2026-05-31 00:30:16 +02:00
Sign in to join this conversation.