Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 60 lines (48 sloc) 1.944 kb
#!/usr/bin/python
import commands, os
sourceFile = "usr/lib/cinnamon-settings/cinnamon-settings.py"
menuName = commands.getoutput("cat " + sourceFile + " | grep menuName")
menuName = menuName.replace("menuName", "")
menuName = menuName.replace("=", "")
menuName = menuName.replace("_(", "")
menuName = menuName.replace("\"", "")
menuName = menuName.replace(")", "")
menuName = menuName.strip()
menuComment = commands.getoutput("cat " + sourceFile + " | grep menuComment")
menuComment = menuComment.replace("menuComment", "")
menuComment = menuComment.replace("=", "")
menuComment = menuComment.replace("_(", "")
menuComment = menuComment.replace("\"", "")
menuComment = menuComment.replace(")", "")
menuComment = menuComment.strip()
desktopFile = open("usr/share/applications/cinnamon-settings.desktop", "w")
desktopFile.writelines("""[Desktop Entry]
Name=Cinnamon Settings
""")
import gettext
gettext.install("cinnamon", "/usr/share/cinnamon/locale")
for directory in os.listdir("/usr/share/cinnamon/locale"):
if os.path.isdir(os.path.join("/usr/share/cinnamon/locale", directory)):
try:
language = gettext.translation('cinnamon-settings', "/usr/share/cinnamon/locale", languages=[directory])
language.install()
desktopFile.writelines("Name[%s]=%s\n" % (directory, _(menuName)))
except:
pass
desktopFile.writelines("Comment=Fine-tune Cinnamon settings\n")
for directory in os.listdir("/usr/share/cinnamon/locale"):
if os.path.isdir(os.path.join("/usr/share/cinnamon/locale", directory)):
try:
language = gettext.translation('cinnamon-settings', "/usr/share/cinnamon/locale", languages=[directory])
language.install()
desktopFile.writelines("Comment[%s]=%s\n" % (directory, _(menuComment)))
except:
pass
desktopFile.writelines("""Exec=cinnamon-settings
Icon=preferences-system
Terminal=false
Type=Application
Encoding=UTF-8
Categories=GNOME;GTK;Settings;DesktopSettings;
StartupNotify=false
""")
Jump to Line
Something went wrong with that request. Please try again.