Skip to content

Instantly share code, notes, and snippets.

@mjkoo
Last active August 8, 2020 09:04
Show Gist options
  • Save mjkoo/0eb70888b6085b3f65f5 to your computer and use it in GitHub Desktop.
Save mjkoo/0eb70888b6085b3f65f5 to your computer and use it in GitHub Desktop.
Install Civ 5 Enhanced UI Mod on Linux
#!/usr/bin/env python2
# NOTE: Use of this script is deprecated, instead I recommend you use
#
# $ unzip -LL eui_v1_20.zip -d "$HOME/.steam/steam/SteamApps/common/Sid Meier's Civilization V/steamassets/assets/dlc"
#
# to make use of the unzip command's built-in conversion to lowercase filenames
# (thanks reddit user /u/xkero and github user Mfdas)
import os
import shutil
import sys
import tempfile
import zipfile
# Verify this is the right path on your system
DLC_DIR = '~/.steam/steam/SteamApps/common/Sid Meier\'s Civilization V/steamassets/assets/dlc'
EUI_DIR = 'UI_bc1'
if __name__ == '__main__':
# Quick and dirty argument parsing
if len(sys.argv) != 2:
print 'Usage: %s [ZIPFILE]' % sys.argv[0]
sys.exit(-1)
eui_zipfile = sys.argv[1]
try:
tempdir = tempfile.mkdtemp()
with zipfile.ZipFile(sys.argv[1], 'r') as zf:
zf.extractall(tempdir)
srcdir = os.path.join(tempdir, EUI_DIR)
dstdir = os.path.join(os.path.expanduser(DLC_DIR), EUI_DIR.lower())
shutil.copytree(srcdir, dstdir)
os.chdir(dstdir)
for root, dirnames, filenames in os.walk('.', topdown=False):
for filename in dirnames + filenames:
orig = os.path.join(root, filename)
new = orig.lower()
try:
os.renames(orig, new)
except:
pass
finally:
if tempdir:
shutil.rmtree(tempdir)
@Rukur
Copy link

Rukur commented Jul 25, 2015

On Ubuntu 15.04
DLC_DIR = '~/.steam/steam/steamapps/common/Sid Meier's Civilization V/steamassets/assets/dlc'

@AlleahSTAR
Copy link

How to use:

  1. First, make sure the script is set to be executable and that the path to the DLC directory is correct (other comments will help)
  2. Put the EUI zip with the py script in the same folder for ease.
  3. Open a terminal at the location of the two files.
  4. Drag the py file into the terminal; it will put the path to the file in the terminal.
  5. Type the full name of the EUI zip (including '.zip') after the space following the path to the py file.
  6. Hit Enter.
  7. Confirm your Steam Civ 5 DLC folder has a folder called ui_bc1
  8. Done!

Example terminal code:

If you put the files on your desktop, the text in the terminal should look something like

/home/username/Desktop/eui_install.py eui_v1_27c.zip

@chrys-the-flower
Copy link

I'm not sure if this is the right place for this, but a much easier way to do this would just unzip the original EUI zip using 'unzip -LL eui_zip.zip' which automatically forces conversion of every directory and filename to lowercase.

@mjkoo
Copy link
Author

mjkoo commented Mar 4, 2016

Thanks for the comment Mfdas, noted in comments. Definitely a better way to do it, this was discussed in the reddit thread as well.

@rpdelaney
Copy link

This also seems to work (after extracting):

convmv --lower -r -f UTF-8 --notest UI_bc1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment