Smol wayland fixes
This commit is contained in:
parent
10bb81a1e1
commit
8b9a61339e
2 changed files with 175 additions and 169 deletions
|
@ -36,7 +36,7 @@ def main() -> None:
|
||||||
|
|
||||||
theme = rich.terminal_theme.TerminalTheme(
|
theme = rich.terminal_theme.TerminalTheme(
|
||||||
base16_color(0x0),
|
base16_color(0x0),
|
||||||
base16_color(0x7),
|
base16_color(0x0), # TODO Should be 0x7 but otherwise spacer is white
|
||||||
[
|
[
|
||||||
base16_color(0x0), # black
|
base16_color(0x0), # black
|
||||||
base16_color(0x8), # red
|
base16_color(0x8), # red
|
||||||
|
@ -80,6 +80,7 @@ def main() -> None:
|
||||||
alignment=Alignment.LEFT,
|
alignment=Alignment.LEFT,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
if dual_screen:
|
if dual_screen:
|
||||||
bar.add_provider(
|
bar.add_provider(
|
||||||
frobar.providers.I3WindowTitleProvider(color=color("white")),
|
frobar.providers.I3WindowTitleProvider(color=color("white")),
|
||||||
|
|
|
@ -87,177 +87,182 @@ in
|
||||||
};
|
};
|
||||||
wayland = {
|
wayland = {
|
||||||
systemd.target = "sway-session.target";
|
systemd.target = "sway-session.target";
|
||||||
windowManager.sway.checkConfig = false; # us_qwerty-fr is not in the testing environment
|
windowManager.sway = {
|
||||||
};
|
checkConfig = false; # us_qwerty-fr is not in the testing environment
|
||||||
# https://github.com/nix-community/home-manager/issues/5311
|
config = {
|
||||||
# Setting a compiled file is not desirable as it depends on the keyboard's, uuuh, key placement
|
# https://github.com/nix-community/home-manager/issues/5311
|
||||||
wayland.windowManager.sway.config = {
|
# Setting a compiled file is not desirable as it depends on the keyboard's, uuuh, key placement
|
||||||
input."*".xkb_layout = "us_qwerty-fr";
|
input."*".xkb_layout = "us_qwerty-fr";
|
||||||
modifier = lib.mkDefault "Mod4";
|
modifier = lib.mkDefault "Mod4";
|
||||||
fonts = {
|
fonts = {
|
||||||
names = [ config.stylix.fonts.sansSerif.name ];
|
names = [ config.stylix.fonts.sansSerif.name ];
|
||||||
size = lib.mkForce 8.0;
|
size = lib.mkForce 8.0;
|
||||||
};
|
|
||||||
terminal = "alacritty";
|
|
||||||
colors =
|
|
||||||
let
|
|
||||||
ignore = "#ff00ff";
|
|
||||||
in
|
|
||||||
with config.lib.stylix.colors.withHashtag;
|
|
||||||
lib.mkForce {
|
|
||||||
focused = {
|
|
||||||
border = base0B;
|
|
||||||
background = base0B;
|
|
||||||
text = base00;
|
|
||||||
indicator = base00;
|
|
||||||
childBorder = base0B;
|
|
||||||
};
|
};
|
||||||
focusedInactive = {
|
terminal = "alacritty";
|
||||||
border = base02;
|
colors =
|
||||||
background = base02;
|
let
|
||||||
text = base05;
|
ignore = "#ff00ff";
|
||||||
indicator = base02;
|
in
|
||||||
childBorder = base02;
|
with config.lib.stylix.colors.withHashtag;
|
||||||
};
|
lib.mkForce {
|
||||||
unfocused = {
|
focused = {
|
||||||
border = base05;
|
border = base0B;
|
||||||
background = base04;
|
background = base0B;
|
||||||
text = base00;
|
text = base00;
|
||||||
indicator = base04;
|
indicator = base00;
|
||||||
childBorder = base00;
|
childBorder = base0B;
|
||||||
};
|
};
|
||||||
urgent = {
|
focusedInactive = {
|
||||||
border = base0F;
|
border = base02;
|
||||||
background = base08;
|
background = base02;
|
||||||
text = base00;
|
text = base05;
|
||||||
indicator = base08;
|
indicator = base02;
|
||||||
childBorder = base0F;
|
childBorder = base02;
|
||||||
};
|
};
|
||||||
placeholder = {
|
unfocused = {
|
||||||
border = ignore;
|
border = base05;
|
||||||
background = base00;
|
background = base04;
|
||||||
text = base05;
|
text = base00;
|
||||||
indicator = ignore;
|
indicator = base04;
|
||||||
childBorder = base00;
|
childBorder = base00;
|
||||||
};
|
};
|
||||||
background = base07;
|
urgent = {
|
||||||
# I set the color of the active tab as the the background color of the terminal so they merge together.
|
border = base0F;
|
||||||
};
|
background = base08;
|
||||||
focus = {
|
text = base00;
|
||||||
followMouse = false;
|
indicator = base08;
|
||||||
mouseWarping = "container";
|
childBorder = base0F;
|
||||||
};
|
};
|
||||||
keybindings = lib.mkOptionDefault (
|
placeholder = {
|
||||||
{
|
border = ignore;
|
||||||
# Compatibility layer for people coming from other backgrounds
|
background = base00;
|
||||||
"Mod1+Tab" = "${rofi} -modi window -show window";
|
text = base05;
|
||||||
"Mod1+F2" = "${rofi} -modi drun -show drun";
|
indicator = ignore;
|
||||||
"Mod1+F4" = "kill";
|
childBorder = base00;
|
||||||
# kill focused window
|
};
|
||||||
"${mod}+z" = "kill";
|
background = base07;
|
||||||
button2 = "kill";
|
# I set the color of the active tab as the the background color of the terminal so they merge together.
|
||||||
# Rofi
|
|
||||||
"${mod}+i" = "exec --no-startup-id ${pkgs.rofimoji}/bin/rofimoji";
|
|
||||||
# start program launcher
|
|
||||||
"${mod}+d" = "${rofi} -modi run -show run";
|
|
||||||
"${mod}+Shift+d" = "${rofi} -modi drun -show drun";
|
|
||||||
# Start Applications
|
|
||||||
"${mod}+p" = "exec ${pkgs.xfce.thunar}/bin/thunar";
|
|
||||||
# workspace back and forth (with/without active container)
|
|
||||||
"${mod}+b" = "workspace back_and_forth";
|
|
||||||
"${mod}+Shift+b" = "move container to workspace back_and_forth; workspace back_and_forth";
|
|
||||||
# Split horizontally (rebound from ${mod}+b because used above)
|
|
||||||
"${mod}+g" = "splith";
|
|
||||||
# Change container layout
|
|
||||||
"${mod}+q" = "focus child";
|
|
||||||
# i3 control
|
|
||||||
"${mod}+Shift+r" = "restart";
|
|
||||||
# Warp around (ex-keynav)
|
|
||||||
"Mod4+Mod1+x" = "exec ${lib.getExe pkgs.warpd} --hint";
|
|
||||||
"Mod4+Mod1+c" = "exec ${lib.getExe pkgs.warpd} --normal";
|
|
||||||
"Mod4+Mod1+g" = "exec ${lib.getExe pkgs.warpd} --grid";
|
|
||||||
}
|
|
||||||
// lib.mapAttrs' (k: v: lib.nameValuePair v.enter ''mode "${v.name}"'') (
|
|
||||||
lib.filterAttrs (k: v: v.enter != null) modes
|
|
||||||
)
|
|
||||||
// lib.attrsets.mergeAttrsList (
|
|
||||||
forEachCardinal (c: {
|
|
||||||
#navigate workspaces next / previous
|
|
||||||
"${mod}+Ctrl+${c.vi}" = "workspace ${c.workspace}";
|
|
||||||
# Move to workspace next / previous with focused container
|
|
||||||
"${mod}+Ctrl+Shift+${c.vi}" =
|
|
||||||
"move container to workspace ${c.workspace}; workspace ${c.workspace}";
|
|
||||||
# move workspaces to screen (arrow keys)
|
|
||||||
"${mod}+Ctrl+Shift+${c.arrow}" = "move workspace to output ${c.output}";
|
|
||||||
})
|
|
||||||
)
|
|
||||||
// lib.attrsets.mergeAttrsList (
|
|
||||||
forEachWorkspace (w: {
|
|
||||||
# move container to workspace, do not follow (normally bound to ${mod}+Shift+${w.key}
|
|
||||||
"${mod}+Ctrl+${w.key}" = "move container to workspace number ${w.name}";
|
|
||||||
# move container to workspace, follow it
|
|
||||||
"${mod}+Shift+${w.key}" =
|
|
||||||
"move container to workspace number ${w.name}; workspace number ${w.name}";
|
|
||||||
})
|
|
||||||
)
|
|
||||||
);
|
|
||||||
modes = lib.mkOptionDefault (
|
|
||||||
lib.mapAttrs' (
|
|
||||||
k: v:
|
|
||||||
lib.nameValuePair v.name (
|
|
||||||
v.bindings
|
|
||||||
// lib.optionalAttrs v.return_bindings {
|
|
||||||
"Return" = "mode default";
|
|
||||||
"Escape" = "mode default";
|
|
||||||
}
|
|
||||||
)
|
|
||||||
) modes
|
|
||||||
);
|
|
||||||
window = {
|
|
||||||
hideEdgeBorders = "both";
|
|
||||||
titlebar = false; # So that single-container screens are basically almost fullscreen
|
|
||||||
commands = [
|
|
||||||
# switch to workspace with urgent window automatically
|
|
||||||
{
|
|
||||||
criteria = {
|
|
||||||
urgent = "latest";
|
|
||||||
};
|
};
|
||||||
command = "focus";
|
focus = {
|
||||||
}
|
followMouse = false;
|
||||||
];
|
mouseWarping = "container";
|
||||||
};
|
};
|
||||||
floating = {
|
keybindings = lib.mkOptionDefault (
|
||||||
criteria = [
|
{
|
||||||
{ window_role = "pop-up"; }
|
# Compatibility layer for people coming from other backgrounds
|
||||||
{ window_role = "task_dialog"; }
|
"Mod1+Tab" = "${rofi} -modi window -show window";
|
||||||
];
|
"Mod1+F2" = "${rofi} -modi drun -show drun";
|
||||||
};
|
"Mod1+F4" = "kill";
|
||||||
seat."*".hide_cursor = "5000";
|
# kill focused window
|
||||||
startup = [
|
"${mod}+z" = "kill";
|
||||||
{
|
button2 = "kill";
|
||||||
command = "${
|
# Rofi
|
||||||
pkgs.writeShellApplication {
|
"${mod}+i" = "exec --no-startup-id ${pkgs.rofimoji}/bin/rofimoji";
|
||||||
name = "batteryNotify";
|
# start program launcher
|
||||||
runtimeInputs = with pkgs; [
|
"${mod}+d" = "${rofi} -modi run -show run";
|
||||||
coreutils
|
"${mod}+Shift+d" = "${rofi} -modi drun -show drun";
|
||||||
libnotify
|
# Start Applications
|
||||||
];
|
"${mod}+p" = "exec ${pkgs.xfce.thunar}/bin/thunar";
|
||||||
text = builtins.readFile ./batteryNotify.sh;
|
# workspace back and forth (with/without active container)
|
||||||
# TODO Use batsignal instead?
|
"${mod}+b" = "workspace back_and_forth";
|
||||||
# TODO Only on computers with battery
|
"${mod}+Shift+b" = "move container to workspace back_and_forth; workspace back_and_forth";
|
||||||
|
# Split horizontally (rebound from ${mod}+b because used above)
|
||||||
|
"${mod}+g" = "splith";
|
||||||
|
# Change container layout
|
||||||
|
"${mod}+q" = "focus child";
|
||||||
|
# i3 control
|
||||||
|
"${mod}+Shift+r" = "restart";
|
||||||
|
# Warp around (ex-keynav)
|
||||||
|
"Mod4+Mod1+x" = "exec ${lib.getExe pkgs.warpd} --hint";
|
||||||
|
"Mod4+Mod1+c" = "exec ${lib.getExe pkgs.warpd} --normal";
|
||||||
|
"Mod4+Mod1+g" = "exec ${lib.getExe pkgs.warpd} --grid";
|
||||||
}
|
}
|
||||||
}/bin/batteryNotify";
|
// lib.mapAttrs' (k: v: lib.nameValuePair v.enter ''mode "${v.name}"'') (
|
||||||
}
|
lib.filterAttrs (k: v: v.enter != null) modes
|
||||||
];
|
)
|
||||||
workspaceLayout = "tabbed";
|
// lib.attrsets.mergeAttrsList (
|
||||||
workspaceOutputAssign = lib.mkIf (builtins.length screenCombinations > 0) (
|
forEachCardinal (c: {
|
||||||
forEachWorkspace (w: {
|
#navigate workspaces next / previous
|
||||||
output = builtins.map (
|
"${mod}+Ctrl+${c.vi}" = "workspace ${c.workspace}";
|
||||||
combination: builtins.elemAt combination (lib.mod w.id (builtins.length combination))
|
# Move to workspace next / previous with focused container
|
||||||
) screenCombinations;
|
"${mod}+Ctrl+Shift+${c.vi}" =
|
||||||
workspace = w.name;
|
"move container to workspace ${c.workspace}; workspace ${c.workspace}";
|
||||||
})
|
# move workspaces to screen (arrow keys)
|
||||||
);
|
"${mod}+Ctrl+Shift+${c.arrow}" = "move workspace to output ${c.output}";
|
||||||
|
})
|
||||||
|
)
|
||||||
|
// lib.attrsets.mergeAttrsList (
|
||||||
|
forEachWorkspace (w: {
|
||||||
|
# move container to workspace, do not follow (normally bound to ${mod}+Shift+${w.key}
|
||||||
|
"${mod}+Ctrl+${w.key}" = "move container to workspace number ${w.name}";
|
||||||
|
# move container to workspace, follow it
|
||||||
|
"${mod}+Shift+${w.key}" =
|
||||||
|
"move container to workspace number ${w.name}; workspace number ${w.name}";
|
||||||
|
})
|
||||||
|
)
|
||||||
|
);
|
||||||
|
modes = lib.mkOptionDefault (
|
||||||
|
lib.mapAttrs' (
|
||||||
|
k: v:
|
||||||
|
lib.nameValuePair v.name (
|
||||||
|
v.bindings
|
||||||
|
// lib.optionalAttrs v.return_bindings {
|
||||||
|
"Return" = "mode default";
|
||||||
|
"Escape" = "mode default";
|
||||||
|
}
|
||||||
|
)
|
||||||
|
) modes
|
||||||
|
);
|
||||||
|
window = {
|
||||||
|
hideEdgeBorders = "both";
|
||||||
|
titlebar = false; # So that single-container screens are basically almost fullscreen
|
||||||
|
commands = [
|
||||||
|
# switch to workspace with urgent window automatically
|
||||||
|
{
|
||||||
|
criteria = {
|
||||||
|
urgent = "latest";
|
||||||
|
};
|
||||||
|
command = "focus";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
floating = {
|
||||||
|
criteria = [
|
||||||
|
{ window_role = "pop-up"; }
|
||||||
|
{ window_role = "task_dialog"; }
|
||||||
|
];
|
||||||
|
};
|
||||||
|
seat."*".hide_cursor = "5000";
|
||||||
|
startup = [
|
||||||
|
{
|
||||||
|
command = "${
|
||||||
|
pkgs.writeShellApplication {
|
||||||
|
name = "batteryNotify";
|
||||||
|
runtimeInputs = with pkgs; [
|
||||||
|
coreutils
|
||||||
|
libnotify
|
||||||
|
];
|
||||||
|
text = builtins.readFile ./batteryNotify.sh;
|
||||||
|
# TODO Use batsignal instead?
|
||||||
|
# TODO Only on computers with battery
|
||||||
|
}
|
||||||
|
}/bin/batteryNotify";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
workspaceLayout = "tabbed";
|
||||||
|
workspaceOutputAssign = lib.mkIf (builtins.length screenCombinations > 0) (
|
||||||
|
forEachWorkspace (w: {
|
||||||
|
output = builtins.map (
|
||||||
|
combination: builtins.elemAt combination (lib.mod w.id (builtins.length combination))
|
||||||
|
) screenCombinations;
|
||||||
|
workspace = w.name;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
};
|
||||||
|
extraConfig = ''
|
||||||
|
titlebar_padding 3
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
frogeye.desktop.i3.bindmodes = {
|
frogeye.desktop.i3.bindmodes = {
|
||||||
"[L] Vérouillage [E] Déconnexion [S] Veille [H] Hibernation [R] Redémarrage [P] Extinction" = {
|
"[L] Vérouillage [E] Déconnexion [S] Veille [H] Hibernation [R] Redémarrage [P] Extinction" = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue