Compare commits
No commits in common. "54458dafc4d7d5cc91f4ca178e5f73de25f7af3c" and "c193d574e390712db262171353b830fd091f59a1" have entirely different histories.
54458dafc4
...
c193d574e3
|
@ -1,10 +0,0 @@
|
||||||
[Unit]
|
|
||||||
Description=Tweak CPU usage
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=simple
|
|
||||||
ExecStart=%h/.local/bin/tweak-cpu-usage
|
|
||||||
Restart=on-failure
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=default.target
|
|
|
@ -25,7 +25,7 @@ if is_readable_file "$pkgbuild_path" &&
|
||||||
[ $(git status --porcelain --no-renames PKGBUILD | wc -l) -lt 1 ]; then
|
[ $(git status --porcelain --no-renames PKGBUILD | wc -l) -lt 1 ]; then
|
||||||
# ! is_readable_file "$pkgbuild_copy_path";then
|
# ! is_readable_file "$pkgbuild_copy_path";then
|
||||||
|
|
||||||
#eval $(grep -Pazo '[^[:print:]][[:blank:]]*_?(pkg.*|name)=(\((.|\n)*?\)|[^#]*?(?= +#|\x0a))' ./PKGBUILD | grep -Eva '\$\(|`|pkgdesc')
|
#eval $(grep -Pazo '[^[:print:]][[:blank:]]*_?(pkg.*|name)=(\((.|\n)*?\)|[^#]*?(?= *#|\x0a))' ./PKGBUILD | grep -Eva '\$\(|`|pkgdesc')
|
||||||
|
|
||||||
#if [[ -n "${pkgname:-''}" ]];then
|
#if [[ -n "${pkgname:-''}" ]];then
|
||||||
# global_conf_path="${GLOBAL_CONF_DIR_PATH}/${pkgname}"
|
# global_conf_path="${GLOBAL_CONF_DIR_PATH}/${pkgname}"
|
||||||
|
|
|
@ -1,36 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
set -e
|
|
||||||
set -u
|
|
||||||
|
|
||||||
cores=$(nproc)
|
|
||||||
|
|
||||||
limits=(
|
|
||||||
# process_name:limit%
|
|
||||||
firefox:$(( 50 * cores ))
|
|
||||||
vesktop:$(( 20 * cores ))
|
|
||||||
)
|
|
||||||
|
|
||||||
# check for cpulimit command
|
|
||||||
if ! command -v cpulimit 2>/dev/null >/dev/null; then
|
|
||||||
echo "ERROR: need cpulimit command" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
limit_process() {
|
|
||||||
local process_name="$1"
|
|
||||||
local limit_percentage="${2%%.}"
|
|
||||||
|
|
||||||
cpulimit -i -e "$process_name" -l "$limit_percentage"
|
|
||||||
}
|
|
||||||
|
|
||||||
limit_processes() {
|
|
||||||
local pids
|
|
||||||
pids=()
|
|
||||||
for limit in "${limits[@]}"; do
|
|
||||||
IFS=: read process_name limit_percentage <<<"$limit"
|
|
||||||
limit_process "$process_name" "$limit_percentage" & pids+=($!)
|
|
||||||
done
|
|
||||||
wait "${pids[@]}"
|
|
||||||
}
|
|
||||||
|
|
||||||
limit_processes
|
|
|
@ -61,9 +61,3 @@ install_files "/etc" etc
|
||||||
if command -v fc-cache >/dev/null 2>&1; then
|
if command -v fc-cache >/dev/null 2>&1; then
|
||||||
fc-cache -f
|
fc-cache -f
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if command -v systemctl >/dev/null 2>&1; then
|
|
||||||
systemctl --user daemon-reload
|
|
||||||
systemctl --user enable tweak-cpu-usage
|
|
||||||
systemctl --user restart tweak-cpu-usage
|
|
||||||
fi
|
|
||||||
|
|
Loading…
Reference in New Issue