poliva / lightum

MacBook automatic light sensor daemon
GNU General Public License v2.0
96 stars 29 forks source link

Doesn't work with MATE #16

Open fhucho opened 12 years ago

fhucho commented 12 years ago

I'm using Arch Linux with MATE desktop environment (Gnome 2 fork). When I launch lightum, it writes this out:

Error org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SettingsDaemon was not provided by any .service files Error org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SettingsDaemon was not provided by any .service files Error org.freedesktop.DBus.Error.ServiceUnknown: The name org.kde.Solid.PowerManagement was not provided by any .service files Can't manage screen backlight on this system. Please disable backlight with config option 'workmode='1' or command line switch '-w 1'. If you believe this is an error, open a bug report: https://github.com/poliva/lightum/issues

poliva commented 12 years ago

Hello,

In file dbus.c, change all the references to "org.gnome.SettingsDaemon" to "org.mate.SettingsDaemon", it should work with this change.

fhucho commented 12 years ago

It prints this:

Error org.freedesktop.DBus.Error.UnknownMethod: Method "GetPercentage" with signature "" on interface "org.mate.SettingsDaemon.Power.Screen" doesn't exist

But there's no need to fix this, I just wanted to try lightum out without plans to use it regularly :)

poliva commented 12 years ago

Looks like mate settings daemon doesn't work the same as gnome settings daemon. Can you change the backlight using the function keys?

fhucho commented 12 years ago

Keyboard backlight doesn't work in MATE, only screen brightness.

BTW, I was recently wondering what is the "right" approach for dealing with function keys and ambient light in Linux. If the desktop environment takes care of that, it leads to code duplication and it won't work with some fullscreen games, virtual terminals, lock screens or login managers.

fhucho commented 12 years ago

In my opinion the best way is a daemon running under root, that does all the work (setting brightness, volume, ...) and only sends a dbus message when hotkey was pressed (so that the desktop environment can show a notification etc.). But this is offtopic, sorry :)

poliva commented 12 years ago

that's what gnome-settings-daemon does, it forks gsd-backlight-helper to change the backlight with root permissions when instructed to do so via dbus. For some reason, mate-settings-daemon doesn't work the same way, but I have never tried mate, so I can't say for sure.

graue commented 11 years ago

I'm also getting this with Xfce on Xubuntu 12.10 beta. Does this need separately written code to deal with every desktop environment? That seems disappointing. The brightness keys on my MBA do work perfectly with Xfce.

mkfs commented 11 years ago

Just want to chime in that I have the same problem on E17. What's the point of putting Linux on a Macbook Air if you can't also run the most advanced WM out there, eh?

I tried to solve this by running bash$ /usr/lib/gnome-settings-daemon/gnome-settings-daemon & ...but just got an error message that "you can only run one xsettings manager at a time".

If this requires a compile-time fix, then that really needs a re-design. Perhaps a config file where you can set the service name (and hope it works?)

Alternatively, command-line options to increment/decrement the brightness and backlight (by a fixed amount, like 10%, or by an amount determined by an argument) would allow users to map their keys to those commands.

poliva commented 11 years ago

I will implement a mode that doesn't use gnome or kde dbus wrappers to set the brightness/backlight, so it will work on every window manager, but then it will have to be run as root. I currently don't have time for this, but is on my todo list.

mkfs commented 11 years ago

Understandable.

It looks like E17 allows you to disable its xsettings daemon -- specifically in order to run the GNOME or KDE one for situations like this. I'll give that a shot.

mkfs commented 11 years ago

Just wanted to follow up that E17 allows you to run GNOME settings (and lightum) at startup, which solves the problem nicely.

XFCE might have a similar option (e.g. disable xfce-settings-helper). Not sure if MATE will allow its settings daemon to be replaced, though.

Kukunin commented 11 years ago

No, this shouldn't be the daemon to work under root. The problems, which lightum solves are user-specific. Don't forget, Linux is multiuser system.

DBus has a perfect communication capabilities to do all work. UPower provides keyboard backlight supporting already. I've asked they about supporting display backlight too, I think, this feature should be done by UPower too.

Project has to be refactored, some abstraction has to be introduced. You can use xbacklight for display backlight controlling. I don't know, maybe there is more cool interface exists, then invoking 'xbacklight' utility