Wow!!!! Thank you so much!!!
Uli Schlachter <[email protected]> schrieb am 14:06 Montag, 15.September 2014: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Hi, Am 15.09.2014 um 12:39 schrieb Zum Testen: [...] > mybrightness.lua (the global mybrightness_launcher will be added to my > wibox): > > local awful = require("awful") > > local mybrightness_menu = awful.menu({ items = {{"100%", function() > awful.util.pread("xbacklight -time 0 -set 100"); brightness_update() end}, > {" 30%", function() awful.util.pread("xbacklight -time 0 -set 30"); > brightness_update() end}}}) mybrightness_launcher = > awful.widget.launcher({image = "bright100.png", menu = mybrightness_menu}) > > function brightness_update() local max_brightness = awful.util.pread('cat > /sys/class/backlight/intel_backlight/max_brightness') local > actual_brightness = awful.util.pread('cat > /sys/class/backlight/intel_backlight/actual_brightness') local > brightness_percent = 0 if max_brightness ~= nil and actual_brightness ~= > nil then brightness_percent = actual_brightness * 100 / max_brightness end > > if brightness_percent > 50 then brightness_icon = "bright100.png" else > brightness_icon = "bright030.png" end > mybrightness_launcher:set_image(brightness_icon) end > > brightness_update() Apparently, :set_image() was never intended to be usable on launchers / be accessible after the widget was created. Fixed with this commit: http://git.naquadah.org/?p=awesome.git;a=commitdiff;h=a113fe0f3c268f10e1a0264d0fbc2962d3c562a7;hp=305f148c4b747b7e28f679deaf6a6872ebbf6f8d That commit is also attached to this mail. If you are using 3.5, you should be able to apply these changes to your /usr/share/awesome/lib/awful/widget/button.lua and your code starts working. Cheers, Uli - -- "Are you preparing for another war, Plutarch?" I ask. "Oh, not now. Now we're in that sweet period where everyone agrees that our recent horrors should never be repeated," he says. "But collective thinking is usually short-lived. We're fickle, stupid beings with poor memories and a great gift for self-destruction. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBCAAGBQJUFtV5AAoJECLkKOvLj8sGyzkH/itUsPywOP2TGAEzS8PJJuNA 2IEojotI2U0PWBbSVHb6omozWOJ2rENL39pXokkB6lcw1RNPSUqVwDd0fjDm/LSA EdtoLH663xcBmncLr741p5HNxPi7GS/Kb0r9rBXft9WMEgjyLl0zFq/TWZcjuppF N9hQCX722WH6qeRdoeNRpxisFRyVb9fY9hlR4jo4sb9aBnn8emav1K5NnUmtmm+q 6hKngYIZdXE1ghpQOpSmQKDzIJqH9XzmJfEPkS1UX0e6OiyBi3cnIsFans3UmyNn tmEtHx5xFmFXl10igaGhN4vgizkLyfoSXFyViQqMsstPj1m/B9akvztrFjj6tAg= =BxXf -----END PGP SIGNATURE----- -- To unsubscribe, send mail to [email protected].
