sigmaSd / Stimulator

Keep your computer awake
https://flathub.org/apps/io.github.sigmasd.stimulator
MIT License
13 stars 9 forks source link

Add keep awake timer #5

Open meybonomme opened 9 months ago

meybonomme commented 9 months ago

Is it possible to add similar functionality as You can see in screenshot? Option to keep computer awake without keeping the screen awake? And keep awake timer or predefined time options?

Screenshot from 2023-12-20 03-08-48

sigmaSd commented 9 months ago

For making the screen turn off or not option: A cross desktop environment api to do this is not exposed by gtk.

For gnome specifcly from quick look here https://gitlab.gnome.org/GNOME/gnome-control-center/-/blob/main/panels/power/cc-power-panel.c it seems like both ideling and screen turning off is tied together. (I'll have to double check this though)

For the timeout idea, it should be possible I'll try to add it

sigmaSd commented 9 months ago

Actually I migght be wrnog I think using GTK :

I'll have to test this

meybonomme commented 9 months ago
  • If I only inhibit Idle, it will not let the screen dim nor suspend

And if the screen will not dim nor suspend, pc also not suspended, am I right?

Probably is smart to do libadwaita upgrade first, because it affects also settings window: https://github.com/sigmaSd/NoSleep/issues/4

sigmaSd commented 9 months ago

I have an alpha sketch image

meybonomme commented 9 months ago

This is very good start, good work!

Let's make this libadwaita-thing clear, to avoid unneeded extra work: https://github.com/sigmaSd/NoSleep/issues/4 My vision is to see latest libadwaita card-based design in preferences and other modal windows.

sigmaSd commented 9 months ago

Yeah the other example made it clear, I'll see what I can do

sigmaSd commented 9 months ago

I won't have time to work on this next week, so hopefully the after I can resume this

meybonomme commented 9 months ago

I won't have time to work on this next week, so hopefully the after I can resume this

It's okey, take Your time! You have already done very good and quick job :+1:

sigmaSd commented 9 months ago

I added a pr to keep the screen on/off https://github.com/sigmaSd/NoSleep/pull/13

If you want to test it

meybonomme commented 9 months ago

I got stuck here.

git clone https://github.com/sigmaSd/NoSleep - OK Running git checkout ss inside of NoSleep folder - OK Installing deno using shell: curl -fsSL https://deno.land/install.sh | sh - OK

But what's next? Do I have to move deno to the NoSleep folder? I got bash: deno: command not found...

sigmaSd commented 9 months ago

When you install deno it tells you at the end of the installation the location of deno

It usually is under ~/.deno/bin/deno so either add that folder to PATH variable or run it with it's absolute path like so

~/.deno/bin/deno run -A --unstable main.ts

meybonomme commented 9 months ago

Thank You, but now I have new problem.

~/.deno/bin/deno run -A --unstable main.ts output:

~/.deno/bin/deno run -A --unstable main.ts
error: Uncaught (in promise) Error: 
Could not find Python library!

Tried searching for these versions:
  libpython3.12.so
  libpython3.11.so
  libpython3.10.so
  libpython3.9.so
  libpython3.8.so

Make sure you have a supported version of Python
installed on your system, which should be one of
these: 3.12, 3.11, 3.10, 3.9, 3.8

If the module still somehow fails to find it,
you can open an issue: https://github.com/denosaurs/deno_python/issues

However, if your Python distribution is not in search
path, you can set DENO_PYTHON_PATH env variable pointing
to dll/dylib/so file for Python library.

const LIBRARY_NOT_FOUND = new Error(`
                          ^
    at file:///home/meybo/NoSleep/vendor/deno.land/x/python@0.4.3/src/ffi.ts:55:27

I have python installed, python output:

Python 3.12.1 (main, Dec 18 2023, 00:00:00) [GCC 13.2.1 20231205 (Red Hat 13.2.1-6)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 

What I'm doing wrong now?

sigmaSd commented 9 months ago

Yes libpython is distributed separately from python, in fedora for example to install you need to use dnf install python3-devel , other distro have their own package name, but it should be easy to look up

I found the one in fedora using this command dnf provides "*libpython3.12.so"

sigmaSd commented 8 months ago

Back to the original issue, how do you think the timer setting should look with the new design?

meybonomme commented 8 months ago

I have concept already for this, I will introduce it soon 🙂

meybonomme commented 8 months ago

We can use similar solution, click to the cog icon opens modal window with timer settings. We can add independent timers for suspending and screen blanking. I think it is very clear and user friendly solution.

Screenshot from 2024-01-15 13-47-07

sigmaSd commented 8 months ago

Make sense to me, how the timer setting would look?

meybonomme commented 8 months ago

Here is my quick mockup:

Stimulator-timer-mockup

meybonomme commented 8 months ago

There must be also note in timer section, because this time is extended by the Automatic Suspending / Screen Blanking time set in the system settings.

EDIT: Better way: app can send suspend command if time is over.

meybonomme commented 8 months ago

Maybe timer is too advanced, we can use predefined options with drop-down menu. Something similar directly from "cog" button (with different time options of course):

pilt

If a limited time is selected, there could be countdown timers:

pilt

meybonomme commented 1 week ago

You don't want to cooperate anymore? I have been trying to contact you in the Matrix.

sigmaSd commented 1 week ago

Hi @meybonomme sorry about that, I don't get notifications from matrix, I'll answer there