Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
P
phosh
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Guido Gunther
phosh
Commits
0a3e7a8c
Commit
0a3e7a8c
authored
Feb 18, 2018
by
Guido Gunther
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add mutter-mock dbus mock
Just enough to make gsd-power start up
parent
a26535f3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
94 additions
and
6 deletions
+94
-6
README.md
README.md
+3
-6
helpers/mutter-dbus-stub-mock.py
helpers/mutter-dbus-stub-mock.py
+71
-0
helpers/set_brightness
helpers/set_brightness
+11
-0
run.in
run.in
+9
-0
No files found.
README.md
View file @
0a3e7a8c
...
...
@@ -26,9 +26,6 @@ using:
_build/run
If you want to test interaction with gnome-settings-daemon e.g. for brightness
start a session like:
gnome-session --session=gnome-dummy --disable-acceleration-check &
before running phosh.
This will make sure the gsettings schema is found, there's enough of a GNOME
session running an the some of the mutter DBus API is stubbed so
gnome-settings-manager can work.
helpers/mutter-dbus-stub-mock.py
0 → 100755
View file @
0a3e7a8c
#!/usr/bin/env python2
import
dbus
import
dbus.service
import
dbus.mainloop.glib
import
gobject
class
Service
(
dbus
.
service
.
Object
):
connector
=
'HDMI-1'
resources
=
(
1
,
# serial
[
# crtc
[
0
,
# serial
0
,
# winsys_id
0
,
0
,
768
,
1024
,
# x, y, width, height
0
,
# current mode
0
,
# current transform (according to wayland proto
[
0
],
# all possible transforms
{},
],
],
[
# outputs
[
0
,
# serial
0
,
# winsys_id
0
,
# current_crtc
[
0
],
# possible_crtcs
connector
,
# connector
[
1
],
# valid modes
[
1
],
# valid clones
{
'vendor'
:
'puri.sm'
},
# properties
],
],
[
# modes
[
0
,
# serial
0
,
# XID
768
,
1024
,
# width, height
60
,
# frequency
0
,
# flags
],
],
768
,
# max_width
10240
,
# max_height
)
def
run
(
self
):
dbus
.
mainloop
.
glib
.
DBusGMainLoop
(
set_as_default
=
True
)
bus_name
=
dbus
.
service
.
BusName
(
"org.gnome.Mutter.DisplayConfig"
,
dbus
.
SessionBus
())
dbus
.
service
.
Object
.
__init__
(
self
,
bus_name
,
"/org/gnome/Mutter/DisplayConfig"
)
self
.
_loop
=
gobject
.
MainLoop
()
print
(
"Mocking mutter DisplayConfig DBus API"
)
self
.
_loop
.
run
()
@
dbus
.
service
.
method
(
"org.gnome.Mutter.DisplayConfig"
,
in_signature
=
''
,
out_signature
=
'ua(uxiiiiiuaua{sv})a(uxiausauaua{sv})a(uxuudu)ii'
)
def
GetResources
(
self
):
print
(
"GetResouces called"
)
return
self
.
resources
@
dbus
.
service
.
method
(
"org.freedesktop.DBus.Properties"
,
in_signature
=
'ssv'
,
out_signature
=
''
)
def
Set
(
self
,
s1
,
s2
,
v
):
print
(
"Set called with %s %s"
%
(
s1
,
s2
))
return
if
__name__
==
"__main__"
:
Service
(
"This is the service"
).
run
()
helpers/set_brightness
0 → 100755
View file @
0a3e7a8c
#!/bin/bash
B
=
${
1
:-
100
}
dbus-send
--session
--type
=
method_call
\
--dest
=
"org.gnome.SettingsDaemon.Power"
\
/org/gnome/SettingsDaemon/Power
\
org.freedesktop.DBus.Properties.Set
\
string:
"org.gnome.SettingsDaemon.Power.Screen"
\
string:
"Brightness"
\
variant:int32:
${
B
}
run.in
View file @
0a3e7a8c
#!/bin/sh
set
-e
ABS_BUILDDIR
=
'@ABS_BUILDDIR@'
# Start up gsd, etc.
if
!
dbus-send
--session
--dest
=
org.freedesktop.DBus
\
--type
=
method_call
--print-reply
/org/freedesktop/DBus
\
org.freedesktop.DBus.ListNames
\
|
grep
-qs
'[o]rg\.gnome.Mutter\.DisplayConfig'
;
then
helpers/mutter-dbus-stub-mock.py &
fi
gnome-session
--session
=
gnome-dummy
--disable-acceleration-check
&
export
GSETTINGS_SCHEMA_DIR
=
"
${
ABS_BUILDDIR
}
/data"
...
...
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