Giter Site home page Giter Site logo

saltssaumure / classupdate Goto Github PK

View Code? Open in Web Editor NEW
27.0 2.0 1.0 251 KB

Update Discord theme classes, October 2023 to June 2024

License: GNU General Public License v3.0

Python 100.00%
betterdiscord betterdiscord-theme replugged replugged-theme vencord vencord-theme

classupdate's Introduction

ClassUpdate

Update class names of all themes in a folder.

Updating only a single file? Use SyndiShanX's online tool instead: https://syndishanx.github.io/Website/Update_Classes.html

Credits

Setup and usage

Requirements

Usage

⚠ Make a backup of your themes before using this script.

  1. Open terminal in your client mod's directory
  2. Download this tool
    • git clone https://github.com/Saltssaumure/ClassUpdate
  3. Edit config.ini if desired
    • See section below for detailed info
  4. Run the script
    • cd ./ClassUpdate
    • python ./replace.py

Example

Files marked with will be updated by the script if using the default config.

WorseDiscord/
├── themes/
│   ├── CoolTheme.theme.css ↻
│   ├── DarkMode2.theme.css ↻
│   ├── another.theme.css   ↻
│   └── testfolder/
│       ├── test.theme.css  ↻
│       ├── something.css   ↻
│       └── wargh.txt
├── MyCoolWebsite/
│   ├── site.html
│   └── main.css
└── ClassUpdate (this tool)/
    ├── replace.py
    └── README.md

Config

The config for this script is stored in config.ini and can be edited with your favourite text editor (eg. Notepad++).

Variables

ThemeDirectory

  • The location of the themes directory to update.
  • A path relative to the ClassUpdate directory.
  • Default: themes

FileExtension

  • The file extension of the files to update.
  • Default: css

UseLocalDiff

  • Whether or not to use a local (instead of online) changes file.
  • Use yes or no.
  • Default: no

DiffLocation

  • The location of the changes file.
    • If using local diff, a path relative to the replace.py file.
    • If using online diff, a full URL.
  • Default: https://raw.githubusercontent.com/SyndiShanX/Update-Classes/main/Changes.txt

Creating a new profile

The config.ini has two profiles provided, DEFAULT and local. You can also create new profiles to store various configs.

  1. Add a section to config.ini starting with the name of the profile in square brackets:
    [UpdateScss]
  2. Underneath, copy and edit variables you wish to change from the DEFAULT profile. Any missing variables will inherit its value from DEFAULT automatically. This example profile will update scss files in MyThemes directory using the online changes file at https://raw.githubusercontent.com/SyndiShanX/Update-Classes/main/Changes.txt:
    [UpdateScss]
    ThemeDirectory: MyThemes
    FileExtension: scss
  3. Save your changes before running replace.py. Enter your profile name when prompted, without square brackets.

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

  • TL;DR;NAL: Do whatever you want with this, as long as you allow others to do the same.

Questions or suggestions?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.