Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PortWINE
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mikhail Tergoev
PortWINE
Commits
1bcdee04
Commit
1bcdee04
authored
Mar 26, 2026
by
Mikhail Tergoev
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'power-dbus' of github.com:Boria138/PortWINE into Boria138-power-dbus
parents
ee303f46
7b956c3a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
22 deletions
+50
-22
functions_helper
data_from_portwine/scripts/functions_helper
+50
-22
No files found.
data_from_portwine/scripts/functions_helper
View file @
1bcdee04
...
@@ -2096,8 +2096,8 @@ stop_portwine () {
...
@@ -2096,8 +2096,8 @@ stop_portwine () {
pw_auto_create_shortcut
pw_auto_create_shortcut
stop_activity_simulation
stop_activity_simulation
add_in_stop_portwine
add_in_stop_portwine
if [[ -n "
$PW_
TUNED
_PROFILE
" ]] ; then
if [[ -n "
$PW_
POWERPROFILECTL_PROFILE
" ]] && [[ "
$(
pw_ppd_dbus_get_profile
)
" != "
$PW_POWERPROFILECTL
_PROFILE
" ]] ; then
tuned-adm profile
$PW_TUNED_PROFILE
pw_ppd_dbus_set_profile "
$PW_POWERPROFILECTL_PROFILE
"
fi
fi
if [[
$PW_LOG
!= 1 ]] && [[ -n
$START_PW_TIME_IN_GAME
]] ; then
if [[
$PW_LOG
!= 1 ]] && [[ -n
$START_PW_TIME_IN_GAME
]] ; then
...
@@ -3807,6 +3807,48 @@ start_portwine () {
...
@@ -3807,6 +3807,48 @@ start_portwine () {
unset
__GLX_VENDOR_LIBRARY_NAME
unset
__GLX_VENDOR_LIBRARY_NAME
fi
fi
pw_ppd_dbus_get_profile
()
{
if
!
command
-v
gdbus &>/dev/null
;
then
return
1
fi
local
result
result
=
$(
gdbus call
--system
\
--dest
net.hadess.PowerProfiles
\
--object-path
/net/hadess/PowerProfiles
\
--method
org.freedesktop.DBus.Properties.Get
\
'net.hadess.PowerProfiles'
'ActiveProfile'
2>/dev/null
)
[[
-n
"
$result
"
]]
&&
echo
"
$result
"
|
sed
"s/.*'
\(
[^']*
\)
'.*/
\1
/"
||
return
1
}
export
-f
pw_ppd_dbus_get_profile
pw_ppd_dbus_set_profile
()
{
local
profile
=
"
$1
"
if
!
command
-v
gdbus &>/dev/null
;
then
return
1
fi
gdbus call
--system
\
--dest
net.hadess.PowerProfiles
\
--object-path
/net/hadess/PowerProfiles
\
--method
org.freedesktop.DBus.Properties.Set
\
'net.hadess.PowerProfiles'
'ActiveProfile'
"<'
$profile
'>"
&>/dev/null
}
export
-f
pw_ppd_dbus_set_profile
pw_ppd_dbus_has_profile
()
{
local
profile
=
"
$1
"
if
!
command
-v
gdbus &>/dev/null
;
then
return
1
fi
local
result
result
=
$(
gdbus call
--system
\
--dest
net.hadess.PowerProfiles
\
--object-path
/net/hadess/PowerProfiles
\
--method
org.freedesktop.DBus.Properties.GetAll
\
'net.hadess.PowerProfiles'
2>/dev/null
)
[[
"
$result
"
==
*
"'
$profile
'"
*
]]
}
export
-f
pw_ppd_dbus_has_profile
if
check_gamescope_session
;
then
if
check_gamescope_session
;
then
export
PW_GAMEMODERUN_SLR
=
""
export
PW_GAMEMODERUN_SLR
=
""
elif
[[
"
$PW_USE_GAMEMODE
"
=
"1"
]]
\
elif
[[
"
$PW_USE_GAMEMODE
"
=
"1"
]]
\
...
@@ -3821,22 +3863,12 @@ start_portwine () {
...
@@ -3821,22 +3863,12 @@ start_portwine () {
then
then
export
GAMEMODERUN
=
0
export
GAMEMODERUN
=
0
export
PW_GAMEMODERUN_SLR
=
""
export
PW_GAMEMODERUN_SLR
=
""
if
command
-v
powerprofilesctl &>/dev/null
;
then
if
pw_ppd_dbus_has_profile
"performance"
&&
[[
"
$(
pw_ppd_dbus_get_profile
)
"
!=
"performance"
]]
;
then
if
powerprofilesctl list |
grep
-q
'performance:'
;
then
export
PW_POWERPROFILECTL_PROFILE
=
$(
pw_ppd_dbus_get_profile
)
export
PW_POWERPROFILECTL_SLR
=
"powerprofilesctl launch -p performance --"
pw_ppd_dbus_set_profile performance
print_info
"Gamemode replaced by powerprofilectl to avoid conflicts"
print_info
"Gamemode replaced by power-profiles-daemon/tuned-ppd/tlp-pd via D-Bus to avoid conflicts"
else
else
export
PW_POWERPROFILECTL_SLR
=
""
export
PW_POWERPROFILECTL_PROFILE
=
""
fi
elif
command
-v
tuned-adm &>/dev/null
;
then
export
PW_TUNED_PROFILE
=
$(
tuned-adm active |
awk
-F
': '
'{print $2}'
)
if
tuned-adm list |
grep
-q
'throughput-performance'
;
then
tuned-adm profile throughput-performance
print_info
"Gamemode replaced by tuned to avoid conflict with ananicy and sched-ext."
export
PW_POWERPROFILECTL_SLR
=
""
else
export
PW_POWERPROFILECTL_SLR
=
""
fi
fi
fi
elif
check_flatpak
;
then
elif
check_flatpak
;
then
export
GAMEMODERUN
=
1
export
GAMEMODERUN
=
1
...
@@ -4726,7 +4758,6 @@ pw_run () {
...
@@ -4726,7 +4758,6 @@ pw_run () {
echo
""
echo
""
print_info
"Log from RUNTIME and WINE:"
print_info
"Log from RUNTIME and WINE:"
${
PW_RUN_GAMESCOPE
}
\
${
PW_RUN_GAMESCOPE
}
\
${
PW_POWERPROFILECTL_SLR
}
\
${
PW_INHIBIT_SLR
}
\
${
PW_INHIBIT_SLR
}
\
${
PW_TASKSET_SLR
}
\
${
PW_TASKSET_SLR
}
\
${
pw_runtime
}
\
${
pw_runtime
}
\
...
@@ -4746,7 +4777,6 @@ pw_run () {
...
@@ -4746,7 +4777,6 @@ pw_run () {
echo
""
echo
""
echo
"Log WINE:"
>
"
${
PW_LOG_TO_FILE
}
"
echo
"Log WINE:"
>
"
${
PW_LOG_TO_FILE
}
"
${
PW_RUN_GAMESCOPE
}
\
${
PW_RUN_GAMESCOPE
}
\
${
PW_POWERPROFILECTL_SLR
}
\
${
PW_INHIBIT_SLR
}
\
${
PW_INHIBIT_SLR
}
\
${
PW_TASKSET_SLR
}
\
${
PW_TASKSET_SLR
}
\
${
pw_runtime
}
\
${
pw_runtime
}
\
...
@@ -4782,7 +4812,6 @@ pw_run () {
...
@@ -4782,7 +4812,6 @@ pw_run () {
VK_INSTANCE_LAYERS
=
"
${
PW_VK_INSTANCE_LAYERS
}
"
\
VK_INSTANCE_LAYERS
=
"
${
PW_VK_INSTANCE_LAYERS
}
"
\
${
PW_RUN_GAMESCOPE
}
\
${
PW_RUN_GAMESCOPE
}
\
${
PW_GAMEMODERUN_SLR
}
\
${
PW_GAMEMODERUN_SLR
}
\
${
PW_POWERPROFILECTL_SLR
}
\
${
PW_ADD_VAR_SLR
}
\
${
PW_ADD_VAR_SLR
}
\
${
PW_INHIBIT_SLR
}
\
${
PW_INHIBIT_SLR
}
\
${
PW_TASKSET_SLR
}
\
${
PW_TASKSET_SLR
}
\
...
@@ -4802,7 +4831,6 @@ pw_run () {
...
@@ -4802,7 +4831,6 @@ pw_run () {
VK_INSTANCE_LAYERS
=
"
${
PW_VK_INSTANCE_LAYERS
}
"
\
VK_INSTANCE_LAYERS
=
"
${
PW_VK_INSTANCE_LAYERS
}
"
\
${
PW_RUN_GAMESCOPE
}
\
${
PW_RUN_GAMESCOPE
}
\
${
PW_GAMEMODERUN_SLR
}
\
${
PW_GAMEMODERUN_SLR
}
\
${
PW_POWERPROFILECTL_SLR
}
\
${
PW_ADD_VAR_SLR
}
\
${
PW_ADD_VAR_SLR
}
\
${
PW_INHIBIT_SLR
}
\
${
PW_INHIBIT_SLR
}
\
${
PW_TASKSET_SLR
}
\
${
PW_TASKSET_SLR
}
\
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment