Cinnamon command line commands in bash

Forum rules
Before you post please read this

Cinnamon command line commands in bash

Postby teachernova370 on Thu May 29, 2014 10:47 am

First, let me give you a little background in what I am trying to do. I have a small free repair shop that helps people in my community. Our goal is to convert as many windows XP users to linux as possible. We do not charge for any service unless there is a hardware cost. It's something we believe in, so we are doing our best. We are also making it easier on the new users by making everything feel like their old xp machines. The only problem is we have more orders than we can handle. So, i have built a script and now I am trapped on the cinnamon commands. Here is what I have found on the net so far.

To change the themes:
Code: Select all
gsettings set org.cinnamon.theme name "WinXP"


To change the windows:
Code: Select all
gsettings set org.cinnamon.desktop.wm.preferences theme "WinXP"


To change the controls:
Code: Select all
gsettings set org.cinnamon.desktop.interface gtk-theme "WinXP"


To change the Startmenu:
This is what I need help on. I need to change it to a icon from a host site and replace the text Menu with Start

To change panel settings to allow cinnamon to scale the text on the pannel.
This is the final step in making the interface look and feel like their old xp machines.

Other than these two issues, The script will allow for a full install, upgrade, and install of commonly used packages, including their netflix ability. If anyone can help us on our indevor, the people of our town will thank you.
teachernova370
Level 1
Level 1
 
Posts: 2
Joined: Thu May 29, 2014 10:19 am

Linux Mint is funded by ads and donations.
 

Re: Cinnamon command line commands in bash

Postby xenopeek on Thu May 29, 2014 1:44 pm

You can install dconf-tools package to get dconf-editor, which will let you browse the settings you can set with gsettings in a nice GUI. AFAIK the settings of applets are stored in the .cinnamon/config/<applet>/<applet>.json file in each user's home folder. You can't change those with gsettings.

For name and icon of menu button that is in the file .cinnamon/config/menu@cinnamon.org/menu@cinnamon.org.json. I have a bit of example code in Python to how to automatically edit that file and change the menu button name: viewtopic.php?f=76&t=150422#p785464

The piece of code that changes the menu button name:
Code: Select all
config['menu-label']['value'] = 'MyMenuName'

So after that line you could add the following to also change the menu button icon:
Code: Select all
config['menu-icon']['value'] = '/my/path/to/an/icon.svg'

Replace /my/path/to/an/icon.svg with the full path to a svg format icon on the computer.
User avatar
xenopeek
Level 21
Level 21
 
Posts: 14804
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Cinnamon command line commands in bash

Postby teachernova370 on Thu May 29, 2014 4:42 pm

The code you present here is python code. Which sadly I don't know enough of. This is a bash script, is there a way to work with the menu icons in bash?
teachernova370
Level 1
Level 1
 
Posts: 2
Joined: Thu May 29, 2014 10:19 am

Re: Cinnamon command line commands in bash

Postby xenopeek on Fri May 30, 2014 2:44 am

Good luck with that :wink: I did it in Python because that can parse json files with a handful of lines of code. Have a look at the file .cinnamon/config/menu@cinnamon.org/menu@cinnamon.org.json and then reconsider. IDK how to do that as simple in bash (if I know at all). Python is installed by default, so why not just add a Python script and call that from your bash script? (Or use heredoc to include it in the bash file.) You can just use my script from the link and add the one line I detail above, and of course replace "/home/username" twice with the correct home folder location.

The python script is basically just three lines of code.
1. Load the json file
2. Change a value in the loaded json
3. Write the changes back to the json file
User avatar
xenopeek
Level 21
Level 21
 
Posts: 14804
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands


Return to Scripts & Bash

Who is online

Users browsing this forum: No registered users and 2 guests