Open WolfpackN64 opened 4 years ago
I suppose that many users of Powertop wish for exactly these features:
Right now I am using sysctl and change the usb device to bad manually on startup:
[Unit]
Description=Powertop tunings
[Service]
Type=exec
ExecStart=/usr/sbin/powertop --auto-tune
RemainAfterExit=true
[Install]
WantedBy=multi-user.target
The following works well for me as a workaround:
[Unit]
Description=Override tunables
After=powertop.service
[Service]
Type=oneshot
ExecStart=/usr/bin/bash -c 'echo on > /sys/bus/usb/devices/3-2.3/power/control'
ExecStart=/usr/bin/bash -c 'echo on > /sys/bus/usb/devices/3-2.4/power/control'
[Install]
WantedBy=multi-user.target
Several things to be noted here which weren't obvious to me as a not-so-experienced systemd user :)
ExecStart
only work with type oneshot
ExecStart
doesn't use a shell, i.e. you can directly redirect from there to the file, need to invoke bash
for that.powertop
service doesn't have RemainAfterExit=true
. I haven't tried if it makes a difference but from the documentation, I assume dependent services (like the one I posted above) might not run because the service never stops from systemd's perspective?hey @fenrus75 Is there a plan on implementing this without workarounds?
I run Powertop with autotune on my Thinkpad T440, running Fedora 31 XFCE. As I basically want all turntables to be set on "Good". However, my USB mouse connected to my laptop freezes sporadically when it's turntable is set to "Good", so the USB autosuspend for my USB mouse is the is the only turntable I turn to "Bad". However, the turntable changes don't survive reboot, and no forum or post anywhere has a good, universal solution to this problem.
It would be far easier for end-users if Powertop could permanently write the turntable chances to the system so that your turntables survive rebooting, and it would make enabling and disabling the turntables for all kind of settings much easier.
Making complicated custom scripts for each mouse I'm going to use on my laptop, which might not work on different distros really is a bit much.