Git Product home page Git Product logo

gnome-shell-extension-caffeine's Introduction

gnome-shell-extension-caffeine

License GitHub release (latest by date)

Enable / disable auto suspend with quick setting toggle.

Quick Toggle Caffeine

Version

This extension supports GNOME Shell 3.4 -> 45

Branch Version Compatible GNOME version
master 53 GNOME 45 -> 46
gnome-shell-43-44 51 GNOME 43 -> 44
gnome-shell-40-42 42 GNOME 40 -> 42
gnome-shell-3.36-3.38 37 GNOME 3.36 -> 3.38
gnome-shell-3.32-3.34 33 GNOME 3.32 -> 3.34
gnome-shell-3.10-3.30 - GNOME 3.10 -> 3.30
gnome-shell-before-3.10 - GNOME 3.4 -> 3.8

Installation From source

make build
make install
  • Restart the shell
  • Enable the extension

Screenshots & features

Scroll Indicator Icon

ScreenshotScreenshot

You can scroll on the indicator icon to enable / disable auto suspend:

  • Scroll up -> Filled cup: Caffeine enabled
  • Scroll down -> Empty cup: Caffeine disabled

Note: the option "Show status indicator" must be set on "always" (see below).

Notifications

Screenshot Screenshot

Timer option

This option enable Caffeine for a given amount of time (similar to Caffeine in LineageOS).

ScreenshotScreenshot

Preferences

Preferences

CLI

  • Get current state:
    gsettings --schemadir ~/.local/share/gnome-shell/extensions/[email protected]/schemas/ get org.gnome.shell.extensions.caffeine toggle-state
  • Enable Caffeine:
    gsettings --schemadir ~/.local/share/gnome-shell/extensions/[email protected]/schemas/ set org.gnome.shell.extensions.caffeine toggle-state true
  • Disable Caffeine:
    gsettings --schemadir ~/.local/share/gnome-shell/extensions/[email protected]/schemas/ set org.gnome.shell.extensions.caffeine toggle-state false

--schemadir — path to the extension schemas directory. It may be different on your system.

gnome-shell-extension-caffeine's People

Contributors

alexmelman88 avatar big-ant avatar ckotte avatar daphipz avatar dapigguy avatar dffischer avatar eljenso avatar eonpatapon avatar hosiet avatar hrko avatar juxuanu avatar kaechele avatar marcioalmada avatar mirko-laruina avatar morganantonsson avatar morrisjobke avatar nexero avatar nickcis avatar osmancoskun avatar pakaoraki avatar ralgo avatar rffontenelle avatar robberphex avatar sanjayankur31 avatar smcv avatar stuarthayhurst avatar titouanreal avatar vistaus avatar websnke avatar zeten30 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gnome-shell-extension-caffeine's Issues

Implement options for restoring state

After using the current version for a while, I think it would be a good idea to implement options for when to auto-disable caffeine.
Often I lock the screen when I walk away from my laptop and would like caffeine to be enabled when I come back.

Currently caffeine does not restore the state. Hence, caffeine will be disabled after locking the screen or restart of the system.

Options to enable restores after locking the screen and/or system restart would be good.

Extension setting cannot be opened.

I tried to open Caffeine's setting via Gnome Tweak Tool, but it showed error and the setting window did not appeared.

  • GNOME Shell: 3.24.1
  • GNOME Tweak Tool: 3.24.0
  • Distro: Arch Linux (up to date on 2017-05-02)

screenshot from 2017-05-02 19-00-53

TypeError: redeclaration of let hbox

Stack trace:
  Application<._getExtensionPrefsModule@resource:///org/gnome/shell/extensionPrefs/main.js:74:13
  wrapper@resource:///org/gnome/gjs/modules/lang.js:178:22
  Application<._selectExtension@resource:///org/gnome/shell/extensionPrefs/main.js:89:31
  wrapper@resource:///org/gnome/gjs/modules/lang.js:178:22
  Application<._onCommandLine@resource:///org/gnome/shell/extensionPrefs/main.js:243:17
  wrapper@resource:///org/gnome/gjs/modules/lang.js:178:22
  main@resource:///org/gnome/shell/extensionPrefs/main.js:399:5
  @<main>:1:49

Screen starts to black out immediately after exiting full-screen

You wouldn't believe how hard it is to create a title for this bug.

How to reproduce:

  1. Turn "Enable when a full-screen application is running" to on.
  2. Watch something in a full-screen window for long enough.
  3. Exit full-screen. You will now notice the screen starts to slowly black out. You have to wiggle the mouse or something to stop it.

Not showing up in Gnome-Software

I see that this extension works fine with Gnome 3.22, but it is not showing up by default in extensions.gnome.org when sorting by "current gnome version", and only shows up if you select "all versions". Further, this addon does not show up in Gnome-Software, probably for the same reasons as above.
I don't know if it is just a flag that must be set to broadcase gnome 3.22 support, but please do it. This addon is incredible.

[enhancement] Gnome Shell Extensions Site

Even if there's some inhibit extensions on the site, I think the one you made is in the way of the good ol' caffeine program I used on Gnome 2. I think it would be great if you propose it. =)

delay time between shutdown select and when windows appears

On click on shutdown button inside the top menu (ref. attach. n.1) the delay time until the windows appear are about 30 seconds. Occur only on the first time on the session.
Case 1: caffeine disabled
instantly windows appear.
Case 2: caffeine enabled
first selection 30 seconds for windows appear.
Case 3: caffeine enabled - with the second attempt
first selection 30 seconds for windows appear, then i press cancel button. On second attempt the windows appear instantly.
Case 4: caffeine enabled - gnome-shell restarted
after case 3 i restart gnome-shell and the issue return.

Thank you 4 your time.
Bye
Lorenzo.

screenshot from 2016-11-12 16-36-22

TypeError: redeclaration of let hbox

Hello!

Today I fave the following issue, when I tried to open extension settings in Gnome Tweak Tool:

TypeError: redeclaration of let hbox

Stack trace:
  Application<._getExtensionPrefsModule@resource:///org/gnome/shell/extensionPrefs/main.js:74:13
  wrapper@resource:///org/gnome/gjs/modules/lang.js:178:22
  Application<._selectExtension@resource:///org/gnome/shell/extensionPrefs/main.js:89:31
  wrapper@resource:///org/gnome/gjs/modules/lang.js:178:22
  Application<._onCommandLine@resource:///org/gnome/shell/extensionPrefs/main.js:243:17
  wrapper@resource:///org/gnome/gjs/modules/lang.js:178:22
  main@resource:///org/gnome/shell/extensionPrefs/main.js:399:5
  @<main>:1:49

OS: Ubuntu Gnome 17.04 (Gnome version is 3.24)

I've installed node js 7.9.0 today, maybe it is connected.

Settings of other extensions works normal.

Icon over-ride in 3.6

Under 3.6 the icons have changed like another extensions, you have to rename them from symbolic or they are overridden by the default gnome icon for Caffeine.

I renamed both icons and changed both lines to
caffeine1-on-symbolic and
caffeine1-off-symbolic

and they work again.

Icon and messages are difficult to interpret

Great extension, I have some user experience complaints.

The icon is non-intuitive (at least for me) and not documented. I cannot know which icon means that the screen saver will be turned off.

Suggestion: Document the meaning of the icon more clearly at least in the README, preferably also in the extension with hovering mouse tips or optional text beside the cup.

The messages that the extension gives are also difficult. "Caffeine enabled" and "Caffeine disabled" do not tell me which means that the screen saver is off.

Suggestion: Change the messages or add another descriptive line like "The screen saver is now turned off."

Causes gnome-shell 3.16 to temporarily stop responding on first power button event.

This is a fantastic extension. I have it on all my Linux systems. Thank you for all your hard work.

After upgrading my Arch systems to gnome-shell 3.16, the first press of the power button causes gnome-shell to become unresponsive for about 25 seconds before finally displaying the Gnome power-off dialog. If the Cancel button is clicked once the power-off dialog appears and then the power button is once again pressed, the power-off dialog appears almost instantly. But after rebooting, the delay from power button press to showing the power-off dialog returns. It may also be forced by disabling the extension, restarting gnome, and re-enabling the extension.

I searched through the code, but I'm not a Gome developer, and so am not sure what is causing the issue.

Session Manager

On Gnome 3.24 everytime i want to shutdown my PC via the Session manager on the Right in the Top bar, my PC freezes for 10 seconds. Maybe there is a fix for that

bug: [alt+tab]ing away from full-scrn windows triggers notification

tl;dr I'm currently seeing notifications when I don't expect them. Does the behavior I describe below sound intended? If not, is it this extension's fault or does this sound like a gnome bug?

From the extension's listener and its binding, it seems the only explanation is a buggy gnome-shell is emitting org.gnome.SessionManager::InhibitorRemoved when it shouldn't?


All the specifics I can think of:

$ gnome-shell --version
GNOME Shell 3.18.1

$ lsb_release --all
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux testing-updates (sid)
Release:    testing-updates
Codename:   sid

$ uname -a
Linux carboy 4.3.5 #1 SMP Sun Feb 28 20:09:54 EST 2016 x86_64 GNU/Linux
  • Steps to reproduce

    1. open browser
    2. open new window in browser and fullscreen that window
    3. wait 2 seconds
    4. type alt+~ to switch between browser windows
  • Expected behavior:

    No new notifications should occur (since steps 1-3 don't involved interacting with the extension)

  • Actual behavior

    step 3 produces a notification "Auto suspend and screensaver enabled"

Fedora Packaging

Hi

I will try to package your add in the Fedora Repos, I have packaged my firts Gnome Shell Extensión and will like to improve the Fedora Gnome Shell experience adding your extensión to the repository.

I will track in this issue.

Regards

Gnome 3.22

Hi, you extension is good but one request, pls update to Gnome 3.22 thx very very thx bro...

Missing strings in translation file

Dear Jean-Philippe
There are three strings untranslated/ missing in the PO file:

  • Auto suspend and screensaver enabled
    • Auto suspend and screensaver disabled
    • Enable when a fullscreen application is running

Could you please add them?
Thank you
Roman

Caffeine does not disable screensaver

Hello,

I am using Arch Linux with gnome shell 3.16. I have xscreensaver together with xss-lock.

However, Caffeine does not work.

  • First I tried the auto disabling feature (disable when an application is running in fullscreen mode). I saw that Caffeine realised that VLC is now running in fullscreen mode (I saw it on my second screen).
  • Then I disabled it manually. No luck.

(And I also tried it with only one screen.)

I guess it is due to my setup. (It took me a while to get my screensaver to work... whyever...).

I am happy to help debugging this... Btw, this extentions seems quite cool.. hope we can sort this issue out :)

Regards

Caffeine gets disabled even when auto enable applications are running

When I have two or more applications (say vlc and evince) on the 'auto enable caffeine' list, and when I start vlc, caffeine gets enabled. Tthen I start evince. Now if I quit vlc, caffeine gets disabled, though evince is still running.

The application that enables caffeine also disables it, irrespective of the status (running or not) of other applications in the 'auto enable caffeine' list. Ideally caffeine should disable only if no other applications in the auto enable list is currently running.

Disable caffeine on shutdown

Currently caffeine restores the state after reboot, which can be confusing.
As mentioned in #31, caffeine should be disabled at some point during a reboot.

Caffeine losing state after few minutes

I've updated the extension through Gnome Extensions (https://extensions.gnome.org/extension/517/caffeine/) and since the last update, Ceffeine is resetting its state after few minutes, even if the computer is under use.

The result is that even if I click on the extension to keep my screen on, after 5 minutes the screen is shutdowned.

I've observed this behavior on two different machines, a laptop and a desktop.
Both are running the latest stable Gnome version (3.18.2) on Archlinux.

Some language strings shown in English instead of regional language

Hi Jean-Philippe

The language strings "auto suspend and screensaver disabled/ enabled" are still showing up in English instead of German. I thought it's a version issue, but it's still in your current version released a few days ago ...And as far as I see it's the same for the configuration strings added more recently, like "enable when a fullscreen app is running".

When changing to "francais" it seems to works for French, but not for Spanish either.
What could be the issue here? I'm using Fedora 22.

Cheers, Roman

German translation

One translation is „Applikationen welche Caffeine automatsich aktivieren“. There is a typing error, it should be „Applikationen welche Caffeine automatisch aktivieren“. Actually I think that additionally one should put a comma after „Applikationen“.
In the rest of Gnome shell “applications” is translated by “Anwendungen”, so I think this would be better. “Top panel” is translated by “obere Leiste” normally. “Enable notifications” is not translated at all and is not mentioned in the po-file.

Redeclaration of let hbox - Solus Gnome

TypeError: redeclaration of let hbox

Stack trace:
Application<._getExtensionPrefsModule@resource:///org/gnome/shell/extensionPrefs/main.js:75:13
wrapper@resource:///org/gnome/gjs/modules/lang.js:178:22
Application<._selectExtension@resource:///org/gnome/shell/extensionPrefs/main.js:90:31
wrapper@resource:///org/gnome/gjs/modules/lang.js:178:22
Application<._onCommandLine@resource:///org/gnome/shell/extensionPrefs/main.js:246:17
wrapper@resource:///org/gnome/gjs/modules/lang.js:178:22
main@resource:///org/gnome/shell/extensionPrefs/main.js:402:5
@

:1:49

This is the error. The extension seems to work fine since it is showed in the topbar and I can enable and disable it but if I try to open the preferences panel this is the error I get. Also the screensaver is not disable at all, probably due to the error I mentioned above

Solus 2017.04.18.0 64-bit

Caffeine icon disappears after lock or gnome restart.

Caffeine icon disappears after lock or gnome restart.
This does not seem to affect Caffeine's functioning, but, obviously disallows hot/cold coffee switching
Icon can be brought back using IconHider.

Fedora 20
Gallium 0.4 on AMD RV635
Gnome Version 3.10.2

Applications not in list

Hi,

Some applications e.g. dolphin-emu are not listed in the applications list. These applications are located in /usr/share/applications. Is there anyway to add them?
Some other applications which are listed are also located in this directory so i do not follow the logic of the applications list.

Ubuntu Gnome 14.04.1 LTS

Debian Jessie Extenstion Error

Debian Jessie , Gnome 3.14.
Today I updated Caffeine Extension, but after that errors happened:
screenshot from 2015-10-11 16 21 39
I don't know where the error log stores. If you want to have more error information, tell me how to get it.

When using top bar through keyboard, can't toggle Caffeine

Regardless of whether there there's a specific or configurable key combination for Caffeine, if I use a keyboard to access the GNOME top bar via Ctrl+Alt+Tab, I should be able to hit Enter on the Caffeine icon to toggle it. This doesn't seem to work under GNOME 3.22.

Disable caffeine automatically on manual lock

Every time when I lock my screen it means that I don't need the caffeine feature any more but I tend to forget to turn off caffeine.

It would be great if it automatically disables itself when I lock the screen or put the machine to sleep manually.

Constant notifications after session unlock

Caffeine is automatically disabled when re-entering a session after the screen has been locked (either just locking the session or suspending the computer, which also locks the session).

However, enabling Caffeine again by clicking on its icon triggers constant activation notifications: if dismissed, a new notification appears again and if not dismissed, notifications keep popping up infinitely.

One can avoid this or stop notifications to constantly pop up is to restart the shell (alt + F2, r). After restarting the shell, Caffeine acts normally again (until the next screen lock happens).

Disabling notifications in the extension's preferences makes also Caffeine work properly.

Distribution: Arch Linux
GNOME Shell 3.6.2
gnome-session 3.6.2
gnome-screensaver 3.6.1
dbus 1.6.8

Preferences dialog won't load on GNOME 3.24

GNOME 3.24 contains a newer version of GJS which has stricter JavaScript rules, e.g. you can't redeclare variables. When trying to bring up the preferences box I get:

TypeError: redeclaration of let hbox

Stack trace:
Application<._getExtensionPrefsModule@resource:///org/gnome/shell/extensionPrefs/main.js:74:13
wrapper@resource:///org/gnome/gjs/modules/lang.js:178:22
Application<._selectExtension@resource:///org/gnome/shell/extensionPrefs/main.js:89:31
wrapper@resource:///org/gnome/gjs/modules/lang.js:178:22
Application<._onCommandLine@resource:///org/gnome/shell/extensionPrefs/main.js:243:17
wrapper@resource:///org/gnome/gjs/modules/lang.js:178:22
main@resource:///org/gnome/shell/extensionPrefs/main.js:399:5
@

:1:49

(Option to?) Integrate with system menu

This is a proposal for a possible aesthetic enhancement, so of minor importance. Feel free to "won't fix" it.

Would it be possible to move the enable/disable action into the system menu, similar to e.g. the wifi menu? Also, the indicator would be invisible when caffeine is disabled, but would be visible together with the other system indicators (e.g. wifi, volume, battery, etc.) when active?

Thanks for your efforts!

Add running applications list.

Since this gives the impression that it is essentially Caffeine, it should have some of the same abilities.

For starters, is it possible to add a customizable list of which applications this should run for. It should give the ability to run automatically when those applications are detected, and if they are not it should hide it's panel icon. That way when it is running, you see the icon and have the ability to enable the screensaver/disable caffeine.

Of course, this would be optional, and if the option to use the custom applications wasn't selected, it would run as normal and always be visible.

With the custom option in use, it should also save it's inhibit on/off setting across reboots, or you could have a persistent option for both methods even?

Caffeine causes gnome-session-quit time out in GNOME 3.20

System Information

  • Arch Linux
  • Gnome 3.20
  • Linux 4.18 LTS version

Description

The issue only happened once when you first call power off button, and second time or more is fine.

  • GUI

    if click "power off" button in control menu, which is located on the right-top of main screen, it will take long time (about 20 second) to start power off menu and I couldn't do nothing during this time but move cursor.

  • Command-Line

Try to use command line to call the power off menu with "gnome-session-quit --power-off" in terminal to check the error information. it still take long time and only could move cursor. the error message below:

** (gnome-session-quit:26290): WARNING **: Failed to call Shutdown: Timeout was reached
  • Repeat

To Repeat the issue, you need to reboot, re-login or restart gnome-shell (via alt+F2 then 'r'), click power off menu or input the command line.

  • Screenshort
    • Command Line
      selection_031
    • Power Off Button
      screenshot from 2016-05-06 12-18-38
    • Power Off Menu
      screenshot from 2016-05-06 12-16-02

GOOD LUCK

Sugestion: Add delay before "auto-enable" turns Caffeine on/off to avoid "bouncing".

Nice to have a short delay before switching Caffeine ON/OFF on maximizing/minimizing.
Maximizing/Minimizing (forth and back) in a mistake, or when grabbing windows around the workspace, and accidentally triggering "the snap feature" on/off (auto-maximizing/minimizing).
In such cases Caffeine switches ON/OFF undesirably.
A short delay could introduce a "debouncing" effect, avoiding this effect.

Thanks for very useful extension and valuable support!

Caffeine sometimes gets stuck "on" in Gnome 3.14

Using the feature where caffeine detects if a window is fullscreen and turns on in those cases, under Gnome 3.14, sometimes the "on" state remains toggled even after the window is closed and the extension cannot be manually toggled off.
In these cases, the gnome shell must be restarted to resume functionality.

[Ubuntu unity] How to access settings?

I cant seem to get to the GUI. The indicator works well and I can turn it on and off. The problem is that i cant add any custom apps that caffeine should inhibit.

Do I have to install any GNOME packages for this to work on a new ubuntu 16.10 install?
Or is there a text file that I can directly access to add the apps i want?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.