Page 1 of 1

Improved an applet. Care to test?

Posted: Mon Feb 01, 2021 5:15 pm
by Drugwash
First of all I don't understand why there's no specific section on this board for generic code talk. No idea where to ask certain code-related questions or publish things like this one here.

Practically I felt bored one day and since I had just installed a new applet that does what the built-in commands should do but don't some ideas popped to mind. Someone on its specific page was asking ironically what this does that an older similar one doesn't. Well, for starters it doesn't ask the user to install an extra mandatory library. I like that.

Before continuing someone might ask why not go to github and interact directly with the developer/maintainer. Hell no. That place - besides belonging to Micro$oft - is so weirdly structured that I just can't understand it. And even if I took one week or one month to try and grasp its concepts I'd forget everything within a couple days due to my bad memory. Not to mention the whole login procedure, which is unacceptable in either variant. So no github. If the current maintainer @cardsurf happens to be passing by I'll gladly have a chat.

OK, so the applet is called Brightness and Gamma Applet. Its official Spices page is here.
What have I done? First of all added a tooltip. I hate it when a tray icon doesn't tell me what it's doing there, more so when its icon is ugly-symbolic and ambiguous. So now it displays a nice tooltip with details on the screen and displays it's enabled for, the Mode (talk about that right away), and the percentual levels for Brightness and RGB. Tooltip gets updated in real time when scrolling mouse wheel over icon to adjust brightness.

Then I added a Mode switch upon middle-click that cycles through three different modes: Day, Night and Custom. For now only Brightness can be set to different values for each mode. It's more like a proof of concept, a test. If/when I feel again like messing with code I may improve it even further. Oh and there's also a brief popup notification when cycling through modes so the user knows exactly what was chosen since the tray icon does not (yet?) reflect current mode.

There are many other things to do, like saving/loading all custom values for all modes; for now they are hardcoded (for brightness only). Or options to choose specific icons for the popup notifications (and tray icon maybe, at some point). Other ideas would be welcome.

This mod has only been tested in Mint Cinnamon 19.2. Hopefully it works in other older or newer versions but that's for you to test and report back, if you want to.
Installation is as simple as unpacking the contents of the archive (folder included) in ~/.local/share/cinnamon/applets.
If already installed choose to overwrite all files. Of course, backup the existing applet's folder before overwriting, just in case.
a) If applet is already enabled and running, open Looking Glass (right-click panel > Troubleshoot > Looking Glass), select the Extensions tab,
find Brightness and gamma applet in the list, right-click it and choose Reload Code.
If it doesn't show back up in the tray switch to the Log tab and look at the bottom for any related error messages. Then please copy/paste here hoping it can be fixed. But hopefully there won't be any errors.
b) If applet was not previously installed you will have to open the Applets GUI (Main Menu > Preferences > Applets) and enable it there.
At the same place it can later on be disabled or uninstalled if so desired.

Anyway, here you are v1.1.2.1 based on official v1.1.2: Enjoy! 8)