Merge pull request #120 from grassmunk/plus

Complete rewrite of Chicago95 Plus in to a library
This commit is contained in:
grassmunk 2020-04-28 09:39:33 -07:00 committed by GitHub
commit d60f45fc84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 3204 additions and 1246 deletions

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 802 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 374 KiB

BIN
Plus/Chicago95_theme_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 657 KiB

BIN
Plus/Chicago95_theme_2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 418 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 761 KiB

67
Plus/ChicagoPlus.py Executable file
View File

@ -0,0 +1,67 @@
#!/usr/bin/env python3
from pluslib import ChicagoPlus
import argparse
import logging
import os
from pathlib import Path
import sys
def main():
desc = '''Chicago95 Plus! is a python script that can parse Windows 95/98/ME/XP theme files and create new Chicago95 themes. Chicago95 Plus! supports Icons, Cursors, Fonts, Wallpapers, Sounds and Theme colors! Use this against themes you can find on ThemeWorld or any site that have Microsoft Plus! Themes!\nThis script can be called from any folder, execute it and provide it the path to a theme file (e.g. %(prog)s /home/bgates/Wicked/Wicked.theme) and your new theme will be created!'''
arg_parser = argparse.ArgumentParser(description=desc,
usage='%(prog)s [options] MS_Theme_File',
epilog="Part of the Chicago95 theme project",
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
arg_parser.add_argument('-d', '--debug', help="Print lots of debugging statements", action="store_const", dest="loglevel", const=logging.DEBUG, default=logging.WARNING)
arg_parser.add_argument('-v', '--verbose', help="Be verbose", action="store_const", dest="loglevel", const=logging.INFO)
arg_parser.add_argument("--noinstall", help="Do not place folders nor change theme", action="store_true")
arg_parser.add_argument("--info", help="Prints the json conversion of the theme file", action="store_true")
arg_parser.add_argument('-c', '--colors', help='How many colors before skipping Inkscape fix/merge for SVGs. Set to 1 to speed up conversion. WARNING: This may result in transparent icons!', default=32, type=int)
arg_parser.add_argument('-o', '--overlap', help='Pixel overlap for SVG icons', default=1, type=int)
arg_parser.add_argument('-s', '--squaresize', help='Square size for SVG icons', default=20, type=int)
arg_parser.add_argument('--cursorfolder', help="Chicago95 cursor folder to convert to new theme", default=str(Path.home())+"/.icons/Chicago95_Cursor_Black")
arg_parser.add_argument('--themefolder', help="Chicago95 theme folder to convert to new theme", default=str(Path.home())+"/.themes/Chicago95")
arg_parser.add_argument('--iconsfolder', help="Chicago95 icons folder to convert to new theme", default=str(Path.home())+"/.icons/Chicago95")
arg_parser.add_argument("--installdir", help="Folder to create new theme in, default is current working directory", default=os.getcwd())
arg_parser.add_argument("--logfile", help="Filename for debug logging", default="chicago95_plus.log")
arg_parser.add_argument("theme_file", help="Microsoft Windows 95/98/ME .theme file")
specific_args = arg_parser.add_argument_group("Specific Installs")
specific_args.add_argument("--nocursors", help="Do not generate/install/enable the cursors", action="store_false")
specific_args.add_argument("--noicons", help="Do not generate/install/enable the icons", action="store_false")
specific_args.add_argument("--nowallpaper", help="Do not generate/install/enable the wallpaper", action="store_false")
specific_args.add_argument("--nosounds", help="Do not generate/install/enable the sounds", action="store_false")
specific_args.add_argument("--nocolors", help="Do not generate/install/enable the colors", action="store_false")
specific_args.add_argument("--nofonts", help="Do not generate/install/enable the fonts", action="store_false")
specific_args.add_argument("--noscreensaver", help="Do not generate/install the screensaver", action="store_false")
args = arg_parser.parse_args()
plus = ChicagoPlus(themefile=args.theme_file,
loglevel=args.loglevel,
colors=args.colors,
overlap=args.overlap,
squaresize=args.squaresize,
installdir=args.installdir,
chicago95_cursor_path=args.cursorfolder,
chicago95_theme_path=args.themefolder,
chicago95_icons_path=args.iconsfolder,
logfile=args.logfile)
print(plus.logo())
if args.info:
plus.parse_theme()
plus.print_theme_config()
sys.exit(0)
if args.noinstall:
plus.check_software(args.nocursors, args.noicons, args.colors)
plus.parse_theme()
plus.generate_theme(cursors=args.nocursors, icons=args.noicons, wallpaper=args.nowallpaper, sounds=args.nosounds, colors=args.nocolors, fonts=args.nofonts, screensaver=args.noscreensaver)
else:
plus.go(cursors=args.nocursors, icons=args.noicons, wallpaper=args.nowallpaper, sounds=args.nosounds, colors=args.nocolors, fonts=args.nofonts, screensaver=args.noscreensaver)
main()

View File

@ -1,34 +1,29 @@
# Chicago95 Plus! # Chicago95 Plus!
#### Windows Plus! Theme Conversion for XFCE/Chicago95 #### Windows Plus! Theme Conversion for XFCE/Chicago95
Is Chicago95 not authentic enough for you? Do you want to use Windows Plus! themes to personalize your Chicago95 experience? Well look no further! Is Chicago95 not authentic enough for you? Do you want to use Microsoft Plus! themes to personalize your Chicago95 experience? Well look no further!
Download any `.theme` file from the web, point `Chicago95_plus.py` at it and it will generate a wholy new theme for you to install. Download any Windows 95, 98, ME or XP theme file (from places like themeworld.com or archive.org) and use this tool to switch to your new theme!
Change Chicago95 from this:
![No Theme](Chicago95_no_theme.png)
to this!
![Themed](Chicago95_themed.png)
Currently supports: Currently supports:
* Icons * Icons (ICL, DLL and ICO files)
* Cursors * Cursors (CUR and ANI files)
* Theme colors * Theme colors
* Fonts * Fonts
* Sounds
* Wallpapers (installed to `/home/$USER/Pictures`) * Wallpapers (installed to `/home/$USER/Pictures`)
Sounds are copied to the output folder and named but arent installed yet. Sounds are installed assuming you have XFCE sounds enabled per the Chicago95 Install instructions.
To use Chicago95 Plus! on Xubuntu you need to install the following: `python3-svgwrite` `python3-fonttools` `inkscape`: `sudo apt install python3-svgwrite python3-fonttools inkscape`
By default Chicago95 Plus! creates the theme in your working folder and copies the files to their required location then automatically changes the current theme to the new theme, just like Windows! By default Chicago95 Plus! creates the theme in your working folder and copies the files to their required location then automatically changes the current theme to the new theme, just like Windows!
If you want to get more out Chicago95 Plus! it supports multiple options: If you want to get more out Chicago95 Plus! it supports multiple options:
* `--installdir DIRECTORY` generates the new theme files and outputs them to DIRECTORY * `--installdir DIRECTORY` generates the new theme files and outputs them to DIRECTORY
* `--noinstall` generates the theme files but does not move them or run the commands to switch the theme * `--noinstall` generates the theme files but does not move them or run the commands to enable the theme
* `--info` Gives verbose information about the theme file, does not do any conversion * `--info` Gives verbose information about the theme file, does not do any conversion
* `--verbose`/`--debug` gives more/way more information about what is happening * `--verbose`/`--debug` gives more/way more information about what is happening
* `--colors`/`--squaresize`/`--overlap` controls the way Icon files are converted to svg * `--colors`/`--squaresize`/`--overlap` controls the way Icon files are converted to svg
@ -36,16 +31,15 @@ If you want to get more out Chicago95 Plus! it supports multiple options:
Detailed Help output: Detailed Help output:
``` ```
Microsoft Theme file parser usage: ChicagoPlus.py [options] MS_Theme_File
usage: Chicago95_Plus.py [options] MS_Theme_File
Chicago95 Plus! is a python script that can parse Windows 95/98/ME/XP theme Chicago95 Plus! is a python script that can parse Windows 95/98/ME/XP theme
files and create new Chicago95 themes. Chicago95 Plus! supports Icons, files and create new Chicago95 themes. Chicago95 Plus! supports Icons,
Cursors, Fonts, Wallpapers and Theme colors! Use this against themes you can Cursors, Fonts, Wallpapers, Sounds and Theme colors! Use this against themes
find on ThemeWorld or any site that have Windows Plus! Themes! This script can you can find on ThemeWorld or any site that have Microsoft Plus! Themes! This
be called from any folder, execute it and provide it the path to a theme file script can be called from any folder, execute it and provide it the path to a
(e.g. Chicago95_Plus.py /home/bgates/Wicked/Wicked.theme) and your new theme theme file (e.g. ChicagoPlus.py /home/bgates/Wicked/Wicked.theme) and your new
will be created! theme will be created!
positional arguments: positional arguments:
theme_file Microsoft Windows 95/98/ME .theme file theme_file Microsoft Windows 95/98/ME .theme file
@ -55,8 +49,8 @@ optional arguments:
-d, --debug Print lots of debugging statements (default: 30) -d, --debug Print lots of debugging statements (default: 30)
-v, --verbose Be verbose (default: None) -v, --verbose Be verbose (default: None)
--noinstall Do not place folders nor change theme (default: False) --noinstall Do not place folders nor change theme (default: False)
--info Does nothing except give information about the theme --info Prints the json conversion of the theme file (default:
file (default: False) False)
-c COLORS, --colors COLORS -c COLORS, --colors COLORS
How many colors before skipping Inkscape fix/merge for How many colors before skipping Inkscape fix/merge for
SVGs. Set to 1 to speed up conversion. WARNING: This SVGs. Set to 1 to speed up conversion. WARNING: This
@ -65,19 +59,44 @@ optional arguments:
Pixel overlap for SVG icons (default: 1) Pixel overlap for SVG icons (default: 1)
-s SQUARESIZE, --squaresize SQUARESIZE -s SQUARESIZE, --squaresize SQUARESIZE
Square size for SVG icons (default: 20) Square size for SVG icons (default: 20)
--cursorfolder CURSORFOLDER
Chicago95 cursor folder to convert to new theme
(default: /home/phil/.icons/Chicago95_Cursor_Black)
--themefolder THEMEFOLDER
Chicago95 theme folder to convert to new theme
(default: /home/phil/.themes/Chicago95)
--iconsfolder ICONSFOLDER
Chicago95 icons folder to convert to new theme
(default: /home/phil/.icons/Chicago95)
--installdir INSTALLDIR --installdir INSTALLDIR
Folder to create new theme in, default is current Folder to create new theme in, default is current
working directory (default: working directory (default: /home/phil/PlusGTK)
/home/grassmunk/Themes/Chicago95/Plus) --logfile LOGFILE Filename for debug logging (default:
chicago95_plus.log)
Specific Installs:
--nocursors Do not generate/install/enable the cursors (default:
True)
--noicons Do not generate/install/enable the icons (default:
True)
--nowallpaper Do not generate/install/enable the wallpaper (default:
True)
--nosounds Do not generate/install/enable the sounds (default:
True)
--nocolors Do not generate/install/enable the colors (default:
True)
--nofonts Do not generate/install/enable the fonts (default:
True)
--noscreensaver Do not generate/install the screensaver (default:
True)
Part of the Chicago95 theme project Part of the Chicago95 theme project
``` ```
Here are two examples running Chicago95 Plus! to change the theme: Here are two examples of themes built using Chicago95 Plus!
Changing themes: ![Tiberian Sun](Chicago95_theme_1.png)
![Original to Hackerz](Chicago95_theme_1.gif) ![FRIENDS](Chicago95_theme_2.png)
![Hackers to Christmas](Chicago95_theme_2.gif)

3088
Plus/pluslib.py Normal file

File diff suppressed because it is too large Load Diff