Skip to content

Latest commit

 

History

History
56 lines (35 loc) · 4.26 KB

README.md

File metadata and controls

56 lines (35 loc) · 4.26 KB

This is a simple bash script that allows you to replay mouse clicks and key presses thus allowing you to execute Aegisub plugins with a single keypress.

final.mp4

Requirements

Program Function
xdotool To emulate keypresses and mouse clicks
rofi Launcher to select which Aegisub script to execute
yad If you need file selector
xclip To manage contents of clipboard
notify-send To show messages as notification (since we won't be running the script in terminal)
Basic shell scripting knowledge

What you can do with this script

  • Run any script from Automation menu in one click. (No matter how many key presses or mouse clicks it needs)
  • Chain execution of scripts just like arch1t3cht's Aegisub Chain. I frequently chain other scripts with AssWipe.
  • Allow file selection for scripts like Aegisub Motion, svg2ass etc.
  • Do anything you can in bash scripts really.
  • No need to remember hotkeys since you can now fuzzy search them using the script's name, author's name or feature's name.

Limitation

  • I use a tiling windows manager so the windows' dimension and position do not change. If everytime you run an Aegisub script, their position and/or dimension changes in your distro, you cannot use this script.
  • If you constantly add new plugins, the co-ordinate of the plugin in Automation menu will also change. To prevent that, I add all of my most used scripts in sub-menu as shown in the image below so their position will always remain same even if I add new plugins. You can add script to sub-menu using Dependency Control's Macro Configuration or modifying depctrl's json file or script itself.

auto

  • You use Windows.
  • You use Linux but Wayland. I hear ydtool is xdotool equivalent for Wayland so you'll have to adapt with that.

Template

Your screen size is different than mine so the script I write for my computer will not work in yours. So I've provided a template where you can add your own xdotool commands. Only edit where [EDIT] is written in the comment unless you know what you're doing. You are free to check my script to see what can be done with this script.

Recording xdotool commands

If you want to do it manually, you can get the location of your mouse cursor by using xdotool getmouselocation. However I've written a bash script to somewhat automate the process.

When you run this script, if your mouse cursor remains unmoved for a couple of seconds, a prompt will appear.

record

If the prompt showed accidentally or when you weren't ready, you can select Continue without recording. If at any point you want to stop recording, select Stop Recording instead.

However if you want to record current location, type a message. For example, if you type Automation Menu and hit Enter, your location will be recorded with comment Click on Automation Menu.

If you want to record key press instead of mouse clicks, type t msg where t tells the script that you want to record keyboard typing and msg is what you want to type. For example, t ctrl+v will emulate you pressing ctrl+v in your keyboard.

record.mp4

Inspiration

Zahuczky's Second Typesetting Keyboard