Skip to content

Instantly share code, notes, and snippets.

View windyweather's full-sized avatar

Windy Player windyweather

  • Oregon, USA
View GitHub Profile
@windyweather
windyweather / ImpressShowRunner_StartStopShows.java
Created April 21, 2020 18:07
Sample code shows how to launch an Impress slide show and stop it. Uses Timer routines in another gist. Works on Windows 10 and Linux Mint 19.
public void startShowPlaying( String sImpress, String sOptions, String sShowPath ) {
if ( bShowRunning ) {
System.out.println("startShowPlaying already running");
return;
}
String cmdString = sImpress +" "+sOptions+" "+sShowPath;
try {
pShowProcess = Runtime.getRuntime().exec( cmdString );
@windyweather
windyweather / ImpressShowRunner_TimerCode.java
Last active April 21, 2020 18:04
Java code from example showing use of Timer and Robot to click mouse to eventually stop a running Impress Slide Show. Works on Windows 10 and Linux Mint 19.
//
// a timer task to tick down the time
// up the tics and click the mouse
//
private class MyTimerTask extends TimerTask {
@Override
public void run()
{
nTimerTics++;
tfTimerTics.setText(String.valueOf(nTimerTics));
@windyweather
windyweather / runshows.bash
Created April 10, 2020 04:03
Example Bash Script that will run a series of LibreOffice Impress slideshows in an infinite loop.
#!/bin/bash
# wait for the show named soffice to finish
# keep clicking the mouse until it ends.
function waitforshow {
sleep 5
echo "Clicking the mouse and waiting for show to end. Ctrl/C to Exit"
while pgrep soffice > /dev/null 2>&1
do
@windyweather
windyweather / X11MouseClick.cpp
Created April 9, 2020 20:32
X11MouseClick code sample from a Linux Qt application
//
// Let's try the more straightforward X11 API to click the mouse
// This example code was harvested from the internet
//
// https://www.linuxquestions.org/questions/programming-9/simulating-a-mouse-click-594576/
//
// Another link is here
// https://stackoverflow.com/questions/27984220/x11-sending-a-mouse-click-without-moving-a-pointer
#include <QMainWindow>