View Single Post
Old 1st November 2017
hanzer's Avatar
hanzer hanzer is offline
Real Name: Adam Jensen
just passing through
 
Join Date: Oct 2013
Location: EST USA
Posts: 307
Default

Quote:
Originally Posted by GarryR View Post
I don't usually even use the "shebang", here is a script I use to load my background image:
Code:
display -window root /home/garry/Images/backgrounds/b-background.jpg
As long as I am in my /home/garry dir, I just type in "background" and it loads the pre set image.
I do realize with the "shebang" I could make it where it runs no matter what dir I am in, but
any way, I am wondering if maybe "demifiend" or "Beastie", or anyone else for that matter,
Wondering if anyone knows how to maybe add some input option, so that it prompts me to
put in the name of the image I want as a background.
I know, maybe if I study enough on writing shell scripts, and some searching I might figure it out one day, but any way, quite often when some one shows me a actual script I learn from that as well.
Ideally, this would prompt "enter name of image" or something like that, if nothing is
entered, it would just load the image previously entered.
Thanks
This might get you started:

$HOME/bin/background
Code:
#!/bin/ksh
PS3='Pick one of the above: '
TMOUT=10
select i in list choose quit
do      case $i in 
        list)   ls ~/Images/backgrounds;;
        choose) read fname; display -window root ~/Images/backgrounds/${fname};;    
        quit)   break;;
        "")     print -u2 You must select one of the above;;
        esac
done
Reply With Quote