forked from raycast/extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- chore: metadata update - chore: re-installed utils - chore: command description - feat: create form update - feat(wip): changelog & readme - feat(wip): result & replace action - feat(wip): replaceIcon script - chore: verifications - Merge pull request raycast#1 from Ph-lo/feat-image-shades - feat: image shades option - feat(wip): image shades - chore: metadata size & lint - chore: package.json - chore: package.json categories - chore: package.json owner - chore: organization handle set in package.json - fix: result view file name - feat: initial commit
- Loading branch information
Showing
15 changed files
with
281 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
# Custom Folder Changelog | ||
# Custom folder Changelog | ||
|
||
## [Feat Easily apply the custom icon] - 2024-08-25 | ||
- Added the ability to easily apply the new custom icon to a target folder. | ||
|
||
## [Feat Image shades ] - 2024-08-05 | ||
- Added optional toggle - shading effect on the image, switching between a filled mask and shaded tones. | ||
|
||
## [Initial Version] - 2023-12-16 | ||
- Custom folder extension | ||
- Custom folder extension |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,13 @@ | ||
# Custom Folder | ||
# Custom folder | ||
|
||
Create custom MacOS folder images. | ||
Customize MacOs folder icons. | ||
|
||
![custom-folder-1](metadata/custom-folder-1.png) | ||
![custom-folder-2](metadata/custom-folder-2.png) | ||
## Features | ||
- Create custom folder images. | ||
- Apply custom folder images to a target folder. | ||
|
||
## Options | ||
- `Target path` - The path to the folder you want to apply the custom image to. | ||
- `Ouput path` - The path to save the custom folder image (default is `Image path`). | ||
- `Padding` - The padding around the image. | ||
- `Shades` - Apply a shading effect to the image to keep shaded tones. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { Action, popToRoot } from "@raycast/api"; | ||
import { useExec } from "@raycast/utils"; | ||
import { FC, useEffect, useState } from "react"; | ||
import { replaceIconScript } from "./utils/replaceIconScript"; | ||
|
||
interface ReplaceActionProps { | ||
iconPath: string; | ||
targetFolderPath: string; | ||
onAction: () => Promise<void>; | ||
} | ||
|
||
export const ReplaceAction: FC<ReplaceActionProps> = ({ iconPath, targetFolderPath, onAction }) => { | ||
const [shouldExec, setShouldExec] = useState<boolean>(false); | ||
const scriptContent = replaceIconScript(iconPath, targetFolderPath); | ||
|
||
const { error } = useExec(`${scriptContent}`, { | ||
shell: true, | ||
execute: shouldExec || false, | ||
failureToastOptions: { | ||
title: "Failed to apply icon", | ||
message: "Please try again, or save the icon and apply manually.", | ||
}, | ||
onData: () => popToRoot(), | ||
}); | ||
|
||
useEffect(() => { | ||
// console.error("error: ", error); | ||
}, [error]); | ||
|
||
return ( | ||
<Action | ||
title={"Apply to Folder"} | ||
icon={"switch-16"} | ||
onAction={() => { | ||
onAction().then(() => { | ||
setShouldExec(true); | ||
}); | ||
}} | ||
/> | ||
); | ||
}; |
Oops, something went wrong.