Skip to content

feat: grimblast parsing options and arguments correctly#169

Merged
fufexan merged 22 commits intohyprwm:mainfrom
LeonardoMor:parsing
Sep 16, 2025
Merged

feat: grimblast parsing options and arguments correctly#169
fufexan merged 22 commits intohyprwm:mainfrom
LeonardoMor:parsing

Conversation

@LeonardoMor
Copy link
Contributor

Summary

@LeonardoMor LeonardoMor changed the title feat: grimblast options and arguments correctly feat: grimblast parsing options and arguments correctly Sep 7, 2025
@fufexan fufexan mentioned this pull request Sep 14, 2025
6 tasks
grimblast: formatted with shfmt

grimblast: fix parameter expansion on instance check

As it is, the second :- would be taken literally

grimblast: better entry point and instance checking

Same functionality as before, less code.

feat: mark the entry point

refactor: use global variables instead of functions

In any case, said functions where used only once.

refactor: use a global variable for the editor tmp dir

refactor: simple way to assign GRIMBLAST_EDITOR

refactor(NOTIFY): use commands true or false instead of strings yes/no

refactor(OPENFILE_NOTIFICATION): use true/false instead of yes/no

refactor: more accurate option name

refactor(notifyOpen): rename and improve

New name more accurately reflects what this function does. De-nested the
code. Text shown on the notification button now makes sense (as opposed
to "default"), at least as tested in Hyprland-DE.

refactor(notifyShowParentDir): more accurate error

refactor(OPENFILE_NOTIFICATION): more accurate variable name

refactor: update option name in the help

refactor: better name

refactor: CURSOR takes advantage of parameter expansion

All we need is for it to be set to something with length greater than 0.
So simplify and double down on it.

refactor(FREEZE): better freeze logic

Squashed commit of the following:

commit c0e9ff7
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Fri Aug 15 12:58:55 2025 -0600

    refactor: introducing the freezeScreen function

    Mostly for readability

commit eaf2a10
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Fri Aug 15 12:55:41 2025 -0600

    refactor: use the better check with -q option

    The quiet check

commit 4dddf2f
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Fri Aug 15 12:55:17 2025 -0600

    refactor(check): make all the variables local

commit 911b0a4
Author: Leonardo Mora Castro <lmoracas@cisco.com>
Date:   Sun Aug 10 21:09:30 2025 -0600

    refactor(killHyprpicker): use the -q quiet option

    Save a redirection. Use && to save 2 lines

commit a3ccd55
Author: Leonardo Mora Castro <lmoracas@cisco.com>
Date:   Sun Aug 10 21:05:10 2025 -0600

    refactor(check): add -q quiet option

    This saves some command and redirections

commit d1f97b8
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Sun Aug 10 11:18:57 2025 -0600

    refactor(FREEZE): logic based on assignment

refactor(WAIT): better simpler logic

Squashed commit of the following:

commit 83676f4b059fccabe7ee7b3e25b134d0dd61297c
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Sat Aug 16 14:21:15 2025 -0600

    refactor(wait): rename to grimblast::wait

    There is a wait shell command. Avoid the name clash.

commit 403dfd22a5e18c44f16601fc8cf71f0ff5f6d918
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Sat Aug 16 14:12:09 2025 -0600

    refactor(wait): simpler

commit 7d2146880a81a14c86831c0f59224d73ca61b59c
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Sat Aug 16 14:04:00 2025 -0600

    refactor: these variables are alike

refactor: [[ -n $string ]] is equivalent to [[ $string ]]

Therefore all of these are equivalent: [[ -z $string ]], [[ ! $string ]], ! [[ $string ]]

refactor(edit): check if the editor is installed at all.

It'll be useful to fallback to save if the editor is not installed at
the moment. So you can install the your preferred editor and edit the
saved screenshot as desired.

style: overall better bash

These were minor edits before the final major refactor.

Squashed commit of the following:

commit 265f26f427e958ecd64e3c789e4fc9b1991dfb06
Author: Leonardo Mora Castro <lmoracas@cisco.com>
Date:   Sun Aug 17 20:45:49 2025 -0600

    docs: future reference comment

commit af9a81c48e4dd9501a2595e7255675ea5289195a
Author: Leonardo Mora Castro <lmoracas@cisco.com>
Date:   Sun Aug 17 20:37:53 2025 -0600

    refactor: remove superfluous echo

commit ab1f88cc336799fdf6e4f40acb5997a7e26732c6
Author: Leonardo Mora Castro <lmoracas@cisco.com>
Date:   Sun Aug 17 20:32:37 2025 -0600

    refactor(check): no reason for this not to be a loop

commit 794d9cbd897bb1e6f78e2980d1d619ec8c0c6160
Author: Leonardo Mora Castro <lmoracas@cisco.com>
Date:   Sun Aug 17 19:30:43 2025 -0600

    refactor: send errors to standard error

commit 8784423c655f853aad94ac837736309cbf1bdf37
Author: Leonardo Mora Castro <lmoracas@cisco.com>
Date:   Sun Aug 17 19:28:35 2025 -0600

    refactor: try to exit early

commit 7664a57f2afad6991f9c42a8ce91fd9d5756e930
Author: Leonardo Mora Castro <lmoracas@cisco.com>
Date:   Sun Aug 17 19:24:31 2025 -0600

    refactor(cleanup): add cleanup function

    Only because more things might need to be added to this in the future.
    Also, it reads better.

commit d8ce90ffbac50e4ae9da5ae91a1f42ab8242d2dc
Author: Leonardo Mora Castro <lmoracas@cisco.com>
Date:   Sun Aug 17 19:23:45 2025 -0600

    refactor: better name

commit f01d35a3d80d86809fc3ab4e876c445cdaf18c8b
Author: Leonardo Mora Castro <lmoracas@cisco.com>
Date:   Sun Aug 17 19:12:38 2025 -0600

    refactor(notify): better naming

    I really don't like camel case. Using :: is a gimmick you can easily see
    a hierarchy emerge.

    This are about the only things I like from this code. In the end I'll
    see if these can be made better.

commit e29af1debdb29778c305ded5a95095dbbd0f1f57
Author: Leonardo Mora Castro <lmoracas@cisco.com>
Date:   Sun Aug 17 19:07:28 2025 -0600

    refactor(usage): introducing the usage function

try_swap_workspace: fix monitor ID after standby (hyprwm#167)

Co-authored-by: MareOfNights <mare-of-nights@pm.me>

refactor: minor changes before massive refactor

Squashed commit of the following:

commit 51e838680a580e65b6416849858a46c0d7501978
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 19 16:01:06 2025 -0600

    refactor(takeScreenshot): better code

commit fc005167a08c442eaa413c1c2f274755ae6f9f34
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 19 15:51:10 2025 -0600

    refactor(freezeScreen): better name

commit 14ce6d37634a20cef324557897f0e44b1e6b87cc
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 19 15:05:05 2025 -0600

    refactor(takeScreenshot): better name

commit 90b13d186956204308764bceabd8daa1bd88ef8b
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 19 15:02:20 2025 -0600

    refactor(killhyprpicker): kill as part of clean up

commit 5089f21a9c6626f173c4368d5d13601038eab99b
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 19 15:00:01 2025 -0600

    docs: useful to mark where these are

refactor(grimblast): massive refactor ensuring correct parsing

Squashed commit of the following:

commit 03a479a19a91928b35a41dd619ad7fedbf318a57
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 26 19:07:43 2025 -0600

    refactor(check): for consistency

commit 571430e5ba66d75c8c61d820108dfc4319b8404c
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 26 19:06:48 2025 -0600

    refactor(die): for consistency

commit d8322b286238e9a4b69f7b248ab7af847d5f311d
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 26 19:02:41 2025 -0600

    refactor(grimblast::wait): return correctly

commit 7a6474cb519b4609e3edc162a3a14dc65f9898cf
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 26 18:54:12 2025 -0600

    refactor(notify::ok): this the correct return code is used

commit acf58cbeaddb800d0e47b5fa49854d72cb12883d
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 26 18:46:46 2025 -0600

    refator: type

commit eecdee827d9e81cd1ac682559d144d86c7a819fb
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 26 18:44:41 2025 -0600

    refactor: better syntax

commit bace948a05d59dba2f1a4b61e710e7f9f6c2bcfe
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 26 18:33:40 2025 -0600

    refactor: eliminated the use of subject and target

    Sticking to target which is what is on the man page

commit b41527a28ec09434cffd33083c928f6bb705ef47
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 26 18:20:47 2025 -0600

    refactor: shorter syntax

commit 3b388636432ea05089adb6b0ff6aabf617236362
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 26 18:20:16 2025 -0600

    refactor: correctly set the default values of environment

commit 9ad1e28e5d329202200f47f822480c1e1f2ed63e
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 26 17:56:15 2025 -0600

    refactor: quotes required

commit dbe3a404796f35e65d4935483f77120d888ad912
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 26 16:54:50 2025 -0600

    feat: introducing env variables that the user can specify

commit c27a564841cf118b91b04923d557062874b46527
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 26 16:43:17 2025 -0600

    refactor: these variables would be declared when assigned

commit 0624649b9c518e02edbc6625a42db69595b61112
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 26 16:18:56 2025 -0600

    refactor(screenshot): correctly prepare args for grim

commit 35d79780b1e9e1b00561b0c59c21961192dace4b
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Fri Aug 22 17:26:56 2025 -0600

    refactor: better message

commit a893de147ad9a8a98cd220bfe51ad546dd0f53d6
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Fri Aug 22 17:24:34 2025 -0600

    feat: introduction the parse-action function

commit 12161c1b4fda6db5480ffc66b41d97de45c944d2
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Fri Aug 22 17:23:53 2025 -0600

    feat(main): invoke the main logic

commit 719bbce32788c4bb52a8d9c50cdac5222cde75f1
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Fri Aug 22 17:13:11 2025 -0600

    refactor: this handles well the case when no arguments are given

commit 4215874e16dd48ddb99d73701a1bbd118a189107
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Fri Aug 22 16:59:20 2025 -0600

    refactor(die): add -h option to print help to stderr before dying

commit 0be45ffe58ab33935d2db82452f31877b762aa73
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Fri Aug 22 16:50:24 2025 -0600

    feat: introducing copysave action function

commit 62a8b699b58072fec424ca52949d4a2785be6eca
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Wed Aug 20 17:57:56 2025 -0600

    refactor: introducing the edit action function

commit f12f037749e0d9b1868fd041ca863484e4272579
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Wed Aug 20 17:35:27 2025 -0600

    refactor(notify::showparentdir): better logic

commit dcd62a66110b33f0a8295a22a5fc6738bde5107e
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Wed Aug 20 17:21:46 2025 -0600

    refactor: move this functions as they're useful earlier

commit 317bb8eb7e9011404e54d47f06c596a0db670d94
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Wed Aug 20 17:14:53 2025 -0600

    refactor(notify::error): always echo the error to stderr

commit 60e8fa9da1f4da2617b197fef106c3e1be653486
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Wed Aug 20 17:06:25 2025 -0600

    refactor(DATE_FORMAT): make it so that the user can set it

commit 49d8f6c3b7e1992555aec58595de1e318c8857a5
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Wed Aug 20 17:04:27 2025 -0600

    refactor: introduce save action function

commit 21cd64c8c08d9ffbdc7f7640a9d4fc6932f58584
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Wed Aug 20 17:03:23 2025 -0600

    feat: add a date format variable

commit 89c6dc7b941249f3879f772769ff2155d45fa3f9
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Wed Aug 20 16:35:34 2025 -0600

    refactor(parse-subject): subject has to be a global variable

commit ca8522684ac3cea625b45d6fe433711c27d4d780
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Wed Aug 20 16:35:06 2025 -0600

    refactor: introduce copy action function

commit 48dc613e00437735f928746d8eb9e7edb4cdf623
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Wed Aug 20 16:15:56 2025 -0600

    fix(parse-subject): die only takes 1 argument

commit e942ca6c7387c5329a745ecc9d807bf03407e920
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Wed Aug 20 16:12:40 2025 -0600

    refactor: introduce parse-subject

    Validates whether a valid subject was entered by the user. If so, the
    correct function is called.

commit 32cc64697547c42b8f68c3616ea6740168d2e179
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Wed Aug 20 15:29:07 2025 -0600

    refactor: add helpful wording

    Telling the user how to get a screenshot of a window when using 'area'

commit 261aaf4254cd771eceabc35f7c68261944ab39a3
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Wed Aug 20 15:22:07 2025 -0600

    refactor: introducing subject functions

commit 8892c22022202fdc47962378dcd0d1142a1ed840
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 19 18:59:55 2025 -0600

    refactor: reorder functions

commit 96c4b53c6841bffc7382d427c9e51cb74c6ea4bb
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 19 18:44:31 2025 -0600

    refactor(check): to avoid name clash

commit 3199754d3ac11d65113c9d7a8d3bd88a20e0b76b
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 19 18:42:57 2025 -0600

    refactor: layout general logic

commit 927d13bcd2f9a15e88d12ef9093b87b58bf83bbe
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 19 18:17:38 2025 -0600

    refactor: parse options correctly

    First step towards parsing things correctly

commit ca864f9f08ab51c6d7c859be2602c80b4599380f
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 19 16:17:37 2025 -0600

    refactor(FILE_EDITOR): change to a more meaningful name

commit 0dc7a7f0e0eec5ec614667c71d8fe0da98364b0f
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 19 16:16:10 2025 -0600

    refactor: introducing NAME.

    This will be useful later.

commit 20f3aa039b9ff87e292d0211110a017ef40d7edd
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 19 16:07:06 2025 -0600

    refactor(check): echo usage hint for this function

commit 4f8e264c4182c98cab38304061875263982a801b
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 19 16:06:23 2025 -0600

    refactor(check): better variable names
- Implement filetype option with validation for png/ppm/jpeg
- Add clipboard format restrictions (PNG only for copy/copysave)
- Update filename generation with correct extensions
- Add comprehensive tests for all supported formats
- Update documentation and man page
grimblast: formatted with shfmt

grimblast: fix parameter expansion on instance check

As it is, the second :- would be taken literally

grimblast: better entry point and instance checking

Same functionality as before, less code.

feat: mark the entry point

refactor: use global variables instead of functions

In any case, said functions where used only once.

refactor: use a global variable for the editor tmp dir

refactor: simple way to assign GRIMBLAST_EDITOR

refactor(NOTIFY): use commands true or false instead of strings yes/no

refactor(OPENFILE_NOTIFICATION): use true/false instead of yes/no

refactor: more accurate option name

refactor(notifyOpen): rename and improve

New name more accurately reflects what this function does. De-nested the
code. Text shown on the notification button now makes sense (as opposed
to "default"), at least as tested in Hyprland-DE.

refactor(notifyShowParentDir): more accurate error

refactor(OPENFILE_NOTIFICATION): more accurate variable name

refactor: update option name in the help

refactor: better name

refactor: CURSOR takes advantage of parameter expansion

All we need is for it to be set to something with length greater than 0.
So simplify and double down on it.

refactor(FREEZE): better freeze logic

Squashed commit of the following:

commit c0e9ff7
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Fri Aug 15 12:58:55 2025 -0600

    refactor: introducing the freezeScreen function

    Mostly for readability

commit eaf2a10
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Fri Aug 15 12:55:41 2025 -0600

    refactor: use the better check with -q option

    The quiet check

commit 4dddf2f
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Fri Aug 15 12:55:17 2025 -0600

    refactor(check): make all the variables local

commit 911b0a4
Author: Leonardo Mora Castro <lmoracas@cisco.com>
Date:   Sun Aug 10 21:09:30 2025 -0600

    refactor(killHyprpicker): use the -q quiet option

    Save a redirection. Use && to save 2 lines

commit a3ccd55
Author: Leonardo Mora Castro <lmoracas@cisco.com>
Date:   Sun Aug 10 21:05:10 2025 -0600

    refactor(check): add -q quiet option

    This saves some command and redirections

commit d1f97b8
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Sun Aug 10 11:18:57 2025 -0600

    refactor(FREEZE): logic based on assignment

refactor(WAIT): better simpler logic

Squashed commit of the following:

commit 83676f4b059fccabe7ee7b3e25b134d0dd61297c
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Sat Aug 16 14:21:15 2025 -0600

    refactor(wait): rename to grimblast::wait

    There is a wait shell command. Avoid the name clash.

commit 403dfd22a5e18c44f16601fc8cf71f0ff5f6d918
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Sat Aug 16 14:12:09 2025 -0600

    refactor(wait): simpler

commit 7d2146880a81a14c86831c0f59224d73ca61b59c
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Sat Aug 16 14:04:00 2025 -0600

    refactor: these variables are alike

refactor: [[ -n $string ]] is equivalent to [[ $string ]]

Therefore all of these are equivalent: [[ -z $string ]], [[ ! $string ]], ! [[ $string ]]

refactor(edit): check if the editor is installed at all.

It'll be useful to fallback to save if the editor is not installed at
the moment. So you can install the your preferred editor and edit the
saved screenshot as desired.

style: overall better bash

These were minor edits before the final major refactor.

Squashed commit of the following:

commit 265f26f427e958ecd64e3c789e4fc9b1991dfb06
Author: Leonardo Mora Castro <lmoracas@cisco.com>
Date:   Sun Aug 17 20:45:49 2025 -0600

    docs: future reference comment

commit af9a81c48e4dd9501a2595e7255675ea5289195a
Author: Leonardo Mora Castro <lmoracas@cisco.com>
Date:   Sun Aug 17 20:37:53 2025 -0600

    refactor: remove superfluous echo

commit ab1f88cc336799fdf6e4f40acb5997a7e26732c6
Author: Leonardo Mora Castro <lmoracas@cisco.com>
Date:   Sun Aug 17 20:32:37 2025 -0600

    refactor(check): no reason for this not to be a loop

commit 794d9cbd897bb1e6f78e2980d1d619ec8c0c6160
Author: Leonardo Mora Castro <lmoracas@cisco.com>
Date:   Sun Aug 17 19:30:43 2025 -0600

    refactor: send errors to standard error

commit 8784423c655f853aad94ac837736309cbf1bdf37
Author: Leonardo Mora Castro <lmoracas@cisco.com>
Date:   Sun Aug 17 19:28:35 2025 -0600

    refactor: try to exit early

commit 7664a57f2afad6991f9c42a8ce91fd9d5756e930
Author: Leonardo Mora Castro <lmoracas@cisco.com>
Date:   Sun Aug 17 19:24:31 2025 -0600

    refactor(cleanup): add cleanup function

    Only because more things might need to be added to this in the future.
    Also, it reads better.

commit d8ce90ffbac50e4ae9da5ae91a1f42ab8242d2dc
Author: Leonardo Mora Castro <lmoracas@cisco.com>
Date:   Sun Aug 17 19:23:45 2025 -0600

    refactor: better name

commit f01d35a3d80d86809fc3ab4e876c445cdaf18c8b
Author: Leonardo Mora Castro <lmoracas@cisco.com>
Date:   Sun Aug 17 19:12:38 2025 -0600

    refactor(notify): better naming

    I really don't like camel case. Using :: is a gimmick you can easily see
    a hierarchy emerge.

    This are about the only things I like from this code. In the end I'll
    see if these can be made better.

commit e29af1debdb29778c305ded5a95095dbbd0f1f57
Author: Leonardo Mora Castro <lmoracas@cisco.com>
Date:   Sun Aug 17 19:07:28 2025 -0600

    refactor(usage): introducing the usage function

try_swap_workspace: fix monitor ID after standby (hyprwm#167)

Co-authored-by: MareOfNights <mare-of-nights@pm.me>

refactor: minor changes before massive refactor

Squashed commit of the following:

commit 51e838680a580e65b6416849858a46c0d7501978
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 19 16:01:06 2025 -0600

    refactor(takeScreenshot): better code

commit fc005167a08c442eaa413c1c2f274755ae6f9f34
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 19 15:51:10 2025 -0600

    refactor(freezeScreen): better name

commit 14ce6d37634a20cef324557897f0e44b1e6b87cc
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 19 15:05:05 2025 -0600

    refactor(takeScreenshot): better name

commit 90b13d186956204308764bceabd8daa1bd88ef8b
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 19 15:02:20 2025 -0600

    refactor(killhyprpicker): kill as part of clean up

commit 5089f21a9c6626f173c4368d5d13601038eab99b
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 19 15:00:01 2025 -0600

    docs: useful to mark where these are

refactor(grimblast): massive refactor ensuring correct parsing

Squashed commit of the following:

commit 03a479a19a91928b35a41dd619ad7fedbf318a57
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 26 19:07:43 2025 -0600

    refactor(check): for consistency

commit 571430e5ba66d75c8c61d820108dfc4319b8404c
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 26 19:06:48 2025 -0600

    refactor(die): for consistency

commit d8322b286238e9a4b69f7b248ab7af847d5f311d
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 26 19:02:41 2025 -0600

    refactor(grimblast::wait): return correctly

commit 7a6474cb519b4609e3edc162a3a14dc65f9898cf
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 26 18:54:12 2025 -0600

    refactor(notify::ok): this the correct return code is used

commit acf58cbeaddb800d0e47b5fa49854d72cb12883d
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 26 18:46:46 2025 -0600

    refator: type

commit eecdee827d9e81cd1ac682559d144d86c7a819fb
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 26 18:44:41 2025 -0600

    refactor: better syntax

commit bace948a05d59dba2f1a4b61e710e7f9f6c2bcfe
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 26 18:33:40 2025 -0600

    refactor: eliminated the use of subject and target

    Sticking to target which is what is on the man page

commit b41527a28ec09434cffd33083c928f6bb705ef47
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 26 18:20:47 2025 -0600

    refactor: shorter syntax

commit 3b388636432ea05089adb6b0ff6aabf617236362
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 26 18:20:16 2025 -0600

    refactor: correctly set the default values of environment

commit 9ad1e28e5d329202200f47f822480c1e1f2ed63e
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 26 17:56:15 2025 -0600

    refactor: quotes required

commit dbe3a404796f35e65d4935483f77120d888ad912
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 26 16:54:50 2025 -0600

    feat: introducing env variables that the user can specify

commit c27a564841cf118b91b04923d557062874b46527
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 26 16:43:17 2025 -0600

    refactor: these variables would be declared when assigned

commit 0624649b9c518e02edbc6625a42db69595b61112
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 26 16:18:56 2025 -0600

    refactor(screenshot): correctly prepare args for grim

commit 35d79780b1e9e1b00561b0c59c21961192dace4b
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Fri Aug 22 17:26:56 2025 -0600

    refactor: better message

commit a893de147ad9a8a98cd220bfe51ad546dd0f53d6
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Fri Aug 22 17:24:34 2025 -0600

    feat: introduction the parse-action function

commit 12161c1b4fda6db5480ffc66b41d97de45c944d2
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Fri Aug 22 17:23:53 2025 -0600

    feat(main): invoke the main logic

commit 719bbce32788c4bb52a8d9c50cdac5222cde75f1
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Fri Aug 22 17:13:11 2025 -0600

    refactor: this handles well the case when no arguments are given

commit 4215874e16dd48ddb99d73701a1bbd118a189107
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Fri Aug 22 16:59:20 2025 -0600

    refactor(die): add -h option to print help to stderr before dying

commit 0be45ffe58ab33935d2db82452f31877b762aa73
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Fri Aug 22 16:50:24 2025 -0600

    feat: introducing copysave action function

commit 62a8b699b58072fec424ca52949d4a2785be6eca
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Wed Aug 20 17:57:56 2025 -0600

    refactor: introducing the edit action function

commit f12f037749e0d9b1868fd041ca863484e4272579
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Wed Aug 20 17:35:27 2025 -0600

    refactor(notify::showparentdir): better logic

commit dcd62a66110b33f0a8295a22a5fc6738bde5107e
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Wed Aug 20 17:21:46 2025 -0600

    refactor: move this functions as they're useful earlier

commit 317bb8eb7e9011404e54d47f06c596a0db670d94
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Wed Aug 20 17:14:53 2025 -0600

    refactor(notify::error): always echo the error to stderr

commit 60e8fa9da1f4da2617b197fef106c3e1be653486
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Wed Aug 20 17:06:25 2025 -0600

    refactor(DATE_FORMAT): make it so that the user can set it

commit 49d8f6c3b7e1992555aec58595de1e318c8857a5
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Wed Aug 20 17:04:27 2025 -0600

    refactor: introduce save action function

commit 21cd64c8c08d9ffbdc7f7640a9d4fc6932f58584
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Wed Aug 20 17:03:23 2025 -0600

    feat: add a date format variable

commit 89c6dc7b941249f3879f772769ff2155d45fa3f9
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Wed Aug 20 16:35:34 2025 -0600

    refactor(parse-subject): subject has to be a global variable

commit ca8522684ac3cea625b45d6fe433711c27d4d780
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Wed Aug 20 16:35:06 2025 -0600

    refactor: introduce copy action function

commit 48dc613e00437735f928746d8eb9e7edb4cdf623
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Wed Aug 20 16:15:56 2025 -0600

    fix(parse-subject): die only takes 1 argument

commit e942ca6c7387c5329a745ecc9d807bf03407e920
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Wed Aug 20 16:12:40 2025 -0600

    refactor: introduce parse-subject

    Validates whether a valid subject was entered by the user. If so, the
    correct function is called.

commit 32cc64697547c42b8f68c3616ea6740168d2e179
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Wed Aug 20 15:29:07 2025 -0600

    refactor: add helpful wording

    Telling the user how to get a screenshot of a window when using 'area'

commit 261aaf4254cd771eceabc35f7c68261944ab39a3
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Wed Aug 20 15:22:07 2025 -0600

    refactor: introducing subject functions

commit 8892c22022202fdc47962378dcd0d1142a1ed840
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 19 18:59:55 2025 -0600

    refactor: reorder functions

commit 96c4b53c6841bffc7382d427c9e51cb74c6ea4bb
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 19 18:44:31 2025 -0600

    refactor(check): to avoid name clash

commit 3199754d3ac11d65113c9d7a8d3bd88a20e0b76b
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 19 18:42:57 2025 -0600

    refactor: layout general logic

commit 927d13bcd2f9a15e88d12ef9093b87b58bf83bbe
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 19 18:17:38 2025 -0600

    refactor: parse options correctly

    First step towards parsing things correctly

commit ca864f9f08ab51c6d7c859be2602c80b4599380f
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 19 16:17:37 2025 -0600

    refactor(FILE_EDITOR): change to a more meaningful name

commit 0dc7a7f0e0eec5ec614667c71d8fe0da98364b0f
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 19 16:16:10 2025 -0600

    refactor: introducing NAME.

    This will be useful later.

commit 20f3aa039b9ff87e292d0211110a017ef40d7edd
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 19 16:07:06 2025 -0600

    refactor(check): echo usage hint for this function

commit 4f8e264c4182c98cab38304061875263982a801b
Author: Leonardo Mora Castro <leomc145@gmail.com>
Date:   Tue Aug 19 16:06:23 2025 -0600

    refactor(check): better variable names

# Conflicts:
#	CHANGELOG.md
#	grimblast/grimblast
…d examples

# Conflicts:
#	grimblast/grimblast
#	grimblast/grimblast.1.scd
- Implement filetype option with validation for png/ppm/jpeg
- Add clipboard format restrictions (PNG only for copy/copysave)
- Update filename generation with correct extensions
- Add comprehensive tests for all supported formats
- Update documentation and man page

# Conflicts:
#	grimblast/grimblast
#	grimblast/grimblast.1.scd
@LeonardoMor LeonardoMor marked this pull request as draft September 15, 2025 14:56
@LeonardoMor LeonardoMor marked this pull request as ready for review September 15, 2025 17:39
Copy link
Member

@fufexan fufexan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@fufexan fufexan merged commit 9e73a0e into hyprwm:main Sep 16, 2025
13 checks passed
@fufexan fufexan mentioned this pull request Sep 16, 2025
2 tasks
@LeonardoMor LeonardoMor deleted the parsing branch September 17, 2025 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FR] Add option to specify output format (-t) for grim in grimblast

2 participants