Compare commits

..

10 commits

7 changed files with 60 additions and 5 deletions

9
scripts/powertop/j5040.sh Executable file
View file

@ -0,0 +1,9 @@
#!/usr/bin/env zsh
# author: Daniel Sommer <daniel.sommer@velvettear.de>
# license: MIT
echo '0' > '/proc/sys/kernel/nmi_watchdog';
echo '1500' > '/proc/sys/vm/dirty_writeback_centisecs';
echo 'disabled' > '/sys/bus/usb/devices/2-3/power/wakeup';
echo 'disabled' > '/sys/bus/usb/devices/2-4/power/wakeup';

8
scripts/powertop/n100.sh Executable file
View file

@ -0,0 +1,8 @@
#!/usr/bin/env zsh
# author: Daniel Sommer <daniel.sommer@velvettear.de>
# license: MIT
echo '0' > '/proc/sys/kernel/nmi_watchdog';
echo '1500' > '/proc/sys/vm/dirty_writeback_centisecs';
echo 'auto' > '/sys/bus/usb/devices/3-7.3/power/control';

18
scripts/powertop/powertop.sh Executable file
View file

@ -0,0 +1,18 @@
#!/usr/bin/env zsh
# author: Daniel Sommer <daniel.sommer@velvettear.de>
# license: MIT
# exit on error
set -e
# check permissions
[[ "$EUID" != 0 ]] && printf "error: permission denied!\n" >&2 && exit 1
# check if script exists
script="$(dirname $(realpath "$0"))/$(hostname).sh"
[[ ! -x "$script" ]] && printf "error: script '"$script"' does not exist or is not executable!\n" >&2 && exit 1
# execute script
printf ">> executing script '"$script"'...\n"
. "$script"

View file

@ -42,11 +42,10 @@ printf ""$font_colored"> removing orphaned packages..."$font_default"\n"
printf ""$font_colored"> removing \"no valid subscription\" message..."$font_default"\n"
sed -i.bak "s/data.status.* !== 'ACTIVE'/false/I" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
if [[ "$(which restic &> /dev/null)" ]]; then
printf ""$font_colored"> updating restic..."$font_default"\n"
restic self-update
#printf ""$font_colored"> installing dark theme..."$font_default"\n"
#bash <(curl -s https://raw.githubusercontent.com/Weilbyte/PVEDiscordDark/master/PVEDiscordDark.sh ) install
fi
printf ""$font_colored_bold">> system updated finished after "$SECONDS" seconds!"$font_default"\n"

View file

@ -0,0 +1,9 @@
[Unit]
Description=set cpu governor to %i
[Service]
Type=oneshot
ExecStart=cpupower frequency-set -g %i
[Install]
WantedBy=multi-user.target

9
systemd/powertop.service Normal file
View file

@ -0,0 +1,9 @@
[Unit]
Description=enable various powersaving modes
[Service]
Type=oneshot
ExecStart=/home/velvettear/.dots/scripts/powertop/powertop.sh
[Install]
WantedBy=multi-user.target

View file

@ -3,5 +3,8 @@
# author: Daniel Sommer <daniel.sommer@velvettear.de>
# license: MIT
# share zsh history
setopt SHARE_HISTORY
# exit if user is not root
[[ "$EUID" != "0" ]] && return