feature request: temporary time extension

Asked by Aryeh

We occasionally want to give our kids more time on temporary basis. For example a child needs some more computer time to complete a homework assignment. We use the time of day constraints to limit when our kids can use the computers. Currently if a kid needs more time we change the time of day constraints. Unfortunately we usually forget to redo the settings.

My suggested feature is a way to temporarily add more time, even if the time of day constraints wouldn't allow it.

Thank you for making this program, it has been very helpful in limiting our kids computer time.

Question information

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

Hi, I have a couple of questions.
So do you use hour interval limitations only?

One of the ways to do this currently is to use hour intervals and limits per day together.
Say you allow kid to use computer for 2 hours but from 14:00 to 21:00, that way he can’t use more than 2 hours a day, however on first tab “info & today” you can add more time teporarily within defined hour intervals.

I would like to know as precise situation as possible. Can you share config file with me?

Revision history for this message
Aryeh (agielchinsky) said :
#2

We only use the hour interval limitation. When our kids come home we want them to do their homework. The general pattern is that they are usually done with homework by 16:30, which is when the computers turn on. They then turn off a little before dinner, and then turn on after dinner (depending on the night). In Israel the work/school week is Sunday to Thursday. The kids have a partial day on Friday, and come home earlier as well on Tuesday.

The combination of increasing the hour interval limitation, with limits per day doesn't really work for what we are trying to do. A kid might remember at 10pm that they need to check something, which is later than we want them on on a regular basis, regardless of how much they've been on the computer earlier in the day.

Currently if a kid needs time later in the day we manually edit their hour interval (usually with the GUI, sometimes with the config file). When I remember I revert the changes by copying over the original files that I have backed up in dropbox (usually a few changes have been made on different computers to different kids' config files, so it would be hard to use the built in revert function). I'm trying to think if there would be a way for us to sync the config folder once per night to automatically revert any changes we made.

Here is an example config.

[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))

[x]
# 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 = 16[30-60];17[0-20];18;19
ALLOWED_HOURS_2 = 15;16;17[0-20]
ALLOWED_HOURS_3 = 16[30-60];17[0-20];18;19
ALLOWED_HOURS_4 = 16[30-60];17[0-20]
ALLOWED_HOURS_5 = 13;14;15;16
ALLOWED_HOURS_6 = 18;19
ALLOWED_HOURS_7 = 16[30-60];17[0-20]
# 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 = 86400;86400;86400;86400;86400;86400;86400
# this defines allowed time per week in seconds (in addition to other limits)
LIMIT_PER_WEEK = 604800
# 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 = terminate
# 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

[x.PLAYTIME]
# whether PlayTime is enabled for this user
PLAYTIME_ENABLED = False
# 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 = True
# 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 = 0;0;0;0;0;0;0
# 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!

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

Thanks, it’s more clear now.

I’ll think about it when I have time, but currently I have way too much stuff on my plate.

Revision history for this message
Nathan Kershaw (nathankershaw) said :
#4

This would be super helpful for our family as well.

We've got an autistic son who really needs the flexibility that being able to add some ad-hoc time would allow.

This is a common feature in parental control applications on other OS's - I use it regularly in Google Family Link and Microsoft Family. However, I'd like to move to Linux and this is the one thing holding us back.

Great project by the way - super helpful for those non-mainstream parents out there!

Revision history for this message
Aryeh (agielchinsky) said :
#5

I was thinking about this and another problem I have, and I might have a way to solve both of them.

The other problem I have is syncing schedules across computers. We have several kids and several computers. If we make a change on a kid's schedule on one computer, we have to remember to copy it to all the other computers. (each kid usually uses a specific computer, but sometimes they switch).

I have a server I leave on all the time. I'm thinking of syncing the config folder for timekpr-next with sync-thing across all the computers and the server. I would setup the server folder as a git repo. Every night I would have a cron job run "git restore ." on the server git repo to undo any changes we made to the schedule. This would ensure any changes we made to a schedule would be reverted at night, unless we wanted the change to stay, then we'd have to commit and push the change.

I suspect I may have some trouble with file ownership, and/or git and syncthing clashing. I think I'm going to try it out and report back.

Revision history for this message
Nathan Kershaw (nathankershaw) said :
#6

Have you had any further thoughts on this?

Again, this is a key feature that the big parental software options out there do - kids (and families) really need the flexibility that comes from being able to give additional, discrete portions of time.

For my autistic son, this is absolutely essential. I'd love to move to Linux but simply cannot until this is sorted. Is there any way we could support you to tackle it?

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

Ok, so basically what you would like, is temporary (not saved in configuration) hour intervals which you can enter using either CLI tool or APP to allow your subordinate to do things out of regular schedule, right?

If this is so, this needs to be implemented in timekpr engine and APP (to show that this is temp extension).
So, in the end user will be able to enter temp interval and nothing much will change in interaction with timekpr.

So it will work like this:
* you add interval, mark it as temp
* add more temporary time (if it needs to be adjusted)
* press save and off your subordinate go
* after a day or temp interval is over or computer restarts, the temp extension disappears

Since timekpr-next currently works on hourly basis, most likely I need to:
* convert engine to true interval engine while saving all the current functionality
* convert config save / load routines the same way
* adjust DBUS transport to handle intervals instead of hours
* implement temp intervals in the engine (now it will be easy as setting a property that it is temp interval)
* wire this all up to APP
* allow APP to enter and adjust temp intervals

In the end, it would take somewhere around 4-6 days to implement and test this. But the thing is that I can not find those 5 days given my current schedule. It is hard to squeeze additional time in there.
I used to maintain and work on enhancements after working hours, but for a very long time, I'm not able to do it anymore really.

Since I don't use timekpr myself, but I am committed to support it when problems arise, essentially I am helping others, but I can only help others, after I have taken care of my own schedule.

As it is not currently possible to change my current schedule, so the only way to support me, is to donate towards timekpr, however it will not make it easier or faster to implement the feature.

At the end of the day - I can not give any eta when I can do it.

As a first step, I would suggest to create an enhancement request for timekpr-next, so this is not tracked in questions section.

Revision history for this message
Aryeh (agielchinsky) said (last edit ):
#8

I've created a work around that allows me to temporarily change the time restrictions, and to sync changes we want to keep permanently across computers.

I've converted /var/lib/timekpr/config into a git repo, and created a script at /etc/rc.local that resets any uncommitted changes, removes any not added files, and pulls from the remote git repo. This means that whenever one of our computers turns on, it removes any changes we haven't committed, and pulls any changes we did commit on a different computer.

I setup the remote git on a gitea instance running in my house, but you could use github. Here is my /etc/rc.local file. (you might need to run chmod +x /etc/rc.local).

Thank you for this great program.

#!/bin/sh -e

# reset any changes timekpr-next and pull latest version
# don't forget chmod +x /etc/rc.local

# remove uncomitted changes
sudo git -C /var/lib/timekpr/config/ reset --hard origin/main
# remove un added files
sudo git -C /var/lib/timekpr/config/ clean -f
# pull latest
sudo git -C /var/lib/timekpr/config/ pull origin main

exit 0