[i3+sway] Some sway fixes

This commit is contained in:
2025-11-15 12:15:42 -08:00
parent c2e2dd8675
commit 608fed35ab
2 changed files with 33 additions and 29 deletions

View File

@@ -1,4 +1,4 @@
{ config, lib, ... }: { config, lib, pkgs, ... }:
with lib; with lib;
@@ -10,16 +10,9 @@ let
terminal = "ghostty"; terminal = "ghostty";
defaultWorkspace = "workspace number 1"; defaultWorkspace = "workspace number 1";
bars = [{
position = "bottom";
statusCommand = "i3status";
trayOutput = "primary"; # Enable system tray on primary output
}];
keybindings = { keybindings = {
"${shared_config.modifier}+Return" = "exec ${terminal}"; "${shared_config.modifier}+Return" = "exec ${terminal}";
"${shared_config.modifier}+Shift+q" = "kill"; "${shared_config.modifier}+Shift+q" = "kill";
# Menu binding will be overridden in each window manager config
"${shared_config.modifier}+h" = "focus left"; "${shared_config.modifier}+h" = "focus left";
"${shared_config.modifier}+j" = "focus down"; "${shared_config.modifier}+j" = "focus down";
@@ -114,8 +107,12 @@ in {
config = { config = {
xsession.windowManager.i3 = let xsession.windowManager.i3 = let
base_i3_config = recursiveUpdate shared_config { base_i3_config = recursiveUpdate shared_config {
menu = "rofi -show drun"; bars = [{
keybindings = { position = "bottom";
statusCommand = "${pkgs.i3status}/bin/i3status";
trayOutput = "primary"; # Enable system tray on primary output
}];
keybindings = shared_config.keybindings // {
"${shared_config.modifier}+d" = "exec rofi -show drun"; "${shared_config.modifier}+d" = "exec rofi -show drun";
"${shared_config.modifier}+Shift+e" = "${shared_config.modifier}+Shift+e" =
"exec i3-nagbar -t warning -m 'Do you want to exit i3?' -b 'Yes' 'i3-msg exit'"; "exec i3-nagbar -t warning -m 'Do you want to exit i3?' -b 'Yes' 'i3-msg exit'";
@@ -154,8 +151,8 @@ in {
wayland.windowManager.sway = let wayland.windowManager.sway = let
base_sway_config = recursiveUpdate shared_config { base_sway_config = recursiveUpdate shared_config {
menu = "wofi --show drun"; bars = []; # Disable default bar, use waybar instead
keybindings = { keybindings = shared_config.keybindings // {
"${shared_config.modifier}+d" = "exec wofi --show drun"; "${shared_config.modifier}+d" = "exec wofi --show drun";
"${shared_config.modifier}+Shift+e" = "${shared_config.modifier}+Shift+e" =
"exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'"; "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'";
@@ -182,5 +179,28 @@ in {
enable = true; enable = true;
config = recursiveUpdate base_sway_config cfg.extraSwayConfig; config = recursiveUpdate base_sway_config cfg.extraSwayConfig;
}; };
programs.waybar = {
enable = true;
systemd.enable = true;
};
programs.rofi = {
enable = true;
theme = "solarized";
extraConfig = {
modi = "drun,run,window";
show-icons = true;
drun-display-format = "{name}";
disable-history = false;
hide-scrollbar = true;
display-drun = " Apps";
display-run = " Run";
display-window = " Windows";
sidebar-mode = true;
};
};
programs.i3status.enable = true;
}; };
} }

View File

@@ -77,22 +77,6 @@ in
programs.spotify-player.enable = true; programs.spotify-player.enable = true;
programs.rofi = {
enable = true;
theme = "solarized";
extraConfig = {
modi = "drun,run,window";
show-icons = true;
drun-display-format = "{name}";
disable-history = false;
hide-scrollbar = true;
display-drun = " Apps";
display-run = " Run";
display-window = " Windows";
sidebar-mode = true;
};
};
services.gnome-keyring = { services.gnome-keyring = {
enable = true; enable = true;
}; };