My First Useful Xdotool Script

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
fmen
Posts: 51
Joined: Mon 07 May 2018, 12:22

My First Useful Xdotool Script

#1 Post by fmen »

This is a workaround to the problem of opening magnet files into Transmission from chromium.

The script opens any Chromium url in Palemoon including torrent sites were the magnet can then be downloaded via Transmission.

I am working on second script that bypasses Palemoon and copies the magnet url directly from chromium to Transmission.

I am a total newbie to linux, bash, xclip and xdotool but this is a great learning experience.

Code: Select all

sleep .5
xdotool key ctrl+l
sleep .2
xdotool key ctrl+c
xdotool exec palemoon $(xclip -o)
To trigger the script, I've given it a keyboard shortcut Ctrl-Shift-m

fmen
Posts: 51
Joined: Mon 07 May 2018, 12:22

#2 Post by fmen »

Ah, here's a better workaround that downloads the magnet directly from chromium:

Place your mouse over the magnet symbol but do not click.
Trigger your keyboard shortcut instead.

Code: Select all

xdotool click 3
sleep .1
xdotool key Down Down Down Down Return
xdotool exec transmission-gtk 
sleep .5
xdotool key ctrl+u Return

Post Reply