Jump to content
blackosx

Clover Theme Manager

556 posts in this topic

Recommended Posts

Thanks. I've updated the repo with the revised files.

 

Note: The repo, which I thought to have fixed, is still not 100% as it used to be with regard to the bare git repos for each theme. I will try to find time to look at it again. As a result, any installed themes will be flagged again with updates available.

 

EDIT:

After some changes and testing today I am happy to have a working server-side post-update script which seems to do what I think it needs to do. CloverThemeManager should now correctly report a theme update when a theme is amended.  Sorry for all the false-positives for updates that anyone's been seeing recently. If anyone has updates for themes showing then please click update them to clear the notification.

 

Good.

 

Anyways,

I just noticed something weird. When I put this theme along with other themes in "/ESP/CLOVER/themes" and set it as default theme; then boot to Clover GUI; If I then go to "Themes" section of the Bootloader GUI (in "Options"), I can't go back to OS Selection page. The bootloader gets stuck -_- 

Are you getting similar problem ? Or is it just me ?!

Share this post


Link to post
Share on other sites
Advertisement

No I don't see that here. All works fine.

 

For the issue you see, please confirm it happens when you:

1 - select options>themes and then you cannot return to the main screen by pressing escape? or

2 - select options>themes, delete existing theme entry and type the name of another installed theme followed by escape?

Share this post


Link to post
Share on other sites

hmm.. interesting.

 

Please can you enable debug mode and post the log file so I can see what’s happening?

 
To enable debug mode:
- Edit CloverThemeManager.app/Contents/Resources/public/bash/shared.sh
- Change line #46 from DEBUG=0 to DEBUG=1
- Save the file
 
Get the log file
- Run Clover Theme Manager
- While the app is running, go to /tmp/CloverThemeManager and copy CloverThemeManagerLog.txt
 
Post the CloverThemeManagerLog.txt.
 
Thanks

Share this post


Link to post
Share on other sites

 

hmm.. interesting.

 

Please can you enable debug mode and post the log file so I can see what’s happening?

 
To enable debug mode:
- Edit CloverThemeManager.app/Contents/Resources/public/bash/shared.sh
- Change line #46 from DEBUG=0 to DEBUG=1
- Save the file
 
Get the log file
- Run Clover Theme Manager
- While the app is running, go to /tmp/CloverThemeManager and copy CloverThemeManagerLog.txt
 
Post the CloverThemeManagerLog.txt.
 
Thanks

 

 

Log attached

Thanks

CloverThemeManagerLog.txt

Share this post


Link to post
Share on other sites

Thanks for the log carbo178.

Can you please delete /Users//Library/Application\ Support/CloverThemeManager/theme.html and the reload Clover Theme Manager.

Yessss

Schermata 2015-10-27 alle 19.18.49.png

Thank you

Share this post


Link to post
Share on other sites

if help you can add a button somewere to do that from the app:

 

 

- (IBAction)removeThemeHtml:(id)sender

{

    NSString *path = [NSHomeDirectory() stringByAppendingPathComponent:

                      @"Library/Application Support/CloverThemeManager/theme.html"];

    

    NSError *error;

    

#if __has_feature(objc_arc)

    // working in ARC

    NSAlert* alert = [[NSAlert alloc] init];

#else

    // non ARC

    NSAlert* alert = [[[NSAlert alloc] init] autorelease];

#endif

    

    if ([[NSFileManager defaultManager] fileExistsAtPath:path])

    {

        [[NSFileManager defaultManager] removeItemAtPath:path error:&error];

        

        if (!error)

        {

            [alert setMessageText: @"theme.html deleted, click OK to reload.."]; //or tell user to restart the app

            [alert addButtonWithTitle: @"OK"];

            [alert runModal];

            

            // here the code to reload the interface

        }

        else

        {

            [alert setMessageText: @"theme.html was found but an error is encountered deleting the file.."];

            [alert addButtonWithTitle: @"OK"];

            [alert runModal];

        }

    }

    else

    {

        [alert setMessageText: @"theme.html was not present!"];

        [alert addButtonWithTitle: @"OK"];

        [alert runModal];

    }

}

 

 

like a reset.. just connect the action to a button in Interface Builder..

 

EDIT

code tested  :) (can work with ARC enabled or not..)

 

EDIT II
 
that is the same with code to relauch the application after deleting theme.html:

 

 

- (IBAction)removeThemeHtml:(id)sender

{

    NSString *path = [NSHomeDirectory() stringByAppendingPathComponent:

                      @"Library/Application Support/CloverThemeManager/theme.html"];

    

    NSError *error;

    

#if __has_feature(objc_arc)

    // working in ARC

    NSAlert* alert = [[NSAlert alloc] init];

#else

    // non ARC

    NSAlert* alert = [[[NSAlert alloc] init] autorelease];

#endif

    

    if ([[NSFileManager defaultManager] fileExistsAtPath:path])

    {

        [[NSFileManager defaultManager] removeItemAtPath:path error:&error];

        

        if (!error)

        {

            [alert setMessageText: @"theme.html deleted,\nclick \"relauch\" to restart Clover Theme Manager"];

            [alert addButtonWithTitle: @"relauch"];

            [alert runModal];

            [self relaunch];

        }

        else

        {

            [alert setMessageText:

             @"theme.html was found but an error is encountered deleting the file.\n\nclick \"relauch\" to restart Clover Theme Manager.."];

            [alert addButtonWithTitle: @"relauch"];

            [alert runModal];

            [self relaunch];

        }

    }

    else

    {

        [alert setMessageText: @"theme.html was not present,\nclick \"relauch\" to restart Clover Theme Manager"];

        [alert addButtonWithTitle: @"relauch"];

        [alert runModal];

        [self relaunch];

    }

    [self relaunch];

}

 

- (void) relaunch

{

    int processIdentifier = [[NSProcessInfo processInfo] processIdentifier];

    NSString *myPath = [NSString stringWithFormat:@"%s",

                        [[[NSBundle mainBundle] executablePath] fileSystemRepresentation]];

    [NSTask launchedTaskWithLaunchPath:myPath arguments:[NSArray

                                                         arrayWithObject:[NSString stringWithFormat:@"%d",

                                                                          processIdentifier]]];

    [NSApp terminate:self];

 

}

 

 

Share this post


Link to post
Share on other sites

Imported to the app the code from previous post.

 

- connected the reset action to the app menu (the app clean the theme.html and relaunch itself)

- connected the showLog to "Show log" in the app menu

- small change in shared.sh in WriteToLog() func

- some warnings removed (remain 5 of it)

 

if you like, 

Edited by Micky1979
app removed

Share this post


Link to post
Share on other sites

Thank you for the welcome additions/changes Micky1979. I have much to learn when it comes to objective-C and you demonstrate a good understanding of how it all pieces together.

 

I will look at your submission and see what can be used.

 

Regards

Share this post


Link to post
Share on other sites
Thank you @blackosx.

 

However after the first attempt, I improved how the app is relaunched through more sophisticated and recommended way: an embedded secondary app that thinks of doing this really well.
Please tell me what you think!  (to tell the truth is cool :lol: ...IMHO)
 
EDIT
if you want delete some other files generated by the app, just tell me what.. atm only theme.html is removed.
..also corrected "relauch" to "relaunch"..
 
EDIT II
the "Tool" menu... is a funcy name, just have no other words to call it, but just dowble click to edit it in Interface Builder to change as you like, and of course if you like.

 
Edited by Micky1979
app removed

Share this post


Link to post
Share on other sites

Fantastic! That works great.  :)

I will digest your changes whilst double checking all that needs to be done for a proper reset before creating an updated version.

 

Thanks.

 

For ref, I already had the open log menu option under theme CloverThemeManager menu.

Share this post


Link to post
Share on other sites

For ref, I already had the open log menu option under theme CloverThemeManager menu.

OMG sorry, only found the funcion not connected in Interface Builder (IBAction mean that you want do that) and not expected under "CloverThemeManager" menu ..not seen until now.

 

Yea,  more actions can be added to "reset" the app, and I was just thinking to add a delay (0.5/1 second) to reopen the app... just to let finish some children working process (like the .sh scripts) from the previous execution, simply because they probably are running on another thread different from the main one, I suppose that they need some milliseconds in more to be killed (actually the process to reopen is really fast).

Share this post


Link to post
Share on other sites

No problem.

I’ve now moved the Relaunch menu option to also be under the CloverThemeManager menu.
 
Yes, the bash script does indeed exit once it detects the process ID of the main CloverThemeManager.app has terminated so a delay would be very useful. As it currently is, without a delay, testing this morning on three different machines results in the app relaunching cleanly 99% of the time. But adding a delay would be very useful just incase the system is under load. Can you make it 1 second just to be safe?
 
I have changed your reset function to this:
- (IBAction)reset:(id)sender
{
    NSString *path = [NSHomeDirectory() stringByAppendingPathComponent:
                      @"Library/Application Support/CloverThemeManager/theme.html"];
    
    NSError *error;
    
#if __has_feature(objc_arc)
    // working in ARC
    NSAlert* alert = [[NSAlert alloc] init];
#else
    // non ARC
    NSAlert* alert = [[[NSAlert alloc] init] autorelease];
#endif
    
    [alert setMessageText: @"Please confirm you wish to Clear and Relaunch Clover Theme Manager"];
    [alert addButtonWithTitle: @"Clear and Relaunch"];
    [alert addButtonWithTitle: @"Cancel"];
    if ([alert runModal] == NSAlertFirstButtonReturn) {
        NSLog (@"User chose to Clear and Relaunch.");
        
        if ([[NSFileManager defaultManager] fileExistsAtPath:path])
        {
            [[NSFileManager defaultManager] removeItemAtPath:path error:&error];
            
            if (!error)
            {
                [self relaunch];
            }
            else
            {
                NSLog (@"Clear and Relaunch: failed to remove theme.html.");
                [self relaunch];
            }
        }
        else
        {
            NSLog (@"Clear and Relaunch: theme.html was not present.");
            [self relaunch];
        }
        
    }
    else
    {
        NSLog (@"User clicked Cancel to Clear and Relaunch.");
    }
}

Share this post


Link to post
Share on other sites

Good!

 

script.sh produce this error: [: ==: unary operator expected at line 2064

 

changed to

if [ "${gLastSelectedPartitionGUID}" == "${zeroUUID}" ]; then

just double quoting solve the problem

 

Another idea is to delete temporary files using the relaunch.app, why? after CTM is closed these/those files are surely unlocked (not busy by CTM), better.

Anyway deleting all temporary files and the  Application Support/CTM dir made the app in a 100% working state  each time:

 

Relaunch.m

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
    NSError *error;
    // deleting temporary files from the previous execution:
    if ([[NSFileManager defaultManager] fileExistsAtPath:@"/private/tmp/CloverThemeManager"])
    {
        [[NSFileManager defaultManager] removeItemAtPath:@"/private/tmp/CloverThemeManager" error:&error];
        
        if (error) NSLog(@"Problem encountered deleting /private/tmp/CloverThemeManager directory.\n");
    } else
    {
        NSLog(@"/private/tmp/CloverThemeManager directory not found.\n");
    }
    
    // deleting ~/Library/Application Support/CloverThemeManager
    error = nil;
    NSString *AppSupportPath = [NSHomeDirectory() stringByAppendingPathComponent:
                                @"Library/Application Support/CloverThemeManager"];
    
    if ([[NSFileManager defaultManager] fileExistsAtPath:AppSupportPath])
    {
        [[NSFileManager defaultManager] removeItemAtPath:AppSupportPath error:&error];
        
        if (error) NSLog(@"Problem encountered deleting ~/Library/Application Support/CloverThemeManager directory.\n");
    }
    else
    {
        NSLog(@"~/Library/Application Support/CloverThemeManager directory not found.\n");
    }
    
    // relaunch CloverThemeManager after one second
    [self performSelector:@selector(relaunch) withObject:nil afterDelay:1.0];
}

- (void)relaunch
{
    NSString *myBundlePath = [[NSBundle mainBundle] bundlePath];
    
    NSString *ThemeManagerPath = [[[myBundlePath stringByDeletingLastPathComponent]
                                   stringByDeletingLastPathComponent] stringByDeletingLastPathComponent];
    NSLog(@"Relaunching %@\n", ThemeManagerPath);
    [[NSWorkspace sharedWorkspace] launchApplication:ThemeManagerPath];
    [NSApp terminate:self];
}

If you want take a look this is what I do (with your changes about "cancel" the reset):CloverThemeManagerApp.zip

 

EDIT

 

delay added

Share this post


Link to post
Share on other sites

Thanks for the update Micky1979. I'll take a look in a bit and let you know.

 

But I like the idea of using the relaunch app to remove the /tmp files though for ref, I wish to retain the Application Support/CloverThemeManager dir as that stores the downloaded items and bare-git repo's of the installed themes. This saves re-downloading the index.git (theme.plists and screenshots) as long as there has not been a change on the repo and the theme.git's are used to git fetch against to pull any updates from the repo. The bash script manages these items and deletes them when they're no longer required.

Share this post


Link to post
Share on other sites

Not really a problem, just delete what is not necessary:

/*
    // deleting ~/Library/Application Support/CloverThemeManager
    error = nil;
    NSString *AppSupportPath = [NSHomeDirectory() stringByAppendingPathComponent:
                                @"Library/Application Support/CloverThemeManager"];
    
    if ([[NSFileManager defaultManager] fileExistsAtPath:AppSupportPath])
    {
        [[NSFileManager defaultManager] removeItemAtPath:AppSupportPath error:&error];
        
        if (error) NSLog(@"Problem encountered deleting ~/Library/Application Support/CloverThemeManager directory.\n");
    }
    else
    {
        NSLog(@"~/Library/Application Support/CloverThemeManager directory not found.\n");
    }
    */

EDIT
I can see two updates, BGM and Pandora (THX carbo :D )


Another thing, I see that the project has the "deployment target" set to 10.8 not 10.7, confirm?

Share this post


Link to post
Share on other sites

script.sh produce this error: [: ==: unary operator expected at line [/size]2064[/size]

 

changed to

if[/size] [ [/size]"${gLastSelectedPartitionGUID}"[/size] == [/size]"${zeroUUID}"[/size] ]; [/size]then[/size]

just double quoting solve the problem

Good spot. Thanks.

 

Not really a problem, just delete what is not necessary:

Of course :)

 

Another thing, I see that the project has the "deployment target" set to 10.8 not 10.7, confirm?

It should be 10.7.

I did have a build which worked on 10.6 but I had issue with some objective-C JSON function which wasn't supported on 10.6 which stopped it from working properly.

Share this post


Link to post
Share on other sites

It should be 10.7.

Check it on the repo, is 10.8

MACOSX_DEPLOYMENT_TARGET = 10.8;

http://sourceforge.net/p/cloverefiboot/themes/ci/master/tree/CloverThemeManagerApp/CloverThemeManager/CloverThemeManager.xcodeproj/project.pbxproj

 if you change CTM to 10.7 be sure relaunch.app it has inherited the same settings

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Slice
      Since rev 4844 Vector Themes are supported and there are ready-to-use Clovy by Clovy, cesium by Slice and BGM_SVG by Blackosx.
      You may see it's structure to create own theme
      -------------------------------------------------------------------------------------------------------------------------------------------------------
       
       
      Now I want to add vector graphics support in Clover. See rev 4560 and later.
      It is not working yet but designers may begin to create Vector Themes.
      It supposed to consist of SVG elements and has design size. It will be rendered to any screen size scaled from design size.
       
      What application in macOS can create SVG graphics?
      Inkscape is not working in macOS 10.11+. Pity.
      LibreOffice Draw works with SVG but buggy.
      Boxy SVG cost 10$ but looks good enough. It creates the best in simplicity files and have more then enough features.
      Illustrator is good but expensive.
       
      How to improve SVG file?
      Clover has restricted support for SVG. It is your job to make compatible file and as small as possible to speedup rendering.
      Some helps:
      Help:Inkscape – From invalid to valid SVG Inkscape files
      From invalid to valid SVG Adobe Illustrator files
      From invalid to valid SVG files of other editors: BKchem, ChemDraw and CorelDRAW
      Help:Illustrator – Assistance with creating and saving SVG images in Adobe Illustrator that will pass W3C validation
      User:Quibik/Cleaning up SVG files manually
      Later I will write own instructions specific to Clover abilities.
       
      How to create SVG fonts?
      You can google to find ready-to-use SVG fonts.  I found some problems with too beaty fonts: slow rendering and overflow crash. Be careful.
      You can get ttf or otf fonts and convert them into svg by using online WEB services. Not a problem to google.
      But then I want to find a way to simplify the font to reduce a size and speedup rendering.
      You can create own font by FontForge It is opensource and available for Windows, Mac and GNU+Linux. It creates otf font which you can convert to svg font.
       
      Pictures from Badruzeus
      https://www.insanelymac.com/forum/applications/core/interface/file/attachment.php?id=301597
    • By IIIdefconIII
      This theme is original form Enzo:
       

       
      He build it for the chameleon boot loaders.
      http://forum.voodooprojects.org/index.php/topic,5918.0.html?PHPSESSID=8jgg62mu0el9hhaltncecthleffp942d
       
      I liked it so much that i asked his permission to convert it to a Clover theme.
      So glad he told me i can.
       
      Shout out for Enzo!
      mavs.zip
    • By IIIdefconIII
      This theme is original form Enzo:
       
      He build it for the chameleon boot loaders.
      http://forum.voodooprojects.org/index.php/topic,5918.0.html?PHPSESSID=8jgg62mu0el9hhaltncecthleffp942d
       
      I liked it so much that i asked his permission to convert it to a Clover theme.
      So glad he told me i can.

      So the Theme zip is included this post bellow.
       
      Shout out for Enzo!
×