Skip to content

Commit

Permalink
Added the ability to rename desktop files
Browse files Browse the repository at this point in the history
  • Loading branch information
clefebvre committed Feb 27, 2015
1 parent 9080d59 commit 5283466
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions usr/lib/linuxmint/mintSystem/mint-adjust.py
Expand Up @@ -146,6 +146,16 @@ def log (string):
categories = categories.strip()
os.system("sed -i -e 's/Categories=.*/Categories=%s/g' %s" % (categories, desktop_file))
log("%s re-categorized" % desktop_file)
elif line_items[0] == "rename":
if len(line_items) == 3:
action, desktop_file, names_file = line.split()
names_file = names_file.strip()
if os.path.exists(desktop_file) and os.path.exists(names_file):
# remove all existing names, generic names, comments
os.system("sed -i -e '/^[Name|GenericName|Comment]/d' \"%s\"" % desktop_file)
# add provided ones
os.system("cat \"%s\" >> \"%s\"" % (names_file, desktop_file))
log("%s renamed" % desktop_file)
filehandle.close()

except Exception, detail:
Expand Down

0 comments on commit 5283466

Please sign in to comment.