This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| dbus-monitor --system "type='signal',path='/org/freedesktop/UPower/devices/battery_BAT0',member='PropertiesChanged'" | while read LINE; do | |
| echo ${LINE} | grep battery_BAT0 | grep -q PropertiesChanged | |
| if [ $? -eq 0 ]; then | |
| BATT_STAT=$(dbus-send --print-reply=literal --system --dest=org.freedesktop.UPower /org/freedesktop/UPower/devices/battery_BAT0 org.freedesktop.DBus.Properties.Get string:org.freedesktop.UPower.Device string:State | awk '{ print $3; }') | |
| if [ $BATT_STAT -eq 1 ] || [ $BATT_STAT -eq 4 ]; then | |
| LEVEL=$(tuned-adm list | grep -q throughput-performance && echo "throughput-performance" || echo "balanced") | |
| elif [ $BATT_STAT -eq 5 ]; then | |
| LEVEL="balanced" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # The general procedure here is adapted from the 7->8 guide here. https://www.tecmint.com/upgrade-centos-7-to-centos-8/ | |
| # | |
| # It is a curated list of my bash history. I entered other commands so hopefully I got the right ones here. | |
| yum upgrade | |
| reboot | |
| dnf install epel-release | |
| dnf install rpmconf | |
| dnf install yum-utils | |
| rpmconf -a # answer "n" to both things |