shuttle icon indicating copy to clipboard operation
shuttle copied to clipboard

How to use warp terminal to run my cmd?

Open zhangyc310 opened this issue 3 years ago • 5 comments

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 ?

zhangyc310 avatar Apr 17 '22 06:04 zhangyc310

Also looking for this. Did you find any solution?

stefanocurnis avatar Jun 14 '22 19:06 stefanocurnis

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?

rickbakker avatar Nov 10 '22 16:11 rickbakker

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

j-like-jeff avatar Feb 06 '23 11:02 j-like-jeff

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

j-like-jeff avatar Feb 06 '23 13:02 j-like-jeff

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

rickbakker avatar Feb 09 '23 13:02 rickbakker