diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e32aaed --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.*.swp +debian +/*.[0-9].gz diff --git a/Extras/chicago5_ie4-1.0-an+fx.xpi b/Extras/chicago5_ie4-1.0-an+fx.xpi new file mode 100644 index 0000000..9da4bc6 Binary files /dev/null and b/Extras/chicago5_ie4-1.0-an+fx.xpi differ diff --git a/INSTALL.md b/INSTALL.md index 1c8a483..a4a13fe 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -606,6 +606,11 @@ Increase taskbar size #### Adjust settings for HiDPI +Set GDK scale to 2x + + echo 'export GDK_SCALE=2' >> ~/.profile + echo 'export GDK_DPI_SCALE=0.5' >> ~/.profile + Make GTK icons bigger xfconf-query -c xsettings -p /Gtk/IconSizes -s "gtk-large-toolbar=32,32:gtk-small-toolbar=24,24:gtk-menu=32,32:gtk-dialog=88,88:gtk-button=32,32:gtk-dnd=32,32" @@ -627,9 +632,8 @@ The cursors in the theme do not support HiDPI but [Hackneyed](https://www.gnome- - Set panel row size to 48 - Application Menu: Check show button title and set it to 𝗦𝘁𝗮𝗿𝘁 (copy+paste) -- Notification Area: Set maximum icon size to 32 -- Indicator Plugin: Check square icons -- Status Notifier Plugin: Set maximum icon size to 32 +- Notification Area: Set maximum icon size to 44 +- Status Notifier Plugin: Set maximum icon size to 22 - *(Optional)* Orage Panel Clock: Set width to 144 and font to Sans 9 [[Return to Index]](#index) diff --git a/Icons/Chicago95-tux/apps/48/cd b/Icons/Chicago95-tux/apps/48/cd deleted file mode 120000 index a25ec00..0000000 --- a/Icons/Chicago95-tux/apps/48/cd +++ /dev/null @@ -1 +0,0 @@ -/home/aidan/xfce4-panel-menu.png \ No newline at end of file diff --git a/Icons/Chicago95-tux/index.theme b/Icons/Chicago95-tux/index.theme index 838326e..a5f4bd5 100644 --- a/Icons/Chicago95-tux/index.theme +++ b/Icons/Chicago95-tux/index.theme @@ -6,9 +6,9 @@ Example=folder #Directory list # actions/symbolic -# actions/22,actions/24 +# actions/22,actions/24,status/48 -Directories=actions/16,actions/32,actions/48,actions/22,actions/24,actions/scalable,animations/10,animations/16,animations/32,animations/48,animations/64,animations/128,apps/16,apps/22,apps/24,apps/32,apps/48,apps/256,apps/scalable,categories/16,categories/22,categories/24,categories/32,categories/48,categories/scalable,devices/16,devices/22,devices/24,devices/32,devices/48,devices/scalable,emblems/16,emblems/22,emblems/24,emblems/32,emblems/48,emblems/scalable,emotes/16,emotes/32,mimes/16,mimes/22,mimes/24,mimes/32,mimes/48,mimes/scalable,notifications/16,notifications/24,notifications/32,notifications/48,panel/16,panel/22,panel/24,panel/48,places/16,places/22,places/24,places/32,places/48,places/scalable,status/16,status/22,status/24,status/32,status/48,status/scalable,status/symbolic,stock/16,stock/22,stock/32,stock/48,stock/scalable,tools/22 +Directories=actions/16,actions/32,actions/48,actions/22,actions/24,actions/scalable,animations/10,animations/16,animations/32,animations/48,animations/64,animations/128,apps/16,apps/22,apps/24,apps/32,apps/48,apps/256,apps/scalable,categories/16,categories/22,categories/24,categories/32,categories/48,categories/scalable,devices/16,devices/22,devices/24,devices/32,devices/48,devices/scalable,emblems/16,emblems/22,emblems/24,emblems/32,emblems/48,emblems/scalable,emotes/16,emotes/32,mimes/16,mimes/22,mimes/24,mimes/32,mimes/48,mimes/scalable,notifications/16,notifications/24,notifications/32,notifications/48,panel/16,panel/22,panel/24,panel/48,places/16,places/22,places/24,places/32,places/48,places/scalable,status/16,status/22,status/24,status/32,status/scalable,status/symbolic,stock/16,stock/22,stock/32,stock/48,stock/scalable,tools/22 [actions/16] Size=16 diff --git a/Icons/Chicago95/index.theme b/Icons/Chicago95/index.theme index 838326e..4ae28c6 100644 --- a/Icons/Chicago95/index.theme +++ b/Icons/Chicago95/index.theme @@ -6,9 +6,9 @@ Example=folder #Directory list # actions/symbolic -# actions/22,actions/24 +# actions/22,actions/24,status/48, -Directories=actions/16,actions/32,actions/48,actions/22,actions/24,actions/scalable,animations/10,animations/16,animations/32,animations/48,animations/64,animations/128,apps/16,apps/22,apps/24,apps/32,apps/48,apps/256,apps/scalable,categories/16,categories/22,categories/24,categories/32,categories/48,categories/scalable,devices/16,devices/22,devices/24,devices/32,devices/48,devices/scalable,emblems/16,emblems/22,emblems/24,emblems/32,emblems/48,emblems/scalable,emotes/16,emotes/32,mimes/16,mimes/22,mimes/24,mimes/32,mimes/48,mimes/scalable,notifications/16,notifications/24,notifications/32,notifications/48,panel/16,panel/22,panel/24,panel/48,places/16,places/22,places/24,places/32,places/48,places/scalable,status/16,status/22,status/24,status/32,status/48,status/scalable,status/symbolic,stock/16,stock/22,stock/32,stock/48,stock/scalable,tools/22 +Directories=actions/16,actions/32,actions/48,actions/22,actions/24,actions/scalable,animations/10,animations/16,animations/32,animations/48,animations/64,animations/128,apps/16,apps/22,apps/24,apps/32,apps/48,apps/256,apps/scalable,categories/16,categories/22,categories/24,categories/32,categories/48,categories/scalable,devices/16,devices/22,devices/24,devices/32,devices/48,devices/scalable,emblems/16,emblems/22,emblems/24,emblems/32,emblems/48,emblems/scalable,emotes/16,emotes/32,mimes/16,mimes/22,mimes/24,mimes/32,mimes/48,mimes/scalable,notifications/16,notifications/24,notifications/32,notifications/48,panel/16,panel/22,panel/24,panel/48,places/16,places/22,places/24,places/32,places/48,places/scalable,status/16,status/22,status/24,status/32,status/scalable,status/symbolic,stock/16,stock/22,stock/32,stock/48,stock/scalable,tools/22 [actions/16] Size=16 diff --git a/Makefile b/Makefile index 2e43561..392b588 100644 --- a/Makefile +++ b/Makefile @@ -7,12 +7,15 @@ # History: # Usage: # Reference: +# spaces and underscores https://ftp.gnu.org/old-gnu/Manuals/make-3.79.1/html_chapter/make_6.html # Improve: # Dependencies: +# build-dpkg: txt2man APPNAME = chicago95 -APPVERSION = 0.0.2beta +APPVERSION = 2.0.1 SRCDIR = $(CURDIR) +BUILDDIR = $(CURDIR) prefix = /usr SYSCONFDIR = $(DESTDIR)/etc DEFAULTDIR = $(DESTDIR)/etc/sysconfig # for debian use '$(DESTDIR)/etc/default' @@ -24,12 +27,13 @@ DOCDIR = $(SHAREDIR)/doc/$(APPNAME) APPDIR = $(SHAREDIR)/$(APPNAME) APPSDIR = $(SHAREDIR)/applications ICONSDIR = $(SHAREDIR)/icons -MIMEDIR = $(SHAREDIR)/mime +MIMEDIR = $(SHAREDIR)/mime/packages MANDIR = $(SHAREDIR)/man XDGAUTODIR = $(SYSCONFDIR)/xdg/autostart FONTDIR = $(SHAREDIR)/fonts THEMESDIR = $(SHAREDIR)/themes SOUNDSDIR = $(SHAREDIR)/sounds +BKGDSDIR = $(SHAREDIR)/backgrounds/Chicago95 awkbin :=$(shell which awk) chmodbin :=$(shell which chmod) @@ -47,23 +51,49 @@ sortbin :=$(shell which sort) truebin :=$(shell which true) uniqbin :=$(shell which uniq) xargsbin :=$(shell which xargs) +txt2manbin :=$(shell which txt2man) -.PHONY: clean install install_files build_man uninstall list deplist deplist_opts +use_underscores ?= NO + +.PHONY: clean install install_files build_man uninstall list deplist deplist_opts build_man + +nullstring := +space :=\ $(nullstring)# end of the line +ifeq ($(use_underscores),YES) +space = _ +endif + +all: build_man list: @$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | ${awkbin} -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | ${sortbin} | ${grepbin} -E -v -e '^[^[:alnum:]]' -e '^$@$$' +build_man: + @# these man pages are installed with install_plus + @test -d ${BUILDDIR} || mkdir -p ${BUILDDIR} + ${txt2manbin} -P chicago95-theme-plus -r chicago95-theme-plus -d "June 2020" -t "PlusGUI" -s 1 -v "General Commands Manual" < ${SRCDIR}/Plus/PlusGUI.1.txt | ${gzipbin} > ${BUILDDIR}/PlusGUI.1.gz + ${txt2manbin} -P chicago95-theme-plus -r chicago95-theme-plus -d "June 2020" -t "Chicago95" -s 1 -v "General Commands Manual" < ${SRCDIR}/Plus/ChicagoPlus.1.txt | ${gzipbin} > ${BUILDDIR}/ChicagoPlus.1.gz + install: install_all -install_all: install_cursors install_doc install_fonts install_greeter install_gtk_theme install_icons install_login_sound install_boot_screen +.PHONY: install_cursors install_doc install_fonts install_gtk_theme install_icons install_sounds install_login_sound install_boot_screen install_plus install_backgrounds +install_all: install_cursors install_doc install_fonts install_gtk_theme install_icons install_sounds install_login_sound install_boot_screen install_plus install_backgrounds install_cursors: - ${installbin} -dm0755 ${ICONSDIR}/Chicago95_Cursor_Black \ + ${installbin} -dm0755 \ + ${ICONSDIR}/Chicago95$(space)Animated$(space)Hourglass$(space)Cursors \ + ${ICONSDIR}/Chicago95_Cursor_Black \ ${ICONSDIR}/Chicago95_Cursor_White \ - ${ICONSDIR}/Chicago95_Emerald + ${ICONSDIR}/Chicago95_Emerald \ + ${ICONSDIR}/Chicago95$(space)Standard$(space)Cursors$(space)Black \ + ${ICONSDIR}/Chicago95$(space)Standard$(space)Cursors \ + + ${cpbin} -pr ${SRCDIR}/Cursors/Chicago95\ Animated\ Hourglass\ Cursors/* ${ICONSDIR}/Chicago95$(space)Animated$(space)Hourglass$(space)Cursors ${cpbin} -pr ${SRCDIR}/Cursors/Chicago95_Cursor_Black/* ${ICONSDIR}/Chicago95_Cursor_Black ${cpbin} -pr ${SRCDIR}/Cursors/Chicago95_Cursor_White/* ${ICONSDIR}/Chicago95_Cursor_White ${cpbin} -pr ${SRCDIR}/Cursors/Chicago95_Emerald/* ${ICONSDIR}/Chicago95_Emerald + ${cpbin} -pr ${SRCDIR}/Cursors/Chicago95\ Standard\ Cursors/* ${ICONSDIR}/Chicago95$(space)Standard$(space)Cursors + ${cpbin} -pr ${SRCDIR}/Cursors/Chicago95\ Standard\ Cursors\ Black/* ${ICONSDIR}/Chicago95$(space)Standard$(space)Cursors$(space)Black ${findbin} ${ICONSDIR}/Chicago95* ! -type d -exec ${chmodbin} 0644 {} + install_doc: @@ -72,54 +102,86 @@ install_doc: @# rename a few files ${installbin} -m0644 ${SRCDIR}/Plymouth/Readme.md ${DOCDIR}/Plymouth-readme.md ${installbin} -m0644 ${SRCDIR}/Lightdm/Chicago95/README.md ${DOCDIR}/Lightdm-readme.md + ${installbin} -m0644 -t ${DOCDIR} ${SRCDIR}/Extras/post_install.txt install_fonts: ${installbin} -dm0755 ${FONTDIR}/truetype ${installbin} -m0644 -t ${FONTDIR}/truetype ${SRCDIR}/Fonts/vga_font/*ttf -install_greeter: - ${installbin} -dm0755 ${SHAREDIR}/lightdm-webkit/themes - ${cpbin} -pr ${SRCDIR}/Lightdm/Chicago95 ${SHAREDIR}/lightdm-webkit/themes/ - ${findbin} ${SHAREDIR}/lightdm-webkit/themes/Chicago95 ! -type d -exec ${chmodbin} 0644 {} + - install_gtk_theme: ${installbin} -dm0755 ${THEMESDIR} ${cpbin} -pr ${SRCDIR}/Theme/Chicago95 ${THEMESDIR} ${rmbin} -r ${THEMESDIR}/Chicago95/misc - ${findbin} ${THEMESDIR}/Chicago95 ! -type d -exec ${chmodbin} 0644 {} + + ${findbin} ${THEMESDIR}/Chicago95 ! -type d -exec ${chmodbin} 0644 {} + || : + ${findbin} ${THEMESDIR}/Chicago95 -type d -exec ${chmodbin} 0755 {} + || : @# xfce4-terminal theme ${installbin} -dm0755 ${SHAREDIR}/xfce4/terminal/colorschemes ${installbin} -m0644 -t ${SHAREDIR}/xfce4/terminal/colorschemes ${SRCDIR}/Extras/Chicago95.theme + @# panel profile + ${installbin} -dm0755 ${SHAREDIR}/xfce4-panel-profiles/layouts + ${installbin} -m0644 -t ${SHAREDIR}/xfce4-panel-profiles/layouts ${SRCDIR}/Extras/Chicago95_Panel_Preferences.tar.bz2 install_icons: ${installbin} -dm0755 ${ICONSDIR} ${cpbin} -pr ${SRCDIR}/Icons/* ${ICONSDIR}/ ${findbin} ${ICONSDIR}/Chicago95* ! -type d ! -type l -exec ${chmodbin} 0644 {} + +install_sounds: + ${installbin} -dm0755 ${SOUNDSDIR}/Chicago95/stereo + ${installbin} -m0644 -t ${SOUNDSDIR}/Chicago95/stereo ${SRCDIR}/sounds/Chicago95/stereo/* + ${installbin} -m0644 -t ${SOUNDSDIR}/Chicago95 ${SRCDIR}/sounds/Chicago95/index.theme + install_login_sound: - ${installbin} -dm0755 ${SOUNDSDIR}/Chicago95 - # pending addition of debian/chicago95-startup.desktop to source ${XDGAUTODIR} + ${installbin} -dm0755 ${SOUNDSDIR}/Chicago95 ${XDGAUTODIR} ${installbin} -m0644 ${SRCDIR}/Extras/Microsoft\ Windows\ 95\ Startup\ Sound.ogg ${SOUNDSDIR}/Chicago95/startup.ogg - # pending addition of debian/chicago95-startup.desktop to source ${XDGAUTODIR} - #${installbin} -m0644 -t ${XDGAUTODIR} ${SRCDIR}/Extras/chicago95-startup.desktop + ${installbin} -m0644 -t ${XDGAUTODIR} ${SRCDIR}/sounds/chicago95-startup.desktop install_boot_screen: ${installbin} -dm0755 ${SHAREDIR}/plymouth/themes/Chicago95 ${SHAREDIR}/plymouth/themes/RetroTux ${installbin} -m0644 -t ${SHAREDIR}/plymouth/themes/Chicago95 ${SRCDIR}/Plymouth/Chicago95/* ${installbin} -m0644 -t ${SHAREDIR}/plymouth/themes/RetroTux ${SRCDIR}/Plymouth/RetroTux/* +install_plus: + ${installbin} -dm0755 ${SHAREDIR}/chicago95-theme-plus/assets ${BINDIR} ${LIBEXECDIR}/chicago95-theme-plus ${DOCDIR}/demo ${APPSDIR} ${MIMEDIR} ${MANDIR}/man1 + ${installbin} -m0644 -t ${SHAREDIR}/chicago95-theme-plus/assets ${SRCDIR}/Plus/assets/* + ${installbin} -m0755 ${SRCDIR}/Plus/ChicagoPlus.py ${BINDIR}/ChicagoPlus + ${installbin} -m0755 ${SRCDIR}/Plus/PlusGUI.py ${BINDIR}/PlusGUI + ${installbin} -m0644 -t ${LIBEXECDIR}/chicago95-theme-plus ${SRCDIR}/Plus/pluslib.py ${SRCDIR}/Plus/plus.glade + ${installbin} -m0644 ${SRCDIR}/Plus/README.MD ${DOCDIR}/Plus-README.MD + ${installbin} -m0644 -t ${DOCDIR} ${SRCDIR}/Plus/*.png + ${installbin} -m0644 -t ${DOCDIR}/demo ${SRCDIR}/Plus/demo/* + ${installbin} -m0644 -t ${APPSDIR} ${SRCDIR}/Plus/*.desktop + ${installbin} -m0644 -t ${MIMEDIR} ${SRCDIR}/Plus/chicago95-plus-theme.xml + ${installbin} -m0644 -t ${MANDIR}/man1 ${BUILDDIR}/*.1.gz + +install_backgrounds: + ${installbin} -dm0755 ${BKGDSDIR}/patterns ${BKGDSDIR}/wallpapers + ${installbin} -m0644 -t ${BKGDSDIR}/patterns ${SRCDIR}/Extras/Backgrounds/Patterns/* + ${installbin} -m0644 -t ${BKGDSDIR}/wallpapers ${SRCDIR}/Extras/Backgrounds/Wallpaper/* + uninstall: - ${rmbin} -r ${ICONSDIR}/Chicago95_Cursor_Black \ + ${rmbin} -rf \ + ${ICONSDIR}/Chicago95$(space)Animated$(space)Hourglass$(space)Cursors \ + ${ICONSDIR}/Chicago95_Cursor_Black \ ${ICONSDIR}/Chicago95_Cursor_White \ ${ICONSDIR}/Chicago95_Emerald \ + ${ICONSDIR}/Chicago95$(space)Standard$(space)Cursors$(space)Black \ + ${ICONSDIR}/Chicago95$(space)Standard$(space)Cursors \ ${DOCDIR} \ ${FONTDIR}/truetype/LessPerfectDOSVGA.ttf \ ${FONTDIR}/truetype/MorePerfectDOSVGA.ttf \ ${SHAREDIR}/lightdm-webkit/themes/Chicago95 \ ${THEMESDIR}/Chicago95 ${SHAREDIR}/xfce4/terminal/colorschemes/Chicago95.theme \ + ${SHAREDIR}/xfce4-panel-profiles/layouts/Chicago95_Panel_Preferences.tar.bz2 \ ${ICONSDIR}/Chicago95 ${ICONSDIR}/Chicago95-tux \ ${SOUNDSDIR}/Chicago95 \ - ${SHAREDIR}/plymouth/themes/Chicago95 ${SHAREDIR}/plymouth/themes/RetroTux 2>/dev/null || : + ${LIBEXECDIR}/chicago95-theme-plus ${BINDIR}/ChicagoPlus ${BINDIR}/PlusGUI \ + ${SHAREDIR}/chicago95-theme-plus \ + ${APPSDIR}/PlusGUI.desktop ${MIMEDIR}/chicago95-plus-theme.xml \ + ${MANDIR}/man1/ChicagoPlus.1.gz ${MANDIR}/man1/PlusGUI.1.gz \ + ${SHAREDIR}/plymouth/themes/Chicago95 ${SHAREDIR}/plymouth/themes/RetroTux \ + ${BKGDSDIR} \ + ${XDGAUTODIR}/chicago95-startup.desktop clean: - -@${echobin} "target $@ not implemented yet! Gotta say unh." && ${falsebin} + -${rmbin} ${BUILDDIR}/*.1.gz diff --git a/Plus/ChicagoPlus.1.txt b/Plus/ChicagoPlus.1.txt new file mode 100644 index 0000000..672075e --- /dev/null +++ b/Plus/ChicagoPlus.1.txt @@ -0,0 +1,45 @@ +NAME + ChicagoPlus - convert Windows 95 theme to Xfce theme +SYNOPSIS + ChicagoPlus [options] _filename_ +OPTIONS + Theme file to convert + -h, --help show help message and exit + -d, --debug Print lots of debugging statements (default: 30) + -v, --verbose Be verbose (default: None) + --noinstall Do not place folders nor change theme (default: False) + --info Prints the json conversion of the theme file (default: False) + + -c COLORS, --colors COLORS 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) + + -o OVERLAP, --overlap OVERLAP Pixel overlap for SVG icons (default: 1) + + -s SQUARESIZE, --squaresize SQUARESIZE Square size for SVG icons (default: 20) + + --cursorfolder CURSORFOLDER Chicago95 cursor folder to convert to new theme (default: ~/.icons/Chicago95_Cursor_Black) + + --themefolder THEMEFOLDER Chicago95 theme folder to convert to new theme (default: ~/.themes/Chicago95) + + --iconsfolder ICONSFOLDER Chicago95 icons folder to convert to new theme (default: ~/.icons/Chicago95) + + --installdir INSTALLDIR Folder to create new theme in, default is current working directory (default: . ) + + --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) +DESCRIPTION + 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! This script can be called from any folder, execute it and provide it the path to a theme file (e.g. ChicagoPlus /home/bgates/Wicked/Wicked.theme) and your new theme will be created! +AUTHOR + grassmunk, adapted as a manpage by bgstack15 +COPYRIGHT + GPL 3.0+ +SEE ALSO +PlusGUI(1) diff --git a/Plus/ChicagoPlus.py b/Plus/ChicagoPlus.py index 397aa45..65a7133 100755 --- a/Plus/ChicagoPlus.py +++ b/Plus/ChicagoPlus.py @@ -1,11 +1,11 @@ #!/usr/bin/env python3 +import sys from pluslib import ChicagoPlus import argparse import logging import os from pathlib import Path -import sys def main(): diff --git a/Plus/PlusGUI.1.txt b/Plus/PlusGUI.1.txt new file mode 100644 index 0000000..e1ca8c9 --- /dev/null +++ b/Plus/PlusGUI.1.txt @@ -0,0 +1,33 @@ +NAME + PlusGUI - gtk frontend for converting Windows 95 theme to Xfce theme +SYNOPSIS + PlusGUI [options] _filename_ +OPTIONS + Theme file to convert + -h, --help show help message and exit + -d, --debug Print lots of debugging statements (default: 30) + -v, --verbose Be verbose (default: None) + + -c COLORS, --colors COLORS 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) + + -o OVERLAP, --overlap OVERLAP Pixel overlap for SVG icons (default: 1) + + -s SQUARESIZE, --squaresize SQUARESIZE Square size for SVG icons (default: 20) + + --cursorfolder CURSORFOLDER Chicago95 cursor folder to convert to new theme (default: ~/.icons/Chicago95_Cursor_Black) + + --themefolder THEMEFOLDER Chicago95 theme folder to convert to new theme (default: ~/.themes/Chicago95) + + --iconsfolder ICONSFOLDER Chicago95 icons folder to convert to new theme (default: ~/.icons/Chicago95) + + --installdir INSTALLDIR Folder to create new theme in, default is current working directory (default: . ) + + --logfile LOGFILE Filename for debug logging (default: chicago95_plus.log) +DESCRIPTION + Display a graphical window to choose, preview, and build Xfce themes. PlusGUI looks identical to the Microsoft Plus! 95 "Desktop Themes" utility. +AUTHOR + grassmunk, adapted as a manpage by bgstack15 +COPYRIGHT + GPL 3.0+ +SEE ALSO +ChicagoPlus(1) diff --git a/Plus/PlusGUI.desktop b/Plus/PlusGUI.desktop new file mode 100644 index 0000000..e8bb919 --- /dev/null +++ b/Plus/PlusGUI.desktop @@ -0,0 +1,14 @@ +[Desktop Entry] +Categories=Settings;DesktopSettings; +Comment=Import Windows .theme files +Exec=/usr/bin/PlusGUI %f +GenericName=Windows theme importer +Icon=preferences-desktop-theme +Keywords=theme;import; +MimeType=application/x-plus-theme; +Name=Chicago95 Plus! +Path=/tmp +StartupNotify=true +Terminal=false +Type=Application +Version=1.0 diff --git a/Plus/PlusGUI.py b/Plus/PlusGUI.py index f266cf2..8c52edc 100755 --- a/Plus/PlusGUI.py +++ b/Plus/PlusGUI.py @@ -1,8 +1,8 @@ #!/usr/bin/env python3 +import sys from pluslib import ChicagoPlus import logging -import sys from pathlib import Path from PIL import Image, ImageFont, ImageDraw, ImageEnhance, ImageOps from pprint import pprint @@ -21,6 +21,16 @@ gi.require_version("Gtk", "3.0") from gi.repository import Gtk, GdkPixbuf, GLib running_folder = os.path.dirname(os.path.abspath(__file__)) +share_dir = running_folder +libexec_dir = running_folder +work_dir = running_folder +if not os.path.exists(work_dir): + os.makedirs(work_dir) + +c95_packaged_cursor_path=str(Path.home())+"/.icons/Chicago95_Cursor_Black" +c95_packaged_theme_path=str(Path.home())+"/.themes/Chicago95" +c95_packaged_icons_path=str(Path.home())+"/.icons/Chicago95" + #print("Font List...", end=' ', flush=True) fonts_output = subprocess.check_output(['convert', '-list', 'font']) fonts = fonts_output.decode().split('\n') @@ -141,18 +151,18 @@ class MakePreview: print("[MakePreview] Preview Generated") def return_preview(self): - self.preview_window.save(running_folder+"/preview.png", "PNG") - return(running_folder+"/preview.png") + self.preview_window.save(work_dir+"/preview.png", "PNG") + return(work_dir+"/preview.png") def return_preview_double(self): - self.preview_window.save(running_folder+"/preview_double.png", "PNG") - return(running_folder+"/preview_double.png") + self.preview_window.save(work_dir+"/preview_double.png", "PNG") + return(work_dir+"/preview_double.png") def delete_preview(self): - os.remove(running_folder+"/preview.png") + os.remove(work_dir+"/preview.png") def delete_preview_double(self): - os.remove(running_folder+"/preview_double.png") + os.remove(work_dir+"/preview_double.png") def set_fonts(self): print("[MakePreview] Fonts...", end=' ') @@ -239,7 +249,7 @@ class MakePreview: draw.line([(button_width - 6, 4),(button_width - 6, button_height-5)],fill=colors['buttontext'], width=1) self.max_button = img elif button == 'close': - X = Image.open(running_folder+"/assets/X.png").convert('RGBA') + X = Image.open(share_dir+"/assets/X.png").convert('RGBA') pixels = X.load() rgb = struct.unpack('BBB',bytes.fromhex(colors['buttontext'].lstrip('#'))) for i in range(X.size[0]): @@ -305,17 +315,17 @@ class MakePreview: if self.plus.theme_config['icons']['my_computer']: self.my_computer = self.make_icons(self.plus,'my_computer') else: - self.my_computer = Image.open(running_folder+"/assets/my_computer~.png").convert('RGBA') + self.my_computer = Image.open(share_dir+"/assets/my_computer~.png").convert('RGBA') if self.plus.theme_config['icons']['network_neighborhood']: self.network_neighborhood= self.make_icons(self.plus,'network_neighborhood') else: - self.network_neighborhood = Image.open(running_folder+"/assets/network_neighborhood~.png").convert('RGBA') + self.network_neighborhood = Image.open(share_dir+"/assets/network_neighborhood~.png").convert('RGBA') if self.plus.theme_config['icons']['recycle_bin_empty']: self.recycle_bin_empty = self.make_icons(self.plus,'recycle_bin_empty') else: - self.recycle_bin_empty = Image.open(running_folder+"/assets/recycle_bin_empty~.png").convert('RGBA') + self.recycle_bin_empty = Image.open(share_dir+"/assets/recycle_bin_empty~.png").convert('RGBA') if self.plus.theme_config['icons']['my_documents']: self.my_documents = self.make_icons(self.plus,'my_documents') @@ -704,7 +714,7 @@ class MakePreview: def make_icons(self, plus, ico_name): - icon = running_folder+"/assets/" + ico_name+"~"+".png" + icon = share_dir+"/assets/" + ico_name+"~"+".png" if plus.theme_config['icons'][ico_name]['type'] in ['dll', 'icl']: index = plus.theme_config['icons'][ico_name]['index'] @@ -713,12 +723,12 @@ class MakePreview: icon_filename, icon_file = plus.get_icons_size_dll(icon_files, index) if icon_filename: - f = open(running_folder+"/tmp/tmp_"+icon_filename,"wb") + f = open(work_dir+"/tmp_"+icon_filename,"wb") f.write(icon_file) f.close() - icon = running_folder+"/tmp/tmp_"+icon_filename + icon = work_dir+"/tmp_"+icon_filename else: - icon = running_folder+"/assets/" + ico_name+"~"+".png" + icon = share_dir+"/assets/" + ico_name+"~"+".png" else: icon_files = plus.extract_ico(plus.theme_config['icons'][ico_name]['path']) @@ -741,7 +751,7 @@ class MakePreview: icon_image = Image.open(ico_name+".png").convert('RGBA') os.remove(ico_name+".png") except subprocess.CalledProcessError: - icon_image = Image.open(running_folder+"/assets/" + ico_name+"~.png").convert('RGBA') + icon_image = Image.open(share_dir+"/assets/" + ico_name+"~.png").convert('RGBA') return icon_image @@ -752,9 +762,9 @@ class MakePreview: class plusGTK: def __init__(self, themefile=False, colors=32, overlap=1, squaresize=20, installdir=os.getcwd(), - chicago95_cursor_path=str(Path.home())+"/.icons/Chicago95_Cursor_Black", - chicago95_theme_path=str(Path.home())+"/.themes/Chicago95", - chicago95_icons_path=str(Path.home())+"/.icons/Chicago95", + chicago95_cursor_path=c95_packaged_cursor_path, + chicago95_theme_path=c95_packaged_theme_path, + chicago95_icons_path=c95_packaged_icons_path, loglevel=logging.WARNING, logfile='plus.log'): @@ -798,7 +808,7 @@ class plusGTK: # GTK Initialization self.builder = builder = Gtk.Builder() - self.builder.add_from_file(running_folder+"/plus.glade") + self.builder.add_from_file(libexec_dir+"/plus.glade") self.window = self.builder.get_object("Main") self.preview = self.builder.get_object("preview") self.builder.connect_signals(self.handlers) @@ -943,22 +953,22 @@ class plusGTK: def other_previews(self, button): - checkmark = GdkPixbuf.Pixbuf.new_from_file(running_folder+"/assets/check.png") - nocheckmark = GdkPixbuf.Pixbuf.new_from_file(running_folder+"/assets/blank-check.png") + checkmark = GdkPixbuf.Pixbuf.new_from_file(share_dir+"/assets/check.png") + nocheckmark = GdkPixbuf.Pixbuf.new_from_file(share_dir+"/assets/blank-check.png") self.previews_window = self.builder.get_object("Preview Window") self.cursor_preview = self.builder.get_object("cursor_preview") - self.cursor_preview.set_from_file(running_folder+"/assets/blank-check.png") + self.cursor_preview.set_from_file(share_dir+"/assets/blank-check.png") self.icon_preview = self.builder.get_object("icon_preview") - self.icon_preview.set_from_file(running_folder+"/assets/blank-check.png") + self.icon_preview.set_from_file(share_dir+"/assets/blank-check.png") self.sound_preview = self.builder.get_object("sound_preview") - self.sound_preview.set_from_file(running_folder+"/assets/blank-check.png") + self.sound_preview.set_from_file(share_dir+"/assets/blank-check.png") self.cursor_preview = self.builder.get_object("cursor_preview") - self.cursor_preview.set_from_file(running_folder+"/assets/blank-check.png") + self.cursor_preview.set_from_file(share_dir+"/assets/blank-check.png") # Populate cursor preview self.cursor_store = self.builder.get_object("cursor_list") @@ -992,40 +1002,40 @@ class plusGTK: for icon in ani_file_config['icon']: if icon['index'] == sequence: cur_filename = current_cursor+"_"+str(sequence) - f = open(running_folder+"/tmp/"+cur_filename+".cur","wb") + f = open(work_dir+"/"+cur_filename+".cur","wb") f.write(icon['ico_file']) f.close() convert_args.append("-delay") convert_args.append("{}x60".format(rate)) - convert_args.append(running_folder+"/tmp/"+cur_filename+".cur") + convert_args.append(work_dir+"/"+cur_filename+".cur") else: for icon in ani_file_config['icon']: rate = ani_file_config['anih']['iDispRate'] + 5 cur_filename = current_cursor+"_"+str(icon['index']) - f = open(running_folder+"/tmp/"+cur_filename+".cur","wb") + f = open(work_dir+"/"+cur_filename+".cur","wb") f.write(icon['ico_file']) f.close() convert_args.append("-delay") convert_args.append("{}x60".format(rate)) - convert_args.append(running_folder+"/tmp/"+cur_filename+".cur") + convert_args.append(work_dir+"/"+cur_filename+".cur") convert_args.append("-loop") convert_args.append("0") - convert_args.append(running_folder+"/tmp/"+current_cursor+".gif") + convert_args.append(work_dir+"/"+current_cursor+".gif") # pprint(convert_args) try: subprocess.check_call(convert_args) except: - copyfile(running_folder+"/assets/blank-check.png", running_folder+"/tmp/"+current_cursor+".gif") + copyfile(share_dir+"/assets/blank-check.png", work_dir+"/"+current_cursor+".gif") else: cursor_file_config = self.theme.extract_cur(filename) icon_file = cursor_file_config['icon'][0]['ico_file'] - f = open(running_folder+"/tmp/"+current_cursor+".cur","wb") + f = open(work_dir+"/"+current_cursor+".cur","wb") f.write(icon_file) f.close() try: - subprocess.check_call(['convert', running_folder+"/tmp/"+current_cursor+".cur", running_folder+"/tmp/"+current_cursor+".gif"]) + subprocess.check_call(['convert', work_dir+"/"+current_cursor+".cur", work_dir+"/"+current_cursor+".gif"]) except: - copyfile(running_folder+"/assets/blank-check.png", running_folder+"/tmp/"+current_cursor+".gif") + copyfile(share_dir+"/assets/blank-check.png", work_dir+"/"+current_cursor+".gif") if not self.in_store(self.cursor_store, pointers[current_cursor]): self.cursor_store.append([checkmark,pointers[current_cursor]]) @@ -1062,7 +1072,7 @@ class plusGTK: self.icon_store[loc][0] = nocheckmark else: icon_image = self.preview_image.make_icons(self.theme, icon) - icon_image.save(running_folder+"/tmp/"+icon+".png", "PNG") + icon_image.save(work_dir+"/"+icon+".png", "PNG") if not self.in_store(self.icon_store, icons[icon]): self.icon_store.append([checkmark,icons[icon]]) else: @@ -1116,10 +1126,10 @@ class plusGTK: for cursor in pointers: if pointers[cursor] == model[row][1]: if cursor in self.theme_config['cursors'] and self.theme_config['cursors'][cursor] is not False: - self.cursor_preview.set_from_file(running_folder+"/tmp/"+cursor+".gif") + self.cursor_preview.set_from_file(work_dir+"/"+cursor+".gif") self.cursor_text_path.set_text(self.theme_config['cursors'][cursor]['path']) else: - self.cursor_preview.set_from_file(running_folder+"/assets/blank-check.png") + self.cursor_preview.set_from_file(share_dir+"/assets/blank-check.png") self.cursor_text_path.set_text("") break @@ -1131,27 +1141,27 @@ class plusGTK: if model[row][1] == "Wallpaper bitmap": if self.theme_config['wallpaper'] and self.theme_config['wallpaper']['theme_wallpaper']: self.icon_text_path.set_text(self.theme_config['wallpaper']['theme_wallpaper']['path']) - self.icon_preview.set_from_file(running_folder+"/assets/blank-check.png") + self.icon_preview.set_from_file(share_dir+"/assets/blank-check.png") else: - self.icon_preview.set_from_file(running_folder+"/assets/blank-check.png") + self.icon_preview.set_from_file(share_dir+"/assets/blank-check.png") self.icon_text_path.set_text("") return if model[row][1] == "Screen saver": if self.theme_config['screensaver'] : self.icon_text_path.set_text(self.theme_config['screensaver']) - self.icon_preview.set_from_file(running_folder+"/assets/blank-check.png") + self.icon_preview.set_from_file(share_dir+"/assets/blank-check.png") else: - self.icon_preview.set_from_file(running_folder+"/assets/blank-check.png") + self.icon_preview.set_from_file(share_dir+"/assets/blank-check.png") self.icon_text_path.set_text("") return for icon in icons: #print(icon, icons[icon], model[row][1]) if icons[icon] == model[row][1]: if self.theme_config['icons'][icon] is not False: - self.icon_preview.set_from_file(running_folder+"/tmp/"+icon+".png") + self.icon_preview.set_from_file(work_dir+"/"+icon+".png") self.icon_text_path.set_text(self.theme_config['icons'][icon]['path']) else: - self.icon_preview.set_from_file(running_folder+"/assets/blank-check.png") + self.icon_preview.set_from_file(share_dir+"/assets/blank-check.png") self.icon_text_path.set_text("") break @@ -1239,9 +1249,9 @@ def main(): 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('--cursorfolder', help="Chicago95 cursor folder to convert to new theme", default=c95_packaged_cursor_path) + arg_parser.add_argument('--themefolder', help="Chicago95 theme folder to convert to new theme", default=c95_packaged_theme_path) + arg_parser.add_argument('--iconsfolder', help="Chicago95 icons folder to convert to new theme", default=c95_packaged_icons_path) 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", nargs="?",default=False) diff --git a/Plus/chicago95-plus-theme.xml b/Plus/chicago95-plus-theme.xml new file mode 100644 index 0000000..48308e0 --- /dev/null +++ b/Plus/chicago95-plus-theme.xml @@ -0,0 +1,12 @@ + + + + + + + + Chicago95 Plus! theme + + + + diff --git a/Plus/pluslib.py b/Plus/pluslib.py index 1abbe0e..2a4219a 100644 --- a/Plus/pluslib.py +++ b/Plus/pluslib.py @@ -38,6 +38,13 @@ from fontTools import ttLib from configparser import ConfigParser from PIL import BmpImagePlugin, PngImagePlugin, Image +running_folder = os.path.dirname(os.path.abspath(__file__)) +share_dir = running_folder +libexec_dir = running_folder +work_dir = running_folder +if not os.path.exists(work_dir): + os.makedirs(work_dir) + SCREEN_SAVER_SCRIPT = '''#!/bin/sh # *** DEPENDS ON xprintidle AND wmctrl AND wine *** @@ -1533,7 +1540,7 @@ class ChicagoPlus: self.logger.debug("{:<21} | Colors: ButtonDKShadow={}, ButtonLight={}, ButtonShadow={}, ButtonHilight={}, ButtonFace={}, ButtonText={} ".format("Colors",ButtonDKShadow, ButtonLight, ButtonShadow, ButtonHilight, ButtonFace, ButtonText)) - for i in ['gtk-3.0/','gtk-3.24/']: + for i in ['gtk-3.0/']: folder = path + i + "buttons/" @@ -2358,7 +2365,7 @@ class ChicagoPlus: return cursor - def convert_icon(self, target_folder, icon_file_path, tmp_file="./chicago95_tmp_file.svg"): + def convert_icon(self, target_folder, icon_file_path, tmp_file=work_dir + "/chicago95_tmp_file.svg"): ## Converts Icons to PNG # Input: # folder: svg file destination folder @@ -2451,42 +2458,91 @@ class ChicagoPlus: def convert_to_proper_svg_with_inkscape(self, svg_out, svg_in): self.logger.debug("{:<21} | Converting {} to {} with Inkscape".format("",svg_out, svg_in)) + # this is a bit of a hack to support both version of inkscape inkscape_path = subprocess.check_output(["which", "inkscape"]).strip() - args = [ - inkscape_path, - "-l", svg_out, svg_in - ] - subprocess.check_call(args, stdout=subprocess.DEVNULL) + inkscape_version_cmd = subprocess.check_output([inkscape_path, "--version"]) + inkscape_version = inkscape_version_cmd.splitlines()[0].split()[1].decode().split(".")[0] + + if int(inkscape_version) < 1: + self.logger.debug("{:<21} | Using Inkscape v0.9x command".format('')) + # Works with version 0.9x + args = [ + inkscape_path, + "-l", svg_out, svg_in + ] + else: + self.logger.debug("{:<21} | Using Inkscape v1.0 command".format('')) + #works with version 1.0 + args = [ + inkscape_path, + "-l", "-o", svg_out, svg_in + ] + + subprocess.check_call(args, stderr=subprocess.DEVNULL ,stdout=subprocess.DEVNULL) + def fix_with_inkscape(self, color, tmpfile): self.logger.debug("{:<21} | Combining {} in {}".format("",color, tmpfile)) inkscape_path = subprocess.check_output(["which", "inkscape"]).strip() - args = [ - inkscape_path, - "--select="+color, - "--verb", "EditSelectSameFillColor", - "--verb", "SelectionCombine", - "--verb", "SelectionUnion", - "--verb", "FileSave", - "--verb", "FileQuit", - tmpfile - ] + + inkscape_version_cmd = subprocess.check_output([inkscape_path, "--version"]) + inkscape_version = inkscape_version_cmd.splitlines()[0].split()[1].decode().split(".")[0] + + if int(inkscape_version) < 1: + args = [ + inkscape_path, + "--select="+color, + "--verb", "EditSelectSameFillColor", + "--verb", "SelectionCombine", + "--verb", "SelectionUnion", + "--verb", "FileSave", + "--verb", "FileQuit", + tmpfile + ] + else: + args = [ + inkscape_path, + "-g", + "--select="+color, + "--verb", "EditSelectSameFillColor;SelectionCombine;SelectionUnion;FileSave;FileQuit", + tmpfile + ] + subprocess.check_call(args, stderr=subprocess.DEVNULL ,stdout=subprocess.DEVNULL) + def convert_to_png_with_inkscape(self, svg_in, size, png_out): self.logger.debug("{:<21} | Converting {} to {} of size {}".format("", svg_in, png_out, size)) inkscape_path = subprocess.check_output(["which", "inkscape"]).strip() + + inkscape_version_cmd = subprocess.check_output([inkscape_path, "--version"]) + inkscape_version = inkscape_version_cmd.splitlines()[0].split()[1].decode().split(".")[0] + size = str(size) - args = [ - inkscape_path, - "--without-gui", - "-f", svg_in, - "--export-area-page", - "-w", size, - "-h", size, - "--export-png=" + png_out - ] - subprocess.check_call(args, stdout=subprocess.DEVNULL) + + if int(inkscape_version) < 1: + args = [ + inkscape_path, + "--without-gui", + "-f", svg_in, + "--export-area-page", + "-w", size, + "-h", size, + "--export-png=" + png_out + ] + else: + args = [ + inkscape_path, + "--export-area-page", + "--export-type=png", + "-w", size, + "-h", size, + "-o", png_out, + svg_in + ] + + + subprocess.check_call(args, stderr=subprocess.DEVNULL ,stdout=subprocess.DEVNULL) def convert_ico_files(self, icon_filename, output_file_name): self.logger.debug("{:<21} | Converting {} to {}".format("", icon_filename, output_file_name)) diff --git a/sounds/chicago95-startup.desktop b/sounds/chicago95-startup.desktop new file mode 100644 index 0000000..2253c2b --- /dev/null +++ b/sounds/chicago95-startup.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Application +Name=Chicago95 startup sound +Exec=play /usr/share/sounds/Chicago95/startup.ogg +NoDisplay=true +Terminal=false +Categories= +GenericName=startup sound