Bash script to open an image when connecting to a network?
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Bash script to open an image when connecting to a network?
I have no real experience with bash ( just HTML, Javascript, Java, Perl, and Python)...but I was wondering it there was a script I could run that, when I connect to a network ( like my campus' wifi netowrk), shows an image in a window?
It's not really important of course, more curious than anything. It would be a cool custom thing I think. And besides, if there is, it could get me started using bash.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,339
Rep:
Quote:
Originally Posted by Leon14344
I have no real experience with bash ( just HTML, Javascript, Java, Perl, and Python)...but I was wondering it there was a script I could run that, when I connect to a network ( like my campus' wifi netowrk), shows an image in a window?
It's not really important of course, more curious than anything. It would be a cool custom thing I think. And besides, if there is, it could get me started using bash.
not in a graphics mode windows but text mode in the current terminal
You can easily use bash to open an image. The following works on local computer:
firefox "file:/home/joebob/MyScripts/picture.jpg"
Use firefox or whatever web browser and complete path. I think you need the double quotes, not sure. If you want to do this when you connect to a network, where would the image be? Not really sure I understand what you want.
I'm not even that sure what i want, as I was never even aware that i could do it.
I guess the pic would be in the regular Pictures folder ( using Ubuntu 8.10 and Slackware 12.2 btw), or I would place it in a "MyScripts" folder like your example shows. It doesn't really matter right now, and I could edit as I wished. I just don't know how to set something like that up in Bash.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.