Skip to content

Commit b0ab3ed

Browse files
committed
fix: add power-profiles-daemon cleanup and HOME writable check
1 parent 248b3a9 commit b0ab3ed

2 files changed

Lines changed: 32 additions & 0 deletions

File tree

uninstall.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,32 @@ cleanup_switcheroo() {
387387
fi
388388
}
389389

390+
# Disable power-profiles-daemon (if enabled by draphyOS for TLP conflict resolution)
391+
cleanup_power_profiles() {
392+
# Only offer to disable if it was potentially enabled by draphyOS
393+
# (when TLP was disabled in favor of power-profiles-daemon)
394+
if systemctl is-enabled power-profiles-daemon &>/dev/null 2>&1; then
395+
# Check if TLP is installed but masked (indicates draphyOS made the choice)
396+
if rpm -q tlp &>/dev/null && systemctl is-enabled tlp &>/dev/null 2>&1; then
397+
# TLP is enabled, power-profiles-daemon shouldn't be - skip
398+
return
399+
fi
400+
401+
echo ""
402+
echo -e "power-profiles-daemon is ${YELLOW}enabled${NC}."
403+
echo -e "Do you want to disable it? (y/n)"
404+
echo -e "${YELLOW}(Only disable if you plan to use TLP or another power manager)${NC}"
405+
read -r response </dev/tty || response="n"
406+
407+
if [[ "$response" =~ ^[Yy](es)?$ ]]; then
408+
print_step "Disabling power-profiles-daemon..."
409+
sudo systemctl disable power-profiles-daemon 2>/dev/null || true
410+
sudo systemctl stop power-profiles-daemon 2>/dev/null || true
411+
print_success "power-profiles-daemon disabled"
412+
fi
413+
fi
414+
}
415+
390416
# Revert gsettings (dark mode preferences)
391417
revert_gsettings() {
392418
if command -v gsettings &>/dev/null; then
@@ -1044,6 +1070,7 @@ main() {
10441070
cleanup_postgresql
10451071
cleanup_cgroup_delegation
10461072
cleanup_switcheroo
1073+
cleanup_power_profiles
10471074
cleanup_nvidia
10481075
remove_battery_limit
10491076
remove_lightdm

update.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ if [ -z "${HOME:-}" ] || [ ! -d "$HOME" ]; then
2121
exit 1
2222
fi
2323

24+
if [ ! -w "$HOME" ]; then
25+
echo "ERROR: HOME directory is not writable"
26+
exit 1
27+
fi
28+
2429
# draphyOS paths
2530
INSTALL_DIR="$HOME/.draphyOS"
2631
MARKER_FILE="$HOME/.draphyOS-installed"

0 commit comments

Comments
 (0)