mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-22 02:01:55 +07:00
Add Mod+Ctrl+Shift+T to toggle debug tint
This commit is contained in:
@@ -83,6 +83,7 @@ The general system is: if a hotkey switches somewhere, then adding <kbd>Ctrl</kb
|
|||||||
| <kbd>Mod</kbd><kbd>F</kbd> | Maximize column |
|
| <kbd>Mod</kbd><kbd>F</kbd> | Maximize column |
|
||||||
| <kbd>Mod</kbd><kbd>Shift</kbd><kbd>F</kbd> | Toggle full-screen on the focused window |
|
| <kbd>Mod</kbd><kbd>Shift</kbd><kbd>F</kbd> | Toggle full-screen on the focused window |
|
||||||
| <kbd>Mod</kbd><kbd>PrtSc</kbd> | Save a screenshot to `~/Pictures/Screenshots/` |
|
| <kbd>Mod</kbd><kbd>PrtSc</kbd> | Save a screenshot to `~/Pictures/Screenshots/` |
|
||||||
|
| <kbd>Mod</kbd><kbd>Ctrl</kbd><kbd>Shift</kbd><kbd>T</kbd> | Toggle debug tinting of rendered elements |
|
||||||
| <kbd>Mod</kbd><kbd>Shift</kbd><kbd>E</kbd> | Exit niri |
|
| <kbd>Mod</kbd><kbd>Shift</kbd><kbd>E</kbd> | Exit niri |
|
||||||
|
|
||||||
[PaperWM]: https://github.com/paperwm/PaperWM
|
[PaperWM]: https://github.com/paperwm/PaperWM
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ enum Action {
|
|||||||
Quit,
|
Quit,
|
||||||
ChangeVt(i32),
|
ChangeVt(i32),
|
||||||
Suspend,
|
Suspend,
|
||||||
|
ToggleDebugTint,
|
||||||
Spawn(String),
|
Spawn(String),
|
||||||
Screenshot,
|
Screenshot,
|
||||||
CloseWindow,
|
CloseWindow,
|
||||||
@@ -60,6 +61,7 @@ pub enum BackendAction {
|
|||||||
ChangeVt(i32),
|
ChangeVt(i32),
|
||||||
Suspend,
|
Suspend,
|
||||||
Screenshot,
|
Screenshot,
|
||||||
|
ToggleDebugTint,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub enum CompositorMod {
|
pub enum CompositorMod {
|
||||||
@@ -110,6 +112,7 @@ fn action(comp_mod: CompositorMod, keysym: KeysymHandle, mods: ModifiersState) -
|
|||||||
KEY_n => Action::Spawn("nautilus".to_owned()),
|
KEY_n => Action::Spawn("nautilus".to_owned()),
|
||||||
// Alt + PrtSc = SysRq
|
// Alt + PrtSc = SysRq
|
||||||
KEY_Sys_Req | KEY_Print => Action::Screenshot,
|
KEY_Sys_Req | KEY_Print => Action::Screenshot,
|
||||||
|
KEY_T if mods.shift && mods.ctrl => Action::ToggleDebugTint,
|
||||||
KEY_q => Action::CloseWindow,
|
KEY_q => Action::CloseWindow,
|
||||||
KEY_F => Action::ToggleFullscreen,
|
KEY_F => Action::ToggleFullscreen,
|
||||||
KEY_comma => Action::ConsumeIntoColumn,
|
KEY_comma => Action::ConsumeIntoColumn,
|
||||||
@@ -193,6 +196,9 @@ impl Niri {
|
|||||||
Action::Suspend => {
|
Action::Suspend => {
|
||||||
return BackendAction::Suspend;
|
return BackendAction::Suspend;
|
||||||
}
|
}
|
||||||
|
Action::ToggleDebugTint => {
|
||||||
|
return BackendAction::ToggleDebugTint;
|
||||||
|
}
|
||||||
Action::Spawn(command) => {
|
Action::Spawn(command) => {
|
||||||
if let Err(err) = Command::new(command).spawn() {
|
if let Err(err) = Command::new(command).spawn() {
|
||||||
warn!("error spawning alacritty: {err}");
|
warn!("error spawning alacritty: {err}");
|
||||||
|
|||||||
+9
-1
@@ -12,7 +12,7 @@ use smithay::backend::drm::{DrmDevice, DrmDeviceFd, DrmEvent, DrmEventTime};
|
|||||||
use smithay::backend::egl::{EGLContext, EGLDisplay};
|
use smithay::backend::egl::{EGLContext, EGLDisplay};
|
||||||
use smithay::backend::libinput::{LibinputInputBackend, LibinputSessionInterface};
|
use smithay::backend::libinput::{LibinputInputBackend, LibinputSessionInterface};
|
||||||
use smithay::backend::renderer::gles::{GlesRenderer, GlesTexture};
|
use smithay::backend::renderer::gles::{GlesRenderer, GlesTexture};
|
||||||
use smithay::backend::renderer::{Bind, ImportEgl};
|
use smithay::backend::renderer::{Bind, DebugFlags, ImportEgl};
|
||||||
use smithay::backend::session::libseat::LibSeatSession;
|
use smithay::backend::session::libseat::LibSeatSession;
|
||||||
use smithay::backend::session::{Event as SessionEvent, Session};
|
use smithay::backend::session::{Event as SessionEvent, Session};
|
||||||
use smithay::backend::udev::{self, UdevBackend, UdevEvent};
|
use smithay::backend::udev::{self, UdevBackend, UdevEvent};
|
||||||
@@ -192,6 +192,14 @@ impl Tty {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
BackendAction::ToggleDebugTint => {
|
||||||
|
if let Some(device) = tty.output_device.as_mut() {
|
||||||
|
for (_, compositor) in &mut device.surfaces {
|
||||||
|
compositor
|
||||||
|
.set_debug_flags(compositor.debug_flags() ^ DebugFlags::TINT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ use std::time::Duration;
|
|||||||
|
|
||||||
use smithay::backend::renderer::damage::OutputDamageTracker;
|
use smithay::backend::renderer::damage::OutputDamageTracker;
|
||||||
use smithay::backend::renderer::gles::GlesRenderer;
|
use smithay::backend::renderer::gles::GlesRenderer;
|
||||||
|
use smithay::backend::renderer::{DebugFlags, Renderer};
|
||||||
use smithay::backend::winit::{self, WinitError, WinitEvent, WinitEventLoop, WinitGraphicsBackend};
|
use smithay::backend::winit::{self, WinitError, WinitEvent, WinitEventLoop, WinitGraphicsBackend};
|
||||||
use smithay::output::{Mode, Output, PhysicalProperties, Subpixel};
|
use smithay::output::{Mode, Output, PhysicalProperties, Subpixel};
|
||||||
use smithay::reexports::calloop::timer::{TimeoutAction, Timer};
|
use smithay::reexports::calloop::timer::{TimeoutAction, Timer};
|
||||||
@@ -158,6 +159,9 @@ impl Winit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
BackendAction::ToggleDebugTint => {
|
||||||
|
renderer.set_debug_flags(renderer.debug_flags() ^ DebugFlags::TINT);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
WinitEvent::Focus(_) => (),
|
WinitEvent::Focus(_) => (),
|
||||||
|
|||||||
Reference in New Issue
Block a user