Bash Background Changing Script

Hey internet people i have been trying to create a bash script that will change my desktop background, boot splash image, and the gdm3 login background. If one of you could write it for me or atleast point me in the right direction i would greatly appreciate it. Im currently running tango studio (based on debian)


Similar Content



Terminal Not Saving Settings(background, Etc.)

Hi,

I've used Mint for a year, and recently had to install the xfce desktop onto the Cinnamon edition of Mint 17.1, as the laptop it's on is just too old to handle Cinnamon as smoothly.

It seems that since then, my terminal savings, particularly the background image, haven't been saving. It just keeps reverting to a black background, and in the terminal profile preferences menu, the "background image" radio button isn't selected. I can change them from here and they work, but at best they only stay saved until my next boot of Mint.

Any idea what I can do to fix this? Other forums just seem to have given up answering. Thanks in advance!

No Such File Or Directory Error On Opening Bash

Hi folks,

I have a very basic question for you if you don't mind. Whenever I open a terminal, I get this

Code:
 bash: /etc/profile.d/touchpad.sh: No such file or directory

followed by the usual prompt.

A few weeks ago I made a script called touchpad.sh, which would run whenever I opened a terminal. In the end, I deleted it because it wasn't doing what I wanted it to do. But some file is clearly still pointing to it. I've searched high and low for the source of this error, i.e. some reference to touchpad.sh, but I cannot find it. I've looked in ~/.bashrc ~/.profile and a few other places I can't remember offhand that I found on the Internet. Can anyone tell me where this reference is most likely to be? While it doesn't cause any problems and I can still use the terminal without a problem, it's a bit annoying and considering the amount of time I've spent trying to solve this problem, I'd be most grateful if someone point me in the right direction.

I'm running Sparky Linux (Debian Jessie) 64-bit (XFCE install) with Enlightenment Desktop on Lenovo T420.

Thank you in advance.

Bash Script Non-interactive Login Shell

Hi

I'm focusing on getting my head around interactive v non-interactive shells, both non-login and login. Basically what scripts are run and how local and global variables behave.

I'm pretty much there except for 'non-interactive login shells'. I understand that 'non-interactive' shells are started when a script is run. However, if I start my script with #!/bin/bash --login, then a 'non-interactive login' shell will be started.

In my mind I would have expected this to be the same as logging in from scratch, albeit without a user\password prompt. In this case I would have thought that any exported variables from the parent shell would be blown away. This doesn't appear to be the case. The 'non-interactive login' shell appears to inherit the environment of its parent 'interactive' shell.

Can anyone explain the purpose of a 'non-interactive login' shell and how they behave in this regard.

Hope this makes sense.

Cheers

Mike

To Send A While Loop To Background

Hi All,

i got a question (noob of course), stuck with my little script when i try to send this while loop into background.

cat stogrpexport | awk 'NR>1' | while read id2 &
do
echo $id2 >> stat.out &
symstat -sid 1075 -i 5 -c 5 -dev $id2 >> stat.out &
done


symstat is a vmax storage command for stat reading which taking long time to complete. is there any better wat to re-write this loop? thanks.

Need Help To Get The Available Hosts Among Many Hosts

I have many hosts as following. But those hosts are dual operating system (Linux and Windows). I always run program background. If someone is using Linux, it is fine. But if someone is using windows or the host is offline. Then, I cannot use ssh. The way I do preiviously is first ssh one by one. And then find the hosts which are offline or windows. And write them down one by one. And then ssh to hosts except them. Let us assume the number of programs is less than the total available hosts. Can someone write a shell script to output the all available hosts to a file like "host_available"?
Here is the host file.
https://www.dropbox.com/s/vbz6w864y3...tlist.txt?dl=0
I am using ssh to connect the computers on campus. If the computer I am trying to connect is offline or using windows, the ssh will take long time, and finally it will failed. I write a shell script to generate the hostlist
Code:
#!/bin/bash
for i in `seq -w 1 28`
do
echo "c15-0330-$i.ad.mtu.edu"
# I would like to add a command here to see whether ssh c15-0330-$i.ad.mtu.edu it succeeds or not. And then output a #file which contains the all available host.
done
for i in `seq -w 1 20`
do
echo "c28-0112-$i.ad.mtu.edu"
done
for i in `seq -w 1 20`
do
echo "c28-112a-$i.ad.mtu.edu"
done

I do not how to set a certain time to see whether connection is successful or not (see the comment in the shell script).

Automating Script To Run Every Minute Through Other Manually Created User Using Crond

Hy All,

I have two nodes running RHEL 6.4 which are in cluster. I have clustered httpd service. Now I have certain application suppose X which reside in SAN partition. Now my job is to only automate this script to run by analyzing httpd status. I have successfully created the script apptrigger.sh whose content is given below,

-bash-4.1$ cat apptrigger.sh
a=0
b=0
c=0
d=0
a="service httpd status"
b=`eval $a`
##### CHECKING WHETHER HTTPD SERVICE IS RUNNING OR NOT #####
if [ "$b" != "httpd is stopped" ]; then
c="bash /switchapp/switch/ezlinkenterprise/bin/ezlink-cluster.sh status"
d=`eval $c`
##### CHECKING WHETHER EZ IS RUNNING OR NOT #####
if [ "$d" != "EzTaskMgr is Running" ]; then
ezstart
fi
fi

I have created this script in say test user. Now when I put this script to automate or run every minute through test user and defined its value in crontab -e of test user whose content is as shown below
$crontab -l
* * * * * /bin/bash /home/test/apptrigger.sh

but this script is running as root user so I cannot get the o/p
I think some environment variable need to be set. Anyone can guide me with this step? Thanks for your views and suggestion.

Bash More Commands In One Function

hello

first year of learning linux and bash script
Now i wrote a bash script with a function.
Today i recieved a email from my teacher that 1 function only can have 1 command and no more then 1?

thats a part of the script

Code:
function tx_unreachable_msg()
{
LOGLINE="[$DATE] no ip service unreachable"
typewriter "$NOIPSERVICE niet bereikbaar" .1
sleep 1 
typewriter "Mail wordt verzonden naar $email" .1
mail -s "NO ip mail error" "$email"<<EOF
dynupdate.no-ip.com niet bereikbaar @ $DATE
EOF
}

it's part dutch part english but the point is that the first LOGLINE is forbidden in the function because i use the functie to send a mail end not to write a logline but that's a part of the command in my case?

So what does this function?
If the no ip service is unreachable then it's write to /etc/var/log/no-ip and after the sleep it's send a simpel mail to the adres in the variabele mail.

i read here at the first line:
Quote:
Shell functions are a way to group commands for later execution using a single name for the group.
so is it true that my function is wrong and so no can someone point me to a website where it's say that more commands are allow in 1 function0

grts b

Autoload Python Script At Cinnamon Login

Hi
I am using Cinnamon desktop on the top of arch linux. I wanted to load a python script at desktop login which informs me about battery stats, so I created a batterymonitor.desktop entry under ~/.config/autostart. The contents of batterymonitor.desktop a
Code:
[Desktop Entry]
Type=Application
Exec=python /home/<myusername>/scripts/battery_monitor.py
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[en_US]=BatteryMonitor
Name=BatteryMonitor
Comment[en_US]=
Comment=
X-GNOME-Autostart-Delay=0

But the problem is that the script is not loading at cinnamon login. I have also confirmed that the script is executable.
Can you help to load this script at cinnamon login?
Regards

Bash Scrip Running On Remote Server

This is my script and the syntax to run this script is give ip and next will be the file or script you want to perform on remote server



#!/bin/bash

# The private key used to identify this machine
IDENTITY_KEY=/home/adnew.pem

syntax()
{
echo "Syntax: Ec2.sh server_ip scriptFile]"
echo "For example: ./Ec2.sh server_ip scriptFile"
exit 1
}

if [ $# -ne 2 ]
then
echo not enough arguments
syntax
fi


echo "Running script $2 on $1"
ssh -ttq -i $IDENTITY_KEY ec2-user@$1 sudo -i 'bash -s' < $2
exit
exit
echo "Done"



on script file i have give for testing

touch /root/test
ls /root/test
exit
exit

it makes the file but do not show the ls output by giving error


tcgetattr: Inappropriate ioctl for device

exit


what I have to do ??

How To Automatically Run A Script On Login

Good day,

I would like the following script to run automatically as soon as I log in:

Code:
#!/bin/bash
synclient TapButton1=1
syndaemon -i 1 -t -d

Is there a way to do this? Would setting up a cron job be the best option?

Any help would be most appreciated.

Thanks.