Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix notifications on MacOS #3

Closed
krissemicolon opened this issue Jan 10, 2023 · 4 comments
Closed

Fix notifications on MacOS #3

krissemicolon opened this issue Jan 10, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@krissemicolon
Copy link

On MacOS there is no notify-send command.

@gabrielzschmitz
Copy link
Owner

The app just dont send the notifications or it broke?

@krissemicolon
Copy link
Author

image

The app will not send any notifications and also this happens.

@gabrielzschmitz
Copy link
Owner

gabrielzschmitz commented Jan 10, 2023

Try replacing this in the input.c mainMenuInput():

    if(key == 'E'){
        if(app->menuPos == 1){
            app->E = 'C';
            app->timer = (app->workTime * 60 * 16);
            app->frameTimer = 0;
            app->currentMode = 1;
            app->pomodoroCounter = app->pomodoroCounter + 1;
            system("notify-send -t 5000 -c cpomo \'華 Work!\' \'You need to focus\'");
        }
        else if(app->menuPos == 2){
            app->currentMode = -1;
            app->menuPos = 1;
        }else{
            endwin();
            exit(EXIT_SUCCESS);
        }
    }

by:

    if(key == 'E'){
        if(app->menuPos == 1){
            app->E = 'C';
            app->timer = (app->workTime * 60 * 16);
            app->frameTimer = 0;
            app->currentMode = 1;
            app->pomodoroCounter = app->pomodoroCounter + 1;
        #ifdef __APPLE__
            system("osascript -e \'display notification \"華 Work!\" with title \"You need to focus\"\'");
        #else
            system("notify-send -t 5000 -c cpomo \'華 Work!\' \'You need to focus\'");
        #endif
        }
        else if(app->menuPos == 2){
            app->currentMode = -1;
            app->menuPos = 1;
        }else{
            endwin();
            exit(EXIT_SUCCESS);
        }
    }

when you press enter the app should notify you, if it work I'll fix all the cases. I don't have any apple device so I will need you to test it ;)

@krissemicolon
Copy link
Author

will test and make pr

@gabrielzschmitz gabrielzschmitz added the bug Something isn't working label Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants