You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Wait before set limit and notify user if delay is specified
7
10
if [[ "$local_delay"!='0' ]];then
8
11
message --verbose "Process '$passed_process_name' with PID $passed_process_pid will be CPU limited after $local_delay second(s) due to unfocus event of window with XID $passed_window_xid."
@@ -35,13 +38,13 @@ background_cpu_limit(){
35
38
if check_pid_existence "$passed_process_pid";then
36
39
# Define message depending by whether delay is specified or not
37
40
if [[ "$local_delay"=='0' ]];then
38
-
message --info "Process '$passed_process_name' with PID $passed_process_pid has been CPU limited to ${config_key_cpu_limit_map["$passed_section"]}% due to unfocus event of window with XID $passed_window_xid."
41
+
message --info "Process '$passed_process_name' with PID $passed_process_pid has been CPU limited to $local_cpu_limit% due to unfocus event of window with XID $passed_window_xid."
39
42
else
40
-
message --info "Process '$passed_process_name' with PID $passed_process_pid has been CPU limited to ${config_key_cpu_limit_map["$passed_section"]}% after $local_delay second(s) due to unfocus event of window with XID $passed_window_xid."
43
+
message --info "Process '$passed_process_name' with PID $passed_process_pid has been CPU limited to $local_cpu_limit% after $local_delay second(s) due to unfocus event of window with XID $passed_window_xid."
41
44
fi
42
45
43
46
# Run in background to make subprocess interruptable
Copy file name to clipboardExpand all lines: src/functions/background_fps_limit.sh
+10-4Lines changed: 10 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -3,21 +3,27 @@ background_fps_limit(){
3
3
# Simplify access to delay specified in config
4
4
local local_delay="${config_key_delay_map["$passed_section"]}"
5
5
6
+
# Simplify access to MangoHud config file
7
+
local local_mangohud_config="${config_key_mangohud_config_map["$passed_section"]}"
8
+
9
+
# Simplify access to FPS limit value
10
+
local local_fps_unfocus="${config_key_fps_unfocus_map["$passed_section"]}"
11
+
6
12
# Wait before set limit and notify user if delay is specified
7
13
if [[ "$local_delay"!='0' ]];then
8
-
message --verbose "MangoHud config file '$(shorten_path "${config_key_mangohud_config_map["$passed_section"]}")' from section '$passed_section' will be FPS limited after $local_delay second(s) due to unfocus event of window with XID $passed_window_xid of process '$passed_process_name' with PID $passed_process_pid."
14
+
message --verbose "MangoHud config file '$(shorten_path "$local_mangohud_config")' from section '$passed_section' will be FPS limited after $local_delay second(s) due to unfocus event of window with XID $passed_window_xid of process '$passed_process_name' with PID $passed_process_pid."
9
15
sleep "$local_delay"
10
16
fi
11
17
12
18
# Check for process existence before set FPS limit
13
19
if check_pid_existence "$passed_process_pid";then
14
20
# Attempt to change 'fps_limit' in specified MangoHud config file
15
-
if mangohud_fps_set "${config_key_mangohud_config_map["$passed_section"]}""${config_key_mangohud_source_config_map["$passed_section"]}""${config_key_fps_unfocus_map["$passed_section"]}";then
21
+
if mangohud_fps_set "$local_mangohud_config""${config_key_mangohud_source_config_map["$passed_section"]}""$local_fps_unfocus";then
16
22
# Define message depending by whether delay is specified or not
17
23
if [[ "$local_delay"=='0' ]];then
18
-
message --info "MangoHud config file '$(shorten_path "${config_key_mangohud_config_map["$passed_section"]}")' from section '$passed_section' has been limited to ${config_key_fps_unfocus_map["$passed_section"]} FPS due to unfocus event of window with XID $passed_window_xid of process '$passed_process_name' with PID $passed_process_pid."
24
+
message --info "MangoHud config file '$(shorten_path "$local_mangohud_config")' from section '$passed_section' has been limited to $local_fps_unfocus FPS due to unfocus event of window with XID $passed_window_xid of process '$passed_process_name' with PID $passed_process_pid."
19
25
else
20
-
message --info "MangoHud config file '$(shorten_path "${config_key_mangohud_config_map["$passed_section"]}")' from section '$passed_section' has been limited to ${config_key_fps_unfocus_map["$passed_section"]} FPS after $local_delay second(s) due to unfocus event of window with XID $passed_window_xid of process '$passed_process_name' with PID $passed_process_pid."
26
+
message --info "MangoHud config file '$(shorten_path "$local_mangohud_config")' from section '$passed_section' has been limited to $local_fps_unfocus FPS after $local_delay second(s) due to unfocus event of window with XID $passed_window_xid of process '$passed_process_name' with PID $passed_process_pid."
0 commit comments