Code Monkey home page Code Monkey logo

gnome-dnd-timer's Introduction

Gnome Bedtime Mode

Hey Gnome, it's bedtime!

Converts to grayscale the entire Gnome workspace by using a smooth transition. Best to use during evening/night.

This behavior is similar to Android's bedtime mode which converts the phone screen to grayscale. It should somewhat make your device less appealing and limit the usage of it before bedtime. On my side, at least, it still requires a fair amount of self control in order to make that happen.

The extension has a nice Preferences (Settings) UI where you can customize it to your liking:

  • Set an automatic schedule for turning on/off the Bedtime Mode
  • Add an On Demand button to Top Bar or a Quick Settings toggle to manually enable/disable the mode
  • Control the On Demand button visibility, appearance and position in Top Bar
  • Choose another color preset and intensity, if you prefer a different color scheme
  • Change color intensity on the fly by scrolling over the On Demand button in Top Bar

Multi language support is also available. Please check the Translators hall of fame section for the supported languages list and Guide for translators section if you want to contribute with a translation for your native language.

Peace! 🌞

Installation

From the official GNOME Shell Extensions website:

Get it on GNOME Extensions

Or

You can download the latest release package and manually install it to your extensions folder. The latest package only supports Gnome version '45'!

For older Gnome versions please use the official GNOME Shell Extensions website mentioned above.

wget https://github.com/ionutbortis/gnome-bedtime-mode/releases/download/v18.0/gnome-bedtime-mode_18.0.zip
# (Or manually download via browser and run the next commands from the download folder)

gnome-extensions install --force gnome-bedtime-mode_18.0.zip

rm gnome-bedtime-mode_18.0.zip

Next, you need to log out and log in again into your user account

You can now enable/disable the extension by running the Extensions app (search and install it from your distro repos or get it from here), or by browsing to https://extensions.gnome.org/local.

Alternatively, you can do this from command line:

gnome-extensions enable [email protected]
gnome-extensions disable [email protected]

To open the extension's Preferences (Settings) UI, use the Extensions app or run this command:

gnome-extensions prefs [email protected]

Keyboard shortcut

If you want to use a keyboard shortcut in order to toggle the Bedtime Mode then you can do this:

  • Go to "Settings -> Keyboard -> Keyboard Shortcuts"
  • Click on "View and Customize Shortcuts"
  • Go to "Custom Shortcuts" and click "Add Shortcut" or the "+" button
  • Fill the inputs with the following
    • Name: Toggle Bedtime Mode
    • Command:
bash -c 'schema_id=org.gnome.shell.extensions.bedtime-mode; schema_dir=~/.local/share/gnome-shell/extensions/[email protected]/schemas/; if [[ $(gsettings --schemadir $schema_dir get $schema_id bedtime-mode-active) == true ]]; then turn_on=false; else turn_on=true; fi; gsettings --schemadir $schema_dir set $schema_id bedtime-mode-active $turn_on;'
  • Press "Set Shortcut" and use your preferred one
  • Done!

How can you contribute?

Help is always needed so if you found this extension helpful, the best way to contribute is to help with the creation of new translations (see next section).

If you encounter some bugs, please submit them as issues here on github. Also, feature requests or improvement ideas are welcomed.

Guide for translators

If you like the extension and want to help in creating a translation for your native language, please carry on reading. 👍

Fork this github repository and clone your fork onto your local machine. Also, checkout the next-release branch:

git clone [email protected]:[your_github_username]/gnome-bedtime-mode.git
cd gnome-bedtime-mode/ && git checkout next-release

Run the languages.sh script with the --new-locale=xx argument in order to create a new translation file (you need to replace xx with your language code):

./scripts/languages.sh --new-locale=xx

Enter your email address when prompted and a new translation file should be successfully generated into the gnome-bedtime-mode/po folder. It will have the name of the new locale and the .po extension.

Then, you just need to use a tool for opening the .po file and translate the texts. Popular choices are Gtranslator and POEdit.

When the new .po file is fully translated run the install script and the extension should be packaged with the new translations and installed to your Gnome shell:

./scripts/install.sh

After running the install script you need to re-login and manually enable the extension via an app or command line:

gnome-extensions enable [email protected]

Open the extension preferences and check if all the texts are properly translated. If the new translations look fine push the changes and create a pull request to the next-release branch on the original repository.

That's it! You are now an official contributor to this extension, YaaY! 🥳 🎉 🙏

Credits

Credits for inspiration go to:

I wrote this extension because I use the Android's Bedtime Mode on a daily basis and I wanted something similar for my laptop. Having Ubuntu as my main OS, I liked the idea of extending the desktop shell to your liking. It was also a good way to improve on my JavaScript coding skills.

Many thanks to the creator of the Night Theme Switcher extension. I used his code for reference since the Gnome Extensions Coding documentation was not that great when I first started.

gnome-dnd-timer's People

Contributors

ionutbortis avatar daphipz avatar oscfdezdz avatar vistaus avatar albanobattistella avatar cewbdex avatar rene-coty avatar

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.