Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Batch file to open iceweasel and a onboarb keyboar
24-02-2015, 12:26 PM,
#1
Batch file to open iceweasel and a onboarb keyboar
hi there

i need help
we are trying to write a batch file to open up iceweasel and a on board keyboard . or if we can get them to run on start up that ill also work . the keyboard we are using is matchbox keyboard . if we can use a different keyboard that will be fine as-well . we need the rasberry to work on a touch screen . any ideas on this will be great

Thanks
Reply
26-02-2015, 12:08 AM,
#2
RE: Batch file to open iceweasel and a onboarb keyboar
I can't say I've done this myself with my Thin Client...but a quick google search turned up this for me:

http://ozzmaker.com/2014/06/30/virtual-k...pberry-pi/

Give Matchbox-keyboard a try and let us know if it works for you.

The changes I would make to this link I gave would be to add the bash script (batch file is only used in Windows...not Linux btw) to my autostart and also add in the starting of iceweasel:

nano ~/.config/lxsession/LXDE/autostart

And to ensure Matchbox-keyboard is available you should add at least a shortcut to the desktop to have your users restart the keyboard if need be...or you could do one better and add a crontab to your rpitc user and modify your bash script to check of Matchbox-keyboard is running...if it isn't the bash script would start it for you. Have the cron job run every minute to ensure your virtual keyboard is always up.

Good Luck!
Reply
26-02-2015, 11:08 AM,
#3
RE: Batch file to open iceweasel and a onboarb keyboar
I've tested the Florence soft keyboard, it's ok, also i've seen that in the last kernel the rpi team added the touchscreen support for some devices (egalax and evtouch if i remember well). So ill include Florence into next relese
Reply
26-02-2015, 05:03 PM,
#4
RE: Batch file to open iceweasel and a onboarb keyboar
You're the man Gibbio! Always going above and beyond! Smile
Reply
26-02-2015, 07:01 PM,
#5
RE: Batch file to open iceweasel and a onboarb keyboar
How are you automatically starting Iceweasel at boot ? Thanks in advance
Reply
26-02-2015, 07:37 PM,
#6
RE: Batch file to open iceweasel and a onboarb keyboar
(26-02-2015, 07:01 PM)Rpitcnhs Wrote: How are you automatically starting Iceweasel at boot ? Thanks in advance

I added it to my autostart. Either use nano:

nano ~/.config/lxsession/LXDE/autostart

or you can right click on the desktop, go to Configurations and select 'Change Autostart Applications'.

either way add @iceweasel to your autostart file.
Reply
26-02-2015, 09:12 PM, (This post was last modified: 26-02-2015, 09:14 PM by greavette.)
#7
RE: Batch file to open iceweasel and a onboarb keyboar
Or if you want to use a script try this one. I called my script iceweasel.sh

Code:
nano iceweasel.sh

Then add the following:

Code:
#!/bin/bash
# Check if iceweasel is running.  If not start it else get back to work!
Logfile=~/iceweasel.log
if pgrep iceweasel > /dev/null
then
        echo "$(date "+%m%d%Y %T") : iceweasel is already running.  Exiting this script" >> $Logfile
        exit 0
else
        echo "$(date "+%m%d%Y %T") : iceweasel has Stopped. Attempting to restart." >> $Logfile
        iceweasel http://google.ca
        exit 0
fi

Save this file and make it executable:

Code:
chmod +x iceweasel.sh

Now run the script to make sure it works from your terminal:

Code:
sh ./iceweasel.sh

This is where I ran into trouble (perhaps someone much smarter than me can solve this one). I tried adding this script to my autostart but my log file kept saying upon boot that iceweasel was already running. Here is what I put into autostart.

Code:
@/home/rpitc/iceweasel.sh

No dice. So I took another route and installed crontab:

Code:
sudo apt-get install cron

And I edited crontab to add in my script (no need to use sudo here):

Code:
crontab -e

At the very bottom of this file I added in the following:

Code:
*/1 * * * * export DISPLAY=:0 nohup && ~/iceweasel.sh

That did the trick. Now my script runs and starts iceweasel for me. If Iceweasel is ever down it will start again in at least 1 minute. You may not want to write out to a logfile for the duration of this cron job but for the initial setup it helps confirm if it's working or not.

Another option for you is to use kweb - http://www.raspberrypi.org/forums/viewto...66&t=40860
I've used this in testing and it was fantastic for a Pi as a Kiosk. You can probably reuse the script I provided above to help you start the kiosk browser.

I hope this helps...Good Luck!
Reply
26-02-2015, 10:51 PM,
#8
RE: Batch file to open iceweasel and a onboarb keyboar
Cant thank you enough for your reply, I look forward to implementing it tomorrow and will report back ! No doubt with more basic questions lol. I tried a few commands in different files without joy, i got it noted down ill understand more with the info youve provided, cheers again.
Reply
26-02-2015, 11:43 PM,
#9
RE: Batch file to open iceweasel and a onboarb keyboar
(26-02-2015, 07:01 PM)Rpitcnhs Wrote: How are you automatically starting Iceweasel at boot ? Thanks in advance

You need just an autostart mode for citrix webpage right?
Or something like autostart, restart if closed, fixed home page, full screen mode, no menu bars etc?
Reply
27-02-2015, 01:40 PM,
#10
RE: Batch file to open iceweasel and a onboarb keyboar
(26-02-2015, 11:43 PM)admin Wrote: You need just an autostart mode for citrix webpage right?
Or something like autostart, restart if closed, fixed home page, full screen mode, no menu bars etc?

Exactly, Citrix house UK NHS. I have a web interface site configured to launch a Desktop session after authentication to AD.

I've used an add on called Toolbar Autohide for Iceweasel but that doesn't really go far enough stoppings users browsing away from the Web Interface site, but it would do.

I removed the bars on the left and right and left the single button at the bottom with Receiver icon which launches Iceweasel when clicked, defaulting to the web interface site. But with an autostart and restart it be safe to remove that also (the button at bottom).

I was then thinking about identifying the device when users get problems, hostname for VNC (other than sticker on the monitor). Also password protecting this potentially. So I needed to work out editing the info displayed no desktop (plus putting something into the session). I'll search around later for this info.

I read elsewhere on the forum, someone just autolaunching an .ica file so was going to look into that also. So that would be configured to fire up a Desktop on the pi and depending on the configuration in the .ica either hold or don't hold a username and password.

Testing so far is very positive on the beta (key point), and I thank you again. Have had a bit of a refresh error within the session going between applications, but I think since I took the bar off of the desktop that has settled, need to use it more.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)