File tree Expand file tree Collapse file tree 3 files changed +26
-5
lines changed
Expand file tree Collapse file tree 3 files changed +26
-5
lines changed Original file line number Diff line number Diff line change 1+ use anyhow:: { Context , Result } ;
2+ use tokio:: runtime:: Runtime ;
3+ use zbus:: Connection ;
4+
5+ #[ zbus:: proxy( interface = "org.kde.KWin" , default_service = "org.kde.KWin" , default_path = "/KWin" ) ]
6+ pub trait KWin {
7+ /// showDebugConsole method
8+ #[ zbus( name = "showDebugConsole" ) ]
9+ fn show_debug_console ( & self ) -> zbus:: Result < ( ) > ;
10+ }
11+
12+ pub fn launch_kwin_debug_window ( ) -> Result < ( ) > {
13+ let rt = Runtime :: new ( ) . context ( "Failed to initialize tokio runtime" ) ?;
14+ rt. block_on ( async move {
15+ let connection = Connection :: session ( ) . await ?;
16+ let kwin_client = KWinProxy :: new ( & connection) . await ?;
17+ kwin_client. show_debug_console ( ) . await ?;
18+
19+ anyhow:: Ok ( ( ) )
20+ } )
21+ }
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ mod config;
77mod embed_data;
88mod gresource;
99mod installer;
10+ mod kwin_dbus;
1011mod localization;
1112mod logger;
1213mod pages;
Original file line number Diff line number Diff line change 11use crate :: application_browser:: ApplicationBrowser ;
22use crate :: systemd_units:: SystemdUnits ;
33use crate :: utils:: PacmanWrapper ;
4- use crate :: { fl, systemd_units, utils} ;
4+ use crate :: { fl, kwin_dbus , systemd_units, utils} ;
55
66use std:: boxed:: Box ;
77use std:: fmt:: Write ;
@@ -262,10 +262,9 @@ fn get_nm_connections() -> Vec<String> {
262262}
263263
264264fn launch_kwin_debug_window ( ) {
265- let _ = Exec :: cmd ( "qdbus6" )
266- . args ( & [ "org.kde.KWin" , "/KWin" , "org.kde.KWin.showDebugConsole" ] )
267- . join ( )
268- . unwrap ( ) ;
265+ if let Err ( kwin_err) = kwin_dbus:: launch_kwin_debug_window ( ) {
266+ error ! ( "Failed to launch kwin debug window: {kwin_err}" ) ;
267+ }
269268}
270269
271270fn create_fixes_section ( builder : & Builder ) -> gtk:: Box {
You can’t perform that action at this time.
0 commit comments