You are not logged in.
Pages: 1
Hi,
i wrote a little script /etc/powersave, which runs two other scripts to control my display backlight and so on, depending on the state of the power supply:
#!/bin/bash
case `cat /sys/class/power_supply/AC0/online` in
0)
/etc/powersave_offline;;
1)
/etc/powersave_online;;
esacIf i run the script manually everything works fine. To run the script at boot i created a systemd service file /etc/systemd/system/powersave.service:
[Unit]
Description=Powersave
After=gdm.service
[Service]
Type=oneshot
ExecStart=/etc/powersave
RemainAfterExit=yes
[Install]
WantedBy=multi-user.targetThis works as expected, but when i log in to gnome, it changes the backlight again. Is there a way to run this script after logging in?
Last edited by johannesg00 (2013-11-10 14:10:45)
Offline
Put "sleep 15" at top of script?
Philosophy is looking for a black cat in a dark room. Metaphysics is looking for a black cat in a dark room that isn't there. Religion is looking for a black cat in a dark room that isn't there and shouting "I found it!". Science is looking for a black cat in a dark room with a flashlight.
Offline
hey ![]()
i think this would work, but when i turn of the laptop and forget to log in the next 15 seconds, the script would be executed to early.
Is there a nicer solution for this?
Offline
I think that gnome is just funky in how it handles configurations. So it may actually be gconf that is deciding that it is going to set a whole different backlight level. You might want to look into having that set too along with the rest of the stuffs. But this might actually fail if there is no gconf running when the script is executed.
Offline
just put the script in /etc/gdm/PostLogin/ ... then it is fired up after you log in
Last edited by dreadkopp (2013-11-16 14:40:37)
Offline
Pages: 1