Desktop Automation Framework
Project description
self-driving-desktop
Desktop Automation framework
tested on linux/gnome3
python main.py --playlist path/to/file.txt
Development Setup
virtualenv --python python3 penv
source penv/bin/activate
pip install -r requirements.txt
Playlists
playlist openTerm {
hotkeys "ctrl" "alt" "t";
sleep 1.0;
name_active hofTerm;
sleep 0.5;
hotkeys "winleft" "left";
sleep 1;
};
playlist closeTerm {
focus hofTerm;
hotkeys "ctrl" "shift" "q";
sleep 1;
};
playlist closeChrome {
focus hofChrome;
hotkeys "alt" "f4";
sleep 1;
};
playlist openChrome {
shell "google-chrome";
sleep 2.0;
name_active hofChrome;
sleep 0.5;
hotkeys "winleft" "right";
sleep 1;
};
playlist focusTest {
focus hofTerm;
sleep 0.2;
write "date\n" 0.05;
sleep 2;
focus hofChrome;
sleep 0.2;
write "https://docs.hofstadter.io\n" 0.05;
};
playlist gsDocs {
mv 100 100 1.5;
mv 1111 272 1;
click;
sleep 2;
};
playlist main {
wspace_down;
sleep 0.2;
play openTerm openChrome;
play focusTest;
play gsDocs;
play closeChrome closeTerm;
sleep 2;
wspace_up;
};
play main;
Grammar
Top-level:
- file has steps and playlists
- steps are the only thing run
- play runs a playlist
Steps:
play name+;
: run one or more playlistssleep x.y;
: sleep for x.y secondsmv x y s;
: move the mose to x,y in s secondsclick;
: click the left mouse buttonwspace_down;
: move one workspace downwspace_up;
: move one workspace uphotkeys "quoted" "keys" ...;
: press some keys togetherwrite "quoted string\n";
: type a string, "\n" is entershell "quoted strings"+;
: exec a command from the programname_active someName;
: name the active windowfocus someName;
: focus a named window
start: item+
item: step ";" | playlist ";"
playlist : "playlist" WORD playlist_body
playlist_body : "{" (step ";")* "}"
step : play
| sleep
| mv
| wspace_down
| wspace_up
| hotkeys
| write
| shell
| name_active
| focus
play: "play" WORD+
name_active: "name_active" WORD
focus: "focus" WORD
sleep: "sleep" number
mv: "mv" number number number
wspace_down: "wspace_down"
wspace_up: "wspace_up"
hotkeys: "hotkeys" string+
write: "write" string number?
shell: "shell" string+
number: SIGNED_NUMBER
string: ESCAPED_STRING
COMMENT: /#[^\n]*/
WORD: LETTER+
%import common.LETTER
%import common.ESCAPED_STRING
%import common.INT
%import common.SIGNED_NUMBER
%import common.WS
%ignore COMMENT
%ignore WS
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for self_driving_desktop-0.0.2-py3.6.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23b77b44a9c208cc9a72d4417b9e4d96dc826547792916aeab2bd239e86a80d9 |
|
MD5 | b4c69af5dcfb79a513a67c2e9369c6e2 |
|
BLAKE2b-256 | d9264cf1c06efe295c4ce0908f74fe715e499b2ddd14dcf00491364db5d81f7b |