Change Linux Mint 19.1 theme MATE by sh [SOLVED]

About writing shell scripts and making the most of your shell
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Locked
ruyzz

Change Linux Mint 19.1 theme MATE by sh [SOLVED]

Post by ruyzz »

Hi all.
I have the following script, although it works with the terminal it does not work on sh.

Code: Select all

#!/bin/bash

 gsettings set org.mate.Marco.general theme 'Mint-X'
 gsettings set org.mate.interface icon-theme 'Mint-X'
 gsettings set org.mate.interface gtk-theme 'Mint-X'  
The previous script does not work only in the terminal.

Does anyone have a solution?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 3 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
all41
Level 19
Level 19
Posts: 9498
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: Change Linux Mint 19.1 theme MATE by sh

Post by all41 »

Does the file Properties/Permissions show set to executable?
Everything in life was difficult before it became easy.
ruyzz

Re: Change Linux Mint 19.1 theme MATE by sh

Post by ruyzz »

I call the script from another and it does not work, only from the terminal.

In the main script I put the following one.

Code: Select all

chmod +x ./script2.sh
          ./script2.sh
Has anyone solved this?
User avatar
all41
Level 19
Level 19
Posts: 9498
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: Change Linux Mint 19.1 theme MATE by sh

Post by all41 »

Code: Select all

chmod +x ./script2.sh
          ./script2.sh
Are you sure these paths are correct?
That's why I suggested checking the target file itself to see if it was indeed
executable (right-click Properties/Permissions)

I put your bash script in my /home/username directory and named it simply light.sh

the calling script:
#!/bin/bash
sh ~/light.sh

Of coarse the calling script must be executable as well.
Everything in life was difficult before it became easy.
ruyzz

Re: Change Linux Mint 19.1 theme MATE by sh

Post by ruyzz »

I did what I say but it does not work I send the two sh files. In the direction of the desktop, at the end I wrote "ok" with the echo command.

main.sh
http://www.mediafire.com/file/vfky2ky33 ... in.sh/file

ligh.sh
http://www.mediafire.com/file/lzbn6na53 ... ht.sh/file

It does not work as it indicates, only for the terminal.
User avatar
xenopeek
Level 25
Level 25
Posts: 29507
Joined: Wed Jul 06, 2011 3:58 am

Re: Change Linux Mint 19.1 theme MATE by sh

Post by xenopeek »

The command ./script2.sh would only work if the calling script's active directory is where script2.sh is found. It's better to use a full path to call the script probably.

How are you invoke the calling script though? I hope it's not something you run during boot from something in /etc directory. That obviously won't work as gsettings backend won't be up before the desktop is loaded. Also should be run as yourself, not as root or another user. That would not have access to your gsettings backend.
Image
Locked

Return to “Scripts & Bash”