Skip to content

Commit

Permalink
πŸ‘· pages: add debug window button for kwin-wayland
Browse files Browse the repository at this point in the history
  • Loading branch information
vnepogodin committed Mar 7, 2024
1 parent c7953dc commit ec540ec
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions i18n/en/cachyos_hello.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ remove-orphans-title = Remove orphans
clear-pkgcache-title = Clear package cache
rankmirrors-title = Rank mirrors
dnsserver-title = Change DNS server
show-kwinw-debug-title = Show kwin(Wayland) debug window
# Main Page (buttons)
button-about-tooltip = About
Expand Down
1 change: 1 addition & 0 deletions i18n/ru/cachyos_hello.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ remove-orphans-title = Π£Π΄Π°Π»ΠΈΡ‚ΡŒ orphans
clear-pkgcache-title = ΠžΡ‡ΠΈΡΡ‚ΠΈΡ‚ΡŒ кэш ΠΏΠ°ΠΊΠ΅Ρ‚ΠΎΠ²
rankmirrors-title = Π Π°Π½ΠΆΠΈΡ€ΠΎΠ²Π°Ρ‚ΡŒ Π·Π΅Ρ€ΠΊΠ°Π»Π°
dnsserver-title = Π‘ΠΌΠ΅Π½ΠΈΡ‚ΡŒ DNS-сСрвСр
show-kwinw-debug-title = ΠŸΠΎΠΊΠ°Π·Π°Ρ‚ΡŒ ΠΎΠΊΠ½ΠΎ ΠΎΡ‚Π»Π°Π΄ΠΊΠΈ kwin(Wayland)
# Main Page (buttons)
button-about-tooltip = О ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ΅
Expand Down
17 changes: 17 additions & 0 deletions src/pages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,23 @@ fn create_fixes_section(builder: &Builder) -> gtk::Box {
topbox.pack_end(&button_box_s, true, true, 5);
topbox.pack_end(&button_box_f, true, true, 5);

if let Ok(pgrep_res) = Exec::cmd("pgrep").args(&["kwin_wayland"]).stdout(subprocess::NullFile).join() {
if pgrep_res.success() {
let kwinw_debug_btn = gtk::Button::with_label(&fl!("show-kwinw-debug-title"));
kwinw_debug_btn.set_widget_name("show-kwinw-debug-title");
kwinw_debug_btn.connect_clicked(move |_| {
// Spawn child process in separate thread.
std::thread::spawn(move || {
let _ = Exec::cmd("qdbus")
.args(&["org.kde.KWin", "/KWin", "org.kde.KWin.showDebugConsole"])
.join()
.unwrap();
});
});
button_box_frth.pack_end(&kwinw_debug_btn, true, true, 2);
}
}

topbox.set_hexpand(true);
topbox
}
Expand Down

0 comments on commit ec540ec

Please sign in to comment.