Brightness 1.0.2
UUID: brightness@markbokil.comScore: 6
Download

Brightness applet for laptops. It only works on laptops since it changes the backlight power setting. It doesn't mouse scroll from the panel yet but it will eventually.
To Install
1) Extract to ~/.local/share/cinnamon/applets
2) Enable the applet in cinnamon settings
Changelog===================
1.0.2 - added fix for LMDE crash Javascript bug workaround
1.0.1 - added timer delay to avoid Cinnamon crash
1.0.0 - stable release.

It works, but not like my built in brightness. This looks very gross and I dislike it.
Thanks for checking. It looks like I am going to have to use a dbus command to get the system power level for the backlight on a laptop. I'm going to need a laptop with Gnome 3 to work on this. Can u try this command in a terminal and let me know if it has an effect? gdbus call --session --dest org.gnome.SettingsDaemon --object-path /org/gnome/SettingsDaemon/Power --method org.gnome.SettingsDaemon.Power.Screen.SetPercentage 75
That is it! Thank you :) have already plugged in the cmds in the applet
mbokil, feel free to email me at bendloveless@gmail.com if you need any testing, I'm more than happy to help :p
Ok thanks. Brightness is more complicated than I thought. On laptops brightness changes backlight but on a desktop you have to access the video drivers. I need a gpl brightness Icon for the panel or I might make one. Do you have any working slider code examples? Mark[dot]bokil[at]gmail.com. I'll send u a beta version once I get the ui hooked up. Thanks for ur help.
I'd open the sound menu.
I added a custom brightness icon and hooked up the menu so people can use it until I am done with the slider and GUI design. I'll take a look at volume for code.
Hi "mbokil", I've just tested your current version and it works on my laptop. And I think this is the most important thing as it saves battery power. I don't know how much work it would be, but do you think of implementing mouse wheel support? This could make changes in brightness more easy. But that's just a suggestion... Thanks for your work!
@Lucas - mousewheel support is on my list of todos. Maybe next week I can get back to it. I need to add some final polish and maybe an alert for laptops that are not supported. Glad it works for you.
Current version crashes atm. Are you using a schema?
what's atm?
At the moment.
I tested it on a eee pc with latest Cinnamon and it tested okay. If you have any lookinglass errors can you email them to me? Thanks.
Fella, this crashed Cinnamon on Lisa 64Bits. Issue repeated on multiple ocasions.
If you are reporting a crash let me know exactly what you were doing. Dragging slider? Also if you can look in Looking Glass Alt+F2 lg and post any error messages.
Also if you can give me your system info. What kind of laptop? What is the graphics chip?
I have a Toshiba Satellite C655-S5049 with Intel® HD Graphics (Integrated [2000 not 3000]) And it crashes when loaded. I'm assuming there is a schema file you're using which I don't have. I will look into the script when i get home.
I can't check the looking glass, because it crashes cinnamon.
When the applet loads it first attempts to get the power setting from the gdbus command: gdbus call --session --dest org.gnome.SettingsDaemon --object-path /org/gnome/SettingsDaemon/Power --method org.gnome.SettingsDaemon.Power.Screen.GetPercentage . Try this command in a terminal and see what it says. I am guessing this command is missing on some systems or they are using another way to access the power managment. I wouldn't be suprised if Intel, ATI, and Nvidia all use different methods.
Hey it happens to me as well as bownz (I have Intel HD 3000 though) and it crashes completely when loaded. Laptop is a Lenovo Z470.
@Danko if you are feeling gutsy can you cut and past the command I have listed above into a terminal and let me know if it crashes Cinnamon. It doesn't seem to like the intel HD. I have an eee pc with old Intel graphics and it works fine so something changed. If I could borrow a laptop with Intel HD I could probably fix it. Maybe I can load Cinnamon onto a flash drive and test it out at a local computer store. They probably wouldn't notice if I do a little testing in the field before I purchase a laptop. ;)
mbokil the command works fine, and remember the first one you uploaded worked fine for me.
@bownz the major difference between the first one I uploaded and this app is that this one attempts to get the power level on applet init so it can draw the UI correctly. It might be the case that Gnome and the applet are both trying to access the setting simultaneously which would probably be very bad and lead to a crash. One idea is to remove the initial probing of the system at applet load or possibly use a timer with a 500 ms delay to allow the system time to get the info before it attaches it to the GUI. I have used this hack before in Firefox extensions and it fixes a lot of problems. Interesting stuff. Learn something everyday. I will make the change, test it and upload it say by 8:30 pm EST.
completely crashed my Linux mint debian edition. had me scared there for a minute. i ended up deleting the applet. I really hope you can get the bugs worked out. I've been anxiously awaiting a brightness applet. I'm running Samsung i5-2410M CPU @ 2.30GHz × 4
@cinnamint Just added 1.0.1. Please test and let me know if it works. I added the timer delay hack. I beat on the app on my eee pc and I couldn't crash it or Cinnamon.
Works now mbokil, thanks very much.
might wanna fix this, I restarted the cinnamon, and it was all like Brightness: 56.99999999999999999999%
@bownz - your welcome. I uploaded a fix after you noticed the percent bug. It just needed a Math.round in there. I kind of like using the brightness on my laptop now. I never realized how bright I had it set. Looks like I can get by at around 80%.
@bownz - I saw you had some dialogs in your apps. I am trying to figure out how to center only one button in a dialog for an alert dialog. Is there something else besides confirm I can use?
tried it again and it broke again. perhaps because im on debian, i dont know. :/
mbokil, You might be able to use a ccs file? I don't quite know how to center buttons.
@bownz thanks the CSS did the trick. If it is still crashing for you and you want to help debug then backup your work, open a terminal and enter: gdbus call --session --dest org.gnome.SettingsDaemon --object-path /org/gnome/SettingsDaemon/Power --method org.gnome.SettingsDaemon.Power.Screen.GetPercentage Let me know if it fails or if it crashes your system.
@debimint or other debian users can you try the gdbus command above. It would be helpful to know if xbacklight is on your system. try xbacklight -inc 10 or xbacklight -dec 10 from a terminal.
Hi mbokil, xbacklight was not installed on LMDE. Still crashes here with xbacklight installed. Command "xbacklight -inc 10 " and "xbacklight -dec 10" do not in- or decrease the back light value. gdbus Command output under user: "(uint32 100,)" su; "Error connecting: The connection is closed" System: LMDE+nvidia302.07.
@dnz16 Thanks very helpful info. So xbacklight is not an option. The gdbus command is working on your system, so that is good. I think the crash is from the applet trying to get this information when it starts up. I am uncertain why it would crash it. I have removed that code to see if it prevents a crash when it loads the applet. If you could test out this experimental version: http://markbokil.com/downloads/brightness@markbokil.com.zip
@mbokil Ok now I can add the applet to the panel and the WM/Xorg stays up and tooltip shows "Brightness". Now the follow situation: if I click on the icon the WM restarts, if I click for the second time on the icon, Xorg restarts. Seems that "Util.spawnCommandLine(SetBrightnessCmd + brightness);" doesn't work well. Workaround: I've set "const SetBrightnessCmd;" "const GetBrightnessCmd;" and I've replaced "Util.spawnCommandLine(SetBrightnessCmd + brightness);" with "Util.spawnCommandLine('gdbus call --session --dest org.gnome.SettingsDaemon --object-path /org/gnome/SettingsDaemon/Power --method org.gnome.SettingsDaemon.Power.Screen.SetPercentage '+ brightness)", screen back-light will now in- and decrease with the slider and no crash anymore... but when you click again on the icon, the slider and tooltip is set back to 100.
@dnz16 thanks for all your testing. I uploaded one more experimental version. I wanted to take one last stab at not hard codeing the commands. It works on my laptop. I am guessing that the constants are not being evaluated as strings for some reason. I added a .toString() to the constant variables. Please give it a try. If it still fails I will hard code the commands per your example. http://markbokil.com/downloads/brightness@markbokil.com.zip
I realized the bug reports are mostly coming in from LMDE. I am using Ubuntu/Cinnamon. It is possible the Javascript interpreters are different versions resulting in this Javascript string variable oddity. Interesting.
@mbokil it still crashes, think that it goes wrong at declaration. Here the version I use now as described earlier ("but when you click again on the icon, the slider and tooltip is set back to 100.") http://dl.dropbox.com/u/22130312/brightness@markbokil.com.tar.bz2
@dnz16 try the latest 1.0.2 I uploaded today. I hard coded all the gdbus commands and it shouldn't crash. When the app icon is clicked it shouldn't reset to 100 anymore. That was a similar bug where javascript apparently dislikes constant string variables in gnome shell commands. Thanks for all your help. Should be stable for everyone now.
mobokil: My laptop is in repair right now so I have currently no way of knowing if it works with it or, again, makes it crash. I do, however, know it works with my brother's Compaq Presario that features an ATI Mobility Radeon HD 4200. Thanks for the applet, it works just as planned. Cheerio, Danko.
@Danko8321 glad to hear it is working. I tested it on all the laptops I could find and it wouldn't crash so it should be stable now. There are apparently some small differences between Ubuntu/LMDE/latest Gnome shell with Javascript. I am uncertain why this is the case but I had to workaround these differences to make it work on everything.