Skip to content

Instantly share code, notes, and snippets.

@haxwithaxe
Created September 14, 2025 22:11
Show Gist options
  • Select an option

  • Save haxwithaxe/bd7b15042e9ef0fb091cfa735ea6e311 to your computer and use it in GitHub Desktop.

Select an option

Save haxwithaxe/bd7b15042e9ef0fb091cfa735ea6e311 to your computer and use it in GitHub Desktop.
Set the battery charge mode for Dell XPS 9380 and probaly others
#!/bin/bash
# Requires https://www.dell.com/support/kbdoc/en-us/000178000/dell-command-configure
case $1 in
safe)
sudo cctk --PrimaryBattChargeCfg=Custom:50-80
exit 0
;;
max|full)
sudo cctk --PrimaryBattChargeCfg=Standard
exit 0
;;
*)
cat - <<EOF
Usage: $0 (safe|max|full)
safe Limit charge to 80% and don't charge until 50% is reached.
max|full Leasurely charge to 100% and stay topped off.
EOF
exit 1
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment