Change MDM theme via command line

Forum rules
Before you post please read how to get help

Change MDM theme via command line

Postby rosstimson on Sun Mar 09, 2014 5:23 pm

I'm planning on trying Mint probably (LMDE + Cinnamon) on my new laptop that arrives soon. I have used many other Linux (& BSD) distros but I've not tried Cinnamon before. As a fan of automating everything I wish to customise my OS using scripts (Chef) and cannot work out how I could change the MDM login manager theme either by the command line or by editing a config file.

I have tried a fair bit of searching on and off this forum but cannot find anything about this.

I am aware that settings such as the Cinnamon desktop wallpaper and theme can be set via commands such as:
Code: Select all
gsettings set org.cinnamon.desktop.background picture-uri 'file:///usr/share/backgrounds/my_wallpaper.jpg'

I am also aware of gconftool-2 but cannot see any relevant keys/settings to set the MDM theme. The last tool I read about was mdmsetup but this just starts a gui to set the theme which would be no good for automation. I'm not sure if you can pass arguments to set the theme without starting the gui and there is no help or man pages.

I'm sure this is relatively simple and I'm missing something obvious, any pointers in the right direction would be much appreciated.
User avatar
rosstimson
Level 1
Level 1
 
Posts: 1
Joined: Fri Mar 07, 2014 5:40 pm
Location: Newcastle upon Tyne, England

Linux Mint is funded by ads and donations.
 

Re: Change MDM theme via command line

Postby hupnuk on Mon Mar 31, 2014 11:58 am

So far i do not know of any official cli programs which can change the Mdm theme.

As a workaround i add Greeter=*themetype* and edit HtmlTheme=*htmltheme* and/or GraphicalTheme=*Gdmtheme* /etc/mdm/mdm.conf file using sed and then reload mdm using mdmflexiserver.

Below is the command for changing a GDM theme, change Arc-Wise-Userlist into whetever pleases you.

Code: Select all
if [ -e "/etc/mdm/mdm.conf" ]
   then if grep -q 'Greeter=' "/etc/mdm/mdm.conf"
      then sudo sed -i 's|Greeter=.*|Greeter=/usr/lib/mdm/mdmgreeter|' "/etc/mdm/mdm.conf"
      else sudo sed -i '/\[daemon\]/a \\nGreeter=/usr/lib/mdm/mdmgreeter' "/etc/mdm/mdm.conf"
   fi
   if grep -q 'GraphicalTheme=' "/etc/mdm/mdm.conf"
      then sudo sed -i 's|GraphicalTheme=.*|GraphicalTheme=Arc-Wise-Userlist|' "/etc/mdm/mdm.conf"
      else sudo sed -i '/\[greeter\]/a \\nGraphicalTheme=Arc-Wise-Userlist' "/etc/mdm/mdm.conf"
   fi
   sudo mdmflexiserver -l -c "UPDATE_CONFIG greeter/GraphicalTheme"
   sudo mdmflexiserver -l -c "UPDATE_CONFIG daemon/Greeter"
fi


Here is the command for changing a Html/CSS theme, replace Clouds GL into yours.

Code: Select all
if [ -e "/etc/mdm/mdm.conf" ]
   then if grep -q 'Greeter=' "/etc/mdm/mdm.conf"
      then sudo sed -i '\|Greeter=|d' "/etc/mdm/mdm.conf"
   fi
   if grep -q 'HTMLTheme=' "/etc/mdm/mdm.conf"
      then sudo sed -i 's|HTMLTheme=.*|HTMLTheme=Clouds GL|' "/etc/mdm/mdm.conf"
      else sudo sed -i '/\[greeter\]/a \\nHTMLTheme=Clouds GL' "/etc/mdm/mdm.conf"
   fi
   sudo mdmflexiserver -l -c "UPDATE_CONFIG greeter/HTMLTheme"
   sudo mdmflexiserver -l -c "UPDATE_CONFIG daemon/Greeter"
fi

Note, Html themes need to have Greeter=*themetype* gone to work, which is why i delete it using sed.

Good luck and have fun.
hupnuk
Level 1
Level 1
 
Posts: 17
Joined: Sat Mar 29, 2014 9:36 pm


Return to Themes, Icons, & Wallpaper

Who is online

Users browsing this forum: No registered users and 1 guest