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

How to use warp terminal to run my cmd? #282

Open
zhangyc310 opened this issue Apr 17, 2022 · 5 comments
Open

How to use warp terminal to run my cmd? #282

zhangyc310 opened this issue Apr 17, 2022 · 5 comments

Comments

@zhangyc310
Copy link

I like shuttle, it helped me.
Now I try warp terminal , and It looks great.
Now shuttle support iterm and term to run my cmd .
How to use warp terminal to run my cmd?
May some one help me ?

@stefanocurnis
Copy link

Also looking for this. Did you find any solution?

@rickbakker
Copy link

I also recently downloaded Warp. Tried to change the iterm.app to warp.app but it's not opening the command in Warp. Instead it's opening in the default terminal instead. Anyone got a fix for that? I see there is also no recent updates to Shuttle which is a shame. Is this something we gotta code ourselfs?

@j-like-jeff
Copy link

I'm also looking for using Warp but found no solution.

@j-like-jeff
Copy link

j-like-jeff commented Feb 6, 2023

Okay got it working..

here is my solution:

.shuttle.json

"terminal": "Terminal.app",

I wrote a custom AppleScript to open warp. Shuttle uses AppleScripts to do that.

warp.applescript

--for testing uncomment the "on run" block
--on run
--	set argsCmd to "ps aux | grep [s]creen"
--	set argsTheme to "Homebrew"
--	set argsTitle to "Custom title"
--	scriptRun(argsCmd, argsTheme, argsTitle)
--end run

on scriptRun(argsCmd, argsTheme, argsTitle)
	set withCmd to (argsCmd)
	set withTheme to (argsTheme)
	set theTitle to (argsTitle)
	CommandRun(withCmd, withTheme, theTitle)
end scriptRun

on CommandRun(withCmd, withTheme, theTitle)
	tell application "Warp"
			activate
            tell application "System Events"
                tell process "Warp"
                    keystroke "t" using command down
                end tell
	        end tell
            tell application "System Events"
                tell process "Warp"
                    delay 0.5
                    keystroke withCmd
                    delay 0.5
                    key code 36
                end tell
	        end tell
		
	end tell
end CommandRun

after that you need to replace the old termimal scripts with the new ones:

#!/bin/bash
echo "compiling applescripts for OS X terminal..."
osacompile -o /Applications/Shuttle.app/Contents/Resources/terminal-new-window.scpt -x warp.applescript
osacompile -o /Applications/Shuttle.app/Contents/Resources/terminal-current-window.scpt -x warp.applescript
osacompile -o /Applications/Shuttle.app/Contents/Resources/terminal-new-tab-default.scpt -x warp.applescript
chmod +x compile.sh
./compile.sh

You need to add access for shuttle in your system preferences to use it. Now my shuttle is working fine with warp.

Here you can find the old ones again: Github

I forked the Repo with spotlight search integration. When I have enough time I will add Warp to the config Option and release a new build. But not today. This workarround should helps for the moment.

EDIT:

Here is my warp release and changes:

https://github.com/j-like-jeff/shuttle/releases/tag/v1.30-warp

remove old shuttle version, remove it from security panel in system settings, install the new version and add new security preferences for shuttle.

warp
Shuttle.app.zip

Currently I check for Spotlight Integration. It is working but got a strange error with (null) on search and my programming time in objective-c is a long time ago.. maybe @ObladiObladaLifeGoesOn can help.

Bildschirm­foto 2023-02-06 um 20 44 27

@rickbakker
Copy link

rickbakker commented Feb 9, 2023

That does the job pretty well :) Thanks for your effort!

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

No branches or pull requests

4 participants