Conversation
- add screenshots - build swift - add shortcuts - use proper linter - tweaks - improve selected mode icon - improve swift code - show retina modes first - first working version - improve detail - show display modes - format display info - parse swift output - initial commit
|
Congratulation on your new Raycast extension! 🚀 We will review it shortly. Once the PR is approved and merged, the extension will be available on the Store. |
pernielsentikaer
left a comment
There was a problem hiding this comment.
Hi 👋
Thanks for your contribution 💪
I have now tested your extension, and I have some feedback ready for you:
Suggestions (For later)
- Add a menubar command too 🙂
- Allow favorite modes in the list (if possible)
I'm looking forward to testing this extension again 🔥
Request a new review when you are ready. Feel free to contact me here or at Slack if you have any questions.
| @@ -0,0 +1,115 @@ | |||
| import { ActionPanel, List, Action, useNavigation, showHUD, KeyEquivalent } from "@raycast/api"; | |||
There was a problem hiding this comment.
| import { ActionPanel, List, Action, useNavigation, showHUD, KeyEquivalent } from "@raycast/api"; | |
| import { ActionPanel, List, Action, useNavigation, showHUD, Icon } from "@raycast/api"; |
| actions={ | ||
| <ActionPanel> | ||
| <Action | ||
| title="Change Display Mode" |
There was a problem hiding this comment.
| title="Change Display Mode" | |
| title="Change Display Mode" | |
| icon={Icon.Monitor} |
Adding an icon makes it even more beautiful 🙂
There was a problem hiding this comment.
Done. Looks better!
| actions={ | ||
| <ActionPanel> | ||
| <Action.Push | ||
| title="Show Display Modes" |
There was a problem hiding this comment.
| title="Show Display Modes" | |
| title="Show Display Modes" | |
| icon={Icon.Monitor} |
Adding an icon makes it even more beautiful 🙂
There was a problem hiding this comment.
Done. Looks better!
| <Action.Push | ||
| title="Show Display Modes" | ||
| target={detail(display)} | ||
| {...(key ? { modifiers: ["opt"], key: key } : {})} |
There was a problem hiding this comment.
| {...(key ? { modifiers: ["opt"], key: key } : {})} | |
| {...(key ? { shortcut: { modifiers: ["opt"], key: key } } : {})} |
You missed shortcut here, it should look like the above suggestion
If you hold ⌘ for 400 ms you'll get the same behavior out of the box, I would actually just remove the above and rely on ⌘+num instead which is how Raycast works in every list 🙂
There was a problem hiding this comment.
Oh, yeah this is totally unnecessary then. I removed it.
Very convenient default behaviour from Raycast 👏
| <ActionPanel> | ||
| <Action | ||
| title="Change Display Mode" | ||
| {...(key ? { modifiers: ["opt"], key: key } : {})} |
There was a problem hiding this comment.
| {...(key ? { modifiers: ["opt"], key: key } : {})} | |
| {...(key ? { shortcut: { modifiers: ["opt"], key: key } } : {})} |
You missed shortcut here, it should look like the above suggestion
If you hold ⌘ for 400 ms you'll get the same behavior out of the box, I would actually just remove the above and rely on ⌘+num instead which is how Raycast works in every list 🙂
There was a problem hiding this comment.
Oh, yeah this is totally unnecessary then. I removed it.
Very convenient default behaviour from Raycast 👏
| import { environment, getPreferenceValues, Icon, Image, Keyboard, List } from "@raycast/api"; | ||
| import { execa, ExecaError } from "execa"; | ||
| import { chmod } from "fs/promises"; | ||
| import { join } from "path"; | ||
| import { DisplayInfo, Mode } from "./types"; | ||
|
|
||
| const preferences: Preferences = getPreferenceValues(); | ||
|
|
There was a problem hiding this comment.
| import { environment, getPreferenceValues, Icon, Image, Keyboard, List } from "@raycast/api"; | |
| import { execa, ExecaError } from "execa"; | |
| import { chmod } from "fs/promises"; | |
| import { join } from "path"; | |
| import { DisplayInfo, Mode } from "./types"; | |
| const preferences: Preferences = getPreferenceValues(); | |
| import { environment } from "@raycast/api"; | |
| import { execa } from "execa"; | |
| import { chmod } from "fs/promises"; | |
| import { join } from "path"; | |
| import { DisplayInfo, Mode } from "./types"; | |
Just removed unused imports
| export function numberToKey(n: number): Keyboard.KeyEquivalent | undefined { | ||
| switch (n) { | ||
| case 1: | ||
| return "1"; | ||
| case 2: | ||
| return "2"; | ||
| case 3: | ||
| return "3"; | ||
| case 4: | ||
| return "4"; | ||
| case 5: | ||
| return "5"; | ||
| case 6: | ||
| return "6"; | ||
| case 7: | ||
| return "7"; | ||
| case 8: | ||
| return "8"; | ||
| case 9: | ||
| return "9"; | ||
| default: | ||
| return undefined; | ||
| } | ||
| } |
There was a problem hiding this comment.
| export function numberToKey(n: number): Keyboard.KeyEquivalent | undefined { | |
| switch (n) { | |
| case 1: | |
| return "1"; | |
| case 2: | |
| return "2"; | |
| case 3: | |
| return "3"; | |
| case 4: | |
| return "4"; | |
| case 5: | |
| return "5"; | |
| case 6: | |
| return "6"; | |
| case 7: | |
| return "7"; | |
| case 8: | |
| return "8"; | |
| case 9: | |
| return "9"; | |
| default: | |
| return undefined; | |
| } | |
| } |
If relying on default Raycast behavior this is not necessary 🙂
|
@pernielsentikaer Thank you very much for your feedback. |
pernielsentikaer
left a comment
There was a problem hiding this comment.
Hi 👋
Looks good to me, approved 🔥
|
Published to the Raycast Store: |
|
🎉 🎉 🎉 Such a great contribution deserves a reward, but unfortunately we couldn't find your Raycast account based on your GitHub username. |
Description
A extension that lists your plugged displays and for each one it lists the available modes (resolution, scale and refresh rate) and allows to switch to a new display mode.
Screencast
screencast.mov
Checklist
npm run buildand tested this distribution build in Raycastassetsfolder are used by the extension itselfREADMEare placed outside of themetadatafolder