1

Basically I am trying to use Linux Mint to display Powerpoint presentations.

The presentations will be updated on a Windows machine, the user will then execute a script which 'refreshes' the presentation at the presentation terminals. We have this in place now, but using Windows XP, which we now have to remove because of the support ending.

The issue I am having with Mint is I don't know how I execute a script from a Windows machine, that will kill the current presentation process, transfer the latest copy of the presentation and then execute.

I have tried using plink to script this via an SSH connection but it doesn't show the presentation because it runs in the 'SSH' session rather than console.

Any ideas are much appreciated I've hit a mental wall!

Thanks

  • Based on the comments in Fabian's answer, it sounds like you have two separate questions: 1. How can I make this script to display presentations from a remote connection? and 2. How can I initiate copying these presentations from the SSH connection? The first is answered by Fabian. The second will probably require Samba to access the presentation folder over a Windows Network share. Work on getting Samba and Windows Network set up and then ask a separate question if you have problems with that (but search first!). – drs May 19 '14 at 14:33
3

I am doing some educated guesses here:

  • On the linux machine some graphical session is running, most likely an xserver.
  • Using ssh connection you are not able to access that xserver.

You can try the following:

  1. You copy the new presentation to the linux machine.
  2. Assuming your presentation program is called foo (please tell us how it is called) you can kill it using killall foo or pkill foo. This will work if you are using the correct user (or root, which you should not).
  3. You will need to set the DISPLAY variable in your ssh script to start a graphical application. Most likely the following will work (if it doesn't, see Open a window on a remote X display (why "Cannot open display")?).

    export DISPLAY=":0"
    
  4. Now you should be able to start foo again and it should display on screen.

You might want to create a script for this (make executable chmod u+x restart-foo.sh:

#!/usr/bin/env bash
# name this script
#    restart-foo.sh
pkill foo
export DISPLAY=":0"
nohup foo path/to/presentation.xxx &

You can execute this using ssh (depends on your windows ssh-client I guess) with

my-command-to-copy-the-presentation
ssh user-name@linux-machine ./restart-foo.sh
  • How would I script the copy of the presentation file though? It is located on a Windows SMB share, simply named Pres.ppt – Kyle May 19 '14 at 13:55
  • I assumed that was already solved. One option is to use the same share (linux mint can read SMB shares) and simply point there. Or you can use scp local/presentation.xxx user-name@linux-machine:presentation.xxx to copy it. – Fabian May 19 '14 at 13:59
  • Using the SCP method, how could can it automatically pass the Credentials? This will be run by end users. The result should be they execute a script Windows side, then all linux mint terminals automatically copy and start the latest presentation. – Kyle May 19 '14 at 14:07
  • Obviously you will need to trust the users (to not do intentionally harmful things). SSH supports passwordless authentication. On the windows client: You would generate a key ssh-keygen, don't use a password. You can use ssh-copy-id user-name@linux-machine to copy it to the linux machine. This will require the password once. From now on ssh and scp should work without a password from this client. – Fabian May 19 '14 at 14:11
  • I was thinking the best route would be to have most of the scripting commands to run on the Linux machine. There will be no 1 'Windows Client' and this in fact could come from many machines. Instead what I was going to use is plink, which will connect via SSH then execute a local script. The local script would then kill libre impress, copy/replace the latest presentation and then run it. – Kyle May 19 '14 at 14:16
0

If your setup allows you to save/export presentations to pdf, you could switch from libreoffice to evince for displaying presentations on your linux machine. Evince is a pdf viewer and will automatically update the view if the displayed file changes.

In your setup, all you would have to do is figure out how to copy the updated presentation to the Linux machine. Optimally, you could set it up so that the pdf is saved in a Samba share. Then the displayed pdf would be updated right when the user of the Windows computer saves it.

0

With the help of Fabian I managed to get this working using the following script:

    #!/usr/bin/env bash
mount -t cifs //10.50.18.114/Presentation -o 'username=Administrator,password=***,sec=ntlm' /mnt/share
pkill soffice.bin
cp -v /mnt/share/Pres.ppt /home/kyle/Documents
chmod 777 /home/kyle/Documents/Pres.ppt
export DISPLAY=":0"
nohup libreoffice --norestore --nolockcheck --show /home/kyle/Documents/Pres.ppt &
sessionid="$(pidof -s sshd)"
kill $sessionid
exit

I used plink to execute an 'SSH script' that automatically runs this above script as root, the kill session at the end just terminates the plink ssh session since it just hangs at the end and doesn't close properly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.