presentation: Split out

This commit is contained in:
Geoffrey Frogeye 2024-01-15 18:54:19 +01:00
parent c1d8bc65af
commit 1b008c1ae8
Signed by: geoffrey
GPG key ID: C72403E7F82E6AD8
3 changed files with 71 additions and 57 deletions

View file

@ -11,6 +11,7 @@ in
./i3.nix ./i3.nix
./lock ./lock
./mpd ./mpd
./presentation
./qutebrowser.nix ./qutebrowser.nix
./screenshots ./screenshots
]; ];

View file

@ -161,9 +161,6 @@ in
hideEdgeBorders = "both"; hideEdgeBorders = "both";
titlebar = false; # So that single-container screens are basically almost fullscreen titlebar = false; # So that single-container screens are basically almost fullscreen
commands = [ commands = [
# Open specific applications in floating mode
{ criteria = { title = "^pdfpc.*"; window_role = "presenter"; }; command = "move to output left, fullscreen"; }
{ criteria = { title = "^pdfpc.*"; window_role = "presentation"; }; command = "move to output right, fullscreen"; }
# switch to workspace with urgent window automatically # switch to workspace with urgent window automatically
{ criteria = { urgent = "latest"; }; command = "focus"; } { criteria = { urgent = "latest"; }; command = "focus"; }
]; ];
@ -196,12 +193,7 @@ in
in in
forEachWorkspace ({ w, workspace }: { output = builtins.elemAt x11_screens (lib.mod w (builtins.length x11_screens)); workspace = workspace.name; }); forEachWorkspace ({ w, workspace }: { output = builtins.elemAt x11_screens (lib.mod w (builtins.length x11_screens)); workspace = workspace.name; });
}; };
frogeye.desktop.i3.bindmodes = frogeye.desktop.i3.bindmodes = {
let
mode_pres_main = "Presentation (main display)";
mode_pres_sec = "Presentation (secondary display)";
in
{
"Resize" = { "Resize" = {
bindings = { bindings = {
"h" = "resize shrink width 10 px or 10 ppt; ${focus}"; "h" = "resize shrink width 10 px or 10 ppt; ${focus}";
@ -222,24 +214,6 @@ in
}; };
mod_enter = "Escape"; mod_enter = "Escape";
}; };
"${mode_pres_main}" = {
mod_enter = "Shift+p";
bindings = {
"b" = "workspace 3, workspace 4, mode ${mode_pres_sec}";
"q" = "mode default";
"Return" = "mode default";
};
return_bindings = false;
};
"${mode_pres_sec}" = {
mod_enter = "Shift+p+2"; # Bogus, just so I don't have to implement no binding
bindings = {
"b" = "workspace 1, workspace 2, mode ${mode_pres_main}";
"q" = "mode default";
"Return" = "mode default";
};
return_bindings = false;
};
"Temperature [R] Red [D] Dust storm [C] Campfire [O] Normal [A] All nighter [B] Blue" = { "Temperature [R] Red [D] Dust storm [C] Campfire [O] Normal [A] All nighter [B] Blue" = {
bindings = { bindings = {
"r" = "exec ${pkgs.sct}/bin/sct 1000"; "r" = "exec ${pkgs.sct}/bin/sct 1000";

View file

@ -0,0 +1,39 @@
# Dual-screen presenting for slideshows and stuff.
# Not tested since Nix.
# Config mentions pdfpc, although the last thing I used was Impressive, even made patches to it.
# UPST Add Impressive to nixpkgs
{ pkgs, lib, config, ... }:
let
mode_pres_main = "Presentation (main display)";
mode_pres_sec = "Presentation (secondary display)";
in
{
config = lib.mkIf config.frogeye.desktop.xorg {
frogeye.desktop.i3.bindmodes = {
"${mode_pres_main}" = {
mod_enter = "Shift+p";
bindings = {
"b" = "workspace 3, workspace 4, mode ${mode_pres_sec}";
"q" = "mode default";
"Return" = "mode default";
};
return_bindings = false;
};
"${mode_pres_sec}" = {
mod_enter = "Shift+p+2"; # Bogus, just so I don't have to implement no binding
bindings = {
"b" = "workspace 1, workspace 2, mode ${mode_pres_main}";
"q" = "mode default";
"Return" = "mode default";
};
return_bindings = false;
};
};
xsession.windowManager.i3.config.window.commands = [
# Open specific applications in floating mode
{ criteria = { title = "^pdfpc.*"; window_role = "presenter"; }; command = "move to output left, fullscreen"; }
{ criteria = { title = "^pdfpc.*"; window_role = "presentation"; }; command = "move to output right, fullscreen"; }
];
};
}