Playtime notifications not firing

Asked by Maxime JAcquet

Hi, and thank you for your work on this! I just started using it for my kids and the level of features is just amazing!

Right now there is one issue I can't figure out and that prevent me for using it fully.
I have setup daily and weekly restriction, plus playtime limits for minecraft.
Everything worked well except that minecraft would terminate without any notifications. If I get to the end of the session time, I do get notifications though.
I tried to setup at user level additional notifications of different level (moderate, severe and critical) for playtime, and tried with Minecraft fullscreen as well windowed, and no notifications are showing at all. Notifications are not in the notification center easier, they seem to not be triggered at all.
I confirm that the other notifications (config change, remaining time when logging in, time expired for time restriction) are showing normally.
Am I missing something?

Question information

Language:
English Edit question
Status:
Answered
For:
Timekpr-nExT Edit question
Assignee:
Eduards Bezverhijs Edit question
Last query:
Last reply:
Revision history for this message
Eduards Bezverhijs (mjasnik) said :
#1

I'll take a look into this when I get back from road trip.
Meanwhile, please add client and server configuration file content here for the user who is having the issue.

Revision history for this message
Maxime JAcquet (mjacquet) said :
#2

Here is the main config file:
[DOCUMENTATION]
#### this is the main configuration file for timekpr-next
#### if this file cannot be read properly, it will be overwritten with defaults

[GENERAL]
#### general configuration section
# this defines logging level of the timekpr (1 - normal, 2 - debug, 3 - extra debug)
TIMEKPR_LOGLEVEL = 2
# this defines polling time (in memory) in seconds
TIMEKPR_POLLTIME = 5
# this defines a time for saving user time control file (polling and accounting is done in memory more often, but saving is not)
TIMEKPR_SAVE_TIME = 30
# this defines whether to account sessions which are inactive (locked screen, user switched away from desktop, etc.),
# new users, when created, will inherit this value
TIMEKPR_TRACK_INACTIVE = False
# this defines a time interval in seconds prior to assign user a termination sequence
# 15 seconds before time ends nothing can be done to avoid killing a session
# this also is the time before initiating a termination sequence if user has logged in inappropriate time
TIMEKPR_TERMINATION_TIME = 15
# this defines a time interval prior to termination of user sessions when timekpr will send continous final warnings (countdown) until the actual termination
TIMEKPR_FINAL_WARNING_TIME = 10
# this defines a time interval prior to termination of user sessions when timekpr will send one final warning about time left
TIMEKPR_FINAL_NOTIFICATION_TIME = 60

[SESSION]
#### this section contains configuration about sessions
# session types timekpr will track
TIMEKPR_SESSION_TYPES_CTRL = x11;wayland;mir
# session types timekpr will ignore explicitly
TIMEKPR_SESSION_TYPES_EXCL = tty;unspecified
# users timekpr will ignore explicitly
TIMEKPR_USERS_EXCL = testtimekpr;gdm;kdm;lightdm;mdm;lxdm;xdm;sddm;cdm

[DIRECTORIES]
#### this section contains directory configuration
# runtime directory for timekpr user configuration files
TIMEKPR_CONFIG_DIR = /var/lib/timekpr/config
# runtime directory for timekpr time control files
TIMEKPR_WORK_DIR = /var/lib/timekpr/work
# directory for shared files (images, gui definitions, etc.)
TIMEKPR_SHARED_DIR = /usr/share/timekpr
# directory for log files
TIMEKPR_LOGFILE_DIR = /var/log

[PLAYTIME]
#### this section contains global PlayTime activity configuration
# whether PlayTime is enabled globally
TIMEKPR_PLAYTIME_ENABLED = True
# whether PlayTime activity monitor will use process command line, including arguments, for monitoring processes (by default only uses the process name)
TIMEKPR_PLAYTIME_ENHANCED_ACTIVITY_MONITOR_ENABLED = True

Revision history for this message
Maxime JAcquet (mjacquet) said :
#3

Here is the user conf file:
[DOCUMENTATION]
#### this is the user configuration file for timekpr-next
#### if this file cannot be read properly, it will be overwritten with defaults
#### all numeric time values are specified in seconds
#### days and hours should be configured as per ISO 8601 (i.e. Monday is the first day of week (1-7) and hours are in 24h format (0-23))

[axel]
# this defines which hours are allowed (remove or add hours to limit access), configure limits for start/end minutes for hour in brackets,
# optionally enter ! in front of hour to mark it non-accountable, example: !22[00-15]
ALLOWED_HOURS_1 = 14;15;16;17;18[0-30];21
ALLOWED_HOURS_2 = 14;15;16;17;18[0-30]
ALLOWED_HOURS_3 = 14;15;16;17;18[0-30]
ALLOWED_HOURS_4 = 14;15;16;17;18[0-30]
ALLOWED_HOURS_5 = 19[30-60];20;21[0-30]
ALLOWED_HOURS_6 = 10;11;14;15;16;17;18[0-30]
ALLOWED_HOURS_7 = 10;11;14;15;16;17;18[0-30]
# this defines which days of the week a user can use computer (remove or add days to limit access)
ALLOWED_WEEKDAYS = 1;2;3;4;5;6;7
# this defines allowed time in seconds per week day a user can use the computer (number of values must match the number of values for option ALLOWED_WEEKDAYS)
LIMITS_PER_WEEKDAYS = 3600;3600;3600;3600;7200;3600;3600
# this defines allowed time per week in seconds (in addition to other limits)
LIMIT_PER_WEEK = 23400
# this defines allowed time per month in seconds (in addition to other limits)
LIMIT_PER_MONTH = 2678400
# this defines whether to account sessions which are inactive (locked screen, user switched away from desktop, etc.)
TRACK_INACTIVE = False
# this defines whether to show icon and notifications for user
HIDE_TRAY_ICON = False
# this defines user restriction / lockout mode: lock - lock screen, suspend - put computer to sleep, suspendwake - put computer to sleep and wake it up,
# terminate - terminate sessions, shutdown - shutdown the computer
LOCKOUT_TYPE = lock
# this defines wakeup hour interval in format xn;yn where xn / yn are hours from 0 to 23, wakeup itself must be supported by BIOS / UEFI and enabled,
# this is effective only when lockout type is suspendwake
WAKEUP_HOUR_INTERVAL = 0;23

[axel.PLAYTIME]
# whether PlayTime is enabled for this user
PLAYTIME_ENABLED = True
# whether PlayTime is enabled to override existing time accounting, i.e. time ticks only when PlayTime processes / activities are running,
# in this case explicit PlayTime limits are ignored
PLAYTIME_LIMIT_OVERRIDE_ENABLED = False
# whether PlayTime activities are allowed during unaccounted time intervals
PLAYTIME_UNACCOUNTED_INTERVALS_ENABLED = False
# specify on which days PlayTime is enabled
PLAYTIME_ALLOWED_WEEKDAYS = 1;2;3;4;5;6;7
# how much PlayTime is allowed per allowed days (number of values must match the number of values for option PLAYTIME_ALLOWED_WEEKDAYS)
PLAYTIME_LIMITS_PER_WEEKDAYS = 1800;1800;1800;1800;7200;1800;1800
# this defines which activities / processes are monitored, pattern: PLAYTIME_ACTIVITY_NNN = PROCESS_MASK[DESCRIPTION],
# where NNN is number left padded with 0 (keys must be unique and ordered), optionally it's possible to add user
# friendly description in [] brackets. Process mask supports regexp, except symbols [], please be careful entering it!
##PLAYTIME_ACTIVITIES## Do NOT remove or alter this line!
PLAYTIME_ACTIVITY_001 = .*java.*minecraft.*[Minecraft]

Revision history for this message
Maxime JAcquet (mjacquet) said :
#4

Here is the client conf file:

[CONFIG]
# client application configuration file
# NOTE: this file is not intended to be edited manually, however, if it is, please restart application

# user logging level (1 - normal, 2 - debug, 3 - extra debug)
LOG_LEVEL = 1
# whether to show limit change notification
SHOW_LIMIT_NOTIFICATION = True
# whether to show all notifications or important ones only
SHOW_ALL_NOTIFICATIONS = True
# whether to show seconds in label (if DE supports it)
SHOW_SECONDS = True
# whether to use speech notifications
USE_SPEECH_NOTIFICATIONS = False
# how long regular notifications should be displayed (in seconds)
NOTIFICATION_TIMEOUT = 3
# how long critical notifications should be displayed (in seconds)
NOTIFICATION_TIMEOUT_CRITICAL = 10
# use notification sounds for notifications
USE_NOTIFICATION_SOUNDS = False
# user configured notification levels in form of level[priority];...
NOTIFICATION_LEVELS = 3600[3];1800[2];600[1];300[0]
# user configured PlayTime notification levels in form of level[priority];...
PLAYTIME_NOTIFICATION_LEVELS = 2700[0];2400[1];1800[0];600[1]

Revision history for this message
Eduards Bezverhijs (mjasnik) said :
#5

Which OS / version / desktop environment are you using?

Revision history for this message
Eduards Bezverhijs (mjasnik) said (last edit ):
#6

I tested it myself in Manjaro / KDE and PlayTime notifications are showing up...
I found some unintended behaviour with normal notifications which I fixed, but nothing specifically wrong with PT notifications.

So, I have added some debugging code to beta version.
Please install beta version, set max logging level in client application and wait for the time when notification should appear.

Then upload log file from /tmp, file name should be timekprc.axel.log.
For completeness, please share /var/log/timekpr.log too.

Revision history for this message
Eduards Bezverhijs (mjasnik) said :
#7

Have you tried new version yet?

Revision history for this message
Maxime JAcquet (mjacquet) said :
#8

Hi Eduard,
Yes, I sent the log file a week ago as an email reply to notification. I guess it didn't go through. How could I send you the log files ?

Revision history for this message
Eduards Bezverhijs (mjasnik) said (last edit ):
#9

Nope it did not get through..

I guess that e-mails w/ attachments are not supported for replying to "Questions & answers" section.

Just send me an e-mail with the log files (not using reply).

Revision history for this message
Eduards Bezverhijs (mjasnik) said :
#10

Please inform me after you send me the logs.

Revision history for this message
Maxime JAcquet (mjacquet) said :
#11

Logs sent on your email.

Revision history for this message
Eduards Bezverhijs (mjasnik) said :
#12

I took a look at the log files and so far I don't see the issue. I'm not saying there is no issue, but I simply can not see it with your configuration.

So, you configured that PlayTime notification should fire for the last time when there are 10 minutes left.
This means that it will show only when PlayTime transitions from something more than 10 mins to something less or equal than 10 mins, say 10 mins 2 secs left to 9 mins 59 secs left, i.e. around ten minute mark.

The log file shows that axel had one minute left, there are simply no notifications configured to show up at that time.

So to test this I would suggest this:
* install latest beta
* configure the last notification to 1 minute (enter 00:01 in user notification configuration panel), set this to severe or critical level
* leave logging level to max in client app
* set logging level to 2 in administration app (level 3 is way too high)
* test it as before, but before testing make sure that axel has more than 1 minute left and notification should show up about the time he has crossed to less than one minute left
* if notification does not show up, shortly after the testing gather log files and send them to me (please zip them before sending)

FYI: for latest beta I added the initial PlayTime notification when logging in, previously I thought it was unnecessary to show it, this time around I changed my mind :)

Revision history for this message
Eduards Bezverhijs (mjasnik) said :
#13

Have you had a chance to test this?

Revision history for this message
Maxime JAcquet (mjacquet) said :
#14

It has been a busy few weeks, but finally I had time to read properly your message and test.
And that is while reading that I realized my mistake: I configured notifications thinking that format was MM:SS, whereas it is HH:MM.
I tested gain now, and notification are indeed firing! However, they are not displayed over fullscreen app (minecraft in that case).
Do you know if there is a way in Mint Cinnamon to have critical notification show over fullscreen app?

Revision history for this message
Eduards Bezverhijs (mjasnik) said (last edit ):
#15

Ok, it's good that there is no bug with notifications :)

About notification settings, I don't know much about Cinnamon, I know that KDE shows critical notifications over fullscreen apps (and normal ones too, if configured so in notification preferences) and if I remember right Gnome3 did that some years ago...

However there is no need to guess, it's quite easy to test:
* prepare supposed fullscreen app (for example firefox goes full screen when pressing F11, so it's a good and easy app to test with)
* open console and type: sleep 5 && notify-send -t 3000 -u critical "TEST"
* press enter and quickly swith to FF and press F11 to enter fullscreen, if after approx 5 secs there is no notification, it does not work

I just tested in KDE, which I have and use daily, low and normal notifications do not show over fullscreen FF, critical ones do.

I downloaded Manjaro Cinnamon and Gnome to test this and they both seem to show critical notifications over fullscreen FF, however, I don't have Minecraft, so I'll not be able to test that.

Can you help with this problem?

Provide an answer of your own, or ask Maxime JAcquet for more information if necessary.

To post a message you must log in.