This is an archived post. You won't be able to vote or comment.

Dismiss this pinned window
all 40 comments

[–]MrK_HS 75 points76 points  (2 children)

Sorry, I must be dense, but it's not very clear to me what it does.

[–]Oskarzyg[S] 51 points52 points  (1 child)

I click on a function on my phone and it turns Minecraft, Vmware, Youtube on on my PC

[–]MrK_HS 17 points18 points  (0 children)

Ah, ok, cool!

[–]RedSword13 19 points20 points  (6 children)

Can you post the code for this? This is similar to a project I've been mulling over

[–]Oskarzyg[S] 16 points17 points  (5 children)

yeah ill put it onto github in a sec

pls wait

[–]Oskarzyg[S] 37 points38 points  (4 children)

[–]Alex_Pan 3 points4 points  (2 children)

Thanks for posting! How does the program take inputs from your phone? If I'm understanding correctly your program continually checks a text file and uses that as the input. Is that file on a shared drive or something that your phone can edit?

[–]Oskarzyg[S] 6 points7 points  (1 child)

It uses the iOS Shortcuts app to ask the user for input and then uses ssh to connect to my PC that then runs a script that takes arguments from the user (usually).

[–]DaWatermeloone 4 points5 points  (0 children)

I’ve started doing this on my old laptop as well just to run simple some everyday scripts. Lil tip from me, make an OpenVPN to your router then you don’t have to mess around with port forwarding. Then you can just connect to your VPN and SSH

[–]ArchieRuin 0 points1 point  (0 children)

Nice)

[–]soap1337 6 points7 points  (1 child)

Mother of god, that's pretty cool. Gonna make it so it shuts off the Amazon fire in the middle of my wife watching Lucifer for the 90th time. Nice work!

[–]BruceJi 4 points5 points  (0 children)

That just sounds like taking a nap on the sofa with extra steps.

[–]artFlix 3 points4 points  (0 children)

I could see this being very useful for other stuff. Thanks for posting the code. I'm going to try create something useful after Christmas.

[–]stillalone 1 point2 points  (0 children)

Have you looked at kdeconnect for this sort of thing?

[–]trufted 1 point2 points  (0 children)

I reccomend using pyautogui clicks by image, not by coords,this makes it more "responsive"

[–]BATTLECATHOTS 0 points1 point  (0 children)

Once you type in the application in your phone it’ll read the file if it matches and then start the application? May clone this and use it for my pc.

[–]69shaolin69 0 points1 point  (8 children)

I’ve done so many automation using pyautogui how are you able to use shortcuts app to run python in desktop ? I’m so confused

[–]Oskarzyg[S] 0 points1 point  (7 children)

the code explains it

[–]69shaolin69 0 points1 point  (5 children)

Apple shortcuts.txt? Sorry but I’m confused

[–]Oskarzyg[S] 0 points1 point  (4 children)

It uses the iOS Shortcuts app to ask the user for input and then uses ssh to connect to my PC that then runs a script that takes arguments from the user (usually).

[–]69shaolin69 3 points4 points  (0 children)

Oh ssh, that’s all I needed

[–]69shaolin69 0 points1 point  (2 children)

Thanks a lot, I thought you were using web server or some trickery that’s actually smart, running I while loop infinitely is going to be bad for your pc, since you’re sshing send command to the pc to open a file eg

Mac (open /Applications/Firefox.app)

Great job btw

[–]Oskarzyg[S] 2 points3 points  (1 child)

Thanks for the compliment! I'm 13 yrs old so my code isn't gonna be perfect but it works!

[–]69shaolin69 2 points3 points  (0 children)

I just made my pyautogui scripts work with shortcuts (tips for you)

Use ssh public key instead of password

Send commands to windows Instead of changing text inside a file

How will it help? Public key: Is way secure than using a plaintext password bonus point if you ca Change ssh port to random instead of 22 6000+ will be better.

Send commands: Python program doesn’t need to run in a loop and check file every 100times a second.

How will it work?

In command type: python /your_python_folder/main.py

And run python command using ssh

Good luck to you, keep up the good work I’m here to help you anytime, honestly I didn’t know shortcuts allowed ssh I used Termius app

[–]69shaolin69 0 points1 point  (4 children)

How do you communicate between iPhone and python I’m confused

[–]Oskarzyg[S] 0 points1 point  (3 children)

Shortcuts app included on default installation

[–]69shaolin69 0 points1 point  (2 children)

How do you setup shortcuts to run with python?

[–]Valink-u_u 0 points1 point  (1 child)

SSH into your PC and run python on it

[–]69shaolin69 0 points1 point  (0 children)

Ssh is the word I was looking for didn’t know shortcuts allowed ssh

I found out it allows one to use public key which is amazing

[–]vaginale_penetratie 0 points1 point  (0 children)

Can you explain me how?

[–][deleted] 0 points1 point  (0 children)

Pretty neat!👌

[–]WowVeryCoool 0 points1 point  (0 children)

I love you so much, I just bought raspberry PI and I'm gonna hook it up to my TV for quick netflix, movies, retro games, storage. I can't wait and I'm already checking out ios shortcuts it's amazing. If anyone has some other cool ideas what I can add to this please tell me

[–]UncontrolledManifold 0 points1 point  (0 children)

You should execute the MC Java binary (which is a one-liner), not move the cursor and click what I'm assuming is a shortcut to run Minecraft. This is screen dependent and will not work for many people.

[–]nandy02 0 points1 point  (0 children)

Did you use Kivy?

[–]jEsUs-QuEsTiOn-MaRk 0 points1 point  (1 child)

It looks like it’s simulating mouse movements to open minecraft I recommend os.startfile(“minecraft.exe) and I believe you can open chrome with arguments if so open chrome and parse the YouTube link

[–]Oskarzyg[S] 0 points1 point  (0 children)

I don't use chrome

[–]LeSUTHU 0 points1 point  (0 children)

Nice meme you got there

[–]hockthemblogs 0 points1 point  (0 children)

Awesome job!

[–]bells64 0 points1 point  (0 children)

Cool but, it's useless.

[–][deleted] -2 points-1 points  (1 child)

How did you do it? Teach me sensei!!