You are not logged in.

#1 2022-11-09 18:41:22

bottomG
Member
From: Katowice, Poland
Registered: 2022-10-16
Posts: 8

How to spindown a hard drive from KDE Plasma

I already tried this systemd service but the drive spins up again exactly when SDDM appears on the screen. I either want to make it don't do that or make a working login script in KDE that will serve this functionality. I managed to create a script:

#!/bin/bash
hdparm -y -S 30 /dev/sda

Added it to System Settings > Startup and Shutdown > Autostart > Add > Add Login Script but it doesn't work, no clue why. I also tried adding sudo to the script with no luck. When I run this command with sudo in the terminal it executes just fine.

Last edited by bottomG (2022-11-09 18:46:21)

Offline

#2 2022-11-10 01:15:30

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,168

Re: How to spindown a hard drive from KDE Plasma

sudo won't work in a login script because it can't query you for your password. If you need root privileges to run something, you need your script to run as root in the first place.

Edit: Which service on that page did you try? What does sytemctl say about it? (e.g. systemctl status <name of service>)

Last edited by cfr (2022-11-10 01:18:07)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

Board footer

Powered by FluxBB