Feb 182017
 

Instructions

I will be creating a dedicated module using Drupal Console for this event subscriber. But feel free to use your own if you already have one! (don’t forget to backup)

  1. Access the drupal root folder in command line.
  2. Generate a new module:
  3. Generate the event subscriber. We will subscribe to the kernel.request event:
  4. Current state:
  5. Install the module using either drupal module:install or drush pm-enable:
  6. Now, refresh your web page and on each request received server side, a message will tell you the event occurred!

Additional Information

  • Instructions made on Drupal 8.2.x.
  • Using Drupal Console, you can easily inject services such as the current_user one by answering yes when it asks if you want to load services from the container. Please check this article about service dependency injection: [Drupal] Service dependency injection in a service type class.
  • After editing your files, remember to run a cache rebuild either with drupal cache:rebuild or drush cache-rebuild.
  • Events documentation entry point: Events on Drupal 8. You will find a few core events here.
  • The callback function’s name can be changed to whatever you want.
Jun 192016
 

Tired

Time spent to get the info: one day. Length of the fix: a few lines. Haha, this is so ridiculous it makes me smile a little.

Okay, so you are:

  1. on fresh Debian Jessie (GNOME 3),
  2. on a laptop,
  3. with an integrated graphics unit,
  4. and it is an Intel CPU. In my case, I have a Core i3 Sandy Bridge CPU with HD Graphics 3000.

The backlight function keys:

  1. are working so you have an on-screen display feedback,
  2. are not changing the effective brightness of your screen,
  3. are changing the values of this file: /sys/class/backlight/acpi_video0/brightness (close and reopen in gedit to see the value changing or check by command line).

You have this folder: /sys/class/backlight/intel_backlight.

Yay! You may have a solution!

  1. Create a file:
  2. Add this in the file:
  3. Save file.
  4. Close gedit.
  5. Restart the computer.
  6. It should work now!

If this fix does not work on your laptop, I am sorry to hear that but I cannot help you further. Don’t ask the noob. I have just followed guidance on linux threads such as here: link to Ubuntu’s launchpad website. Good luck!