diff --git a/modules/desktop/home/eww/configDir/bottomBar/workspaces.yuck b/modules/desktop/home/eww/configDir/bottomBar/workspaces.yuck index 16215ff..6e2224f 100644 --- a/modules/desktop/home/eww/configDir/bottomBar/workspaces.yuck +++ b/modules/desktop/home/eww/configDir/bottomBar/workspaces.yuck @@ -6,7 +6,7 @@ :style "border-bottom: 4px solid ${workspace.color}${workspace.active ? "; background-color: #3c3836" : ""}" :class "${workspace.focused ? "focused" : ""}" :onclick "swaymsg workspace ${workspace.name}" - (label :text "${workspace.idx}") + (label :text "${workspace.icon ?: workspace.idx}") ) ) ) diff --git a/modules/desktop/home/eww/configDir/eww.css b/modules/desktop/home/eww/configDir/eww.css index 90d015d..4b93d39 100644 --- a/modules/desktop/home/eww/configDir/eww.css +++ b/modules/desktop/home/eww/configDir/eww.css @@ -13,7 +13,7 @@ button { .workspaces button { border: 0px; - padding: 0 3px; + padding: 5px 4px 0 4px; } .workspaces button.focused { diff --git a/modules/desktop/home/niri/binds.nix b/modules/desktop/home/niri/binds.nix index 7b10064..1df47c0 100644 --- a/modules/desktop/home/niri/binds.nix +++ b/modules/desktop/home/niri/binds.nix @@ -50,7 +50,7 @@ "Mod+Shift+E".action.quit = [ ]; "Mod+Shift+Q".action.close-window = [ ]; - "Mod+Shift+P".action.power-off-monitors = [ ]; + "Mod+Ctrl+Shift+P".action.power-off-monitors = [ ]; "Mod+Shift+Ctrl+Slash".action.toggle-keyboard-shortcuts-inhibit = [ ]; "Mod+Shift+Ctrl+Slash".allow-inhibiting = false; @@ -87,30 +87,6 @@ "Mod+Shift+Ctrl+K".action.move-column-to-monitor-up = [ ]; "Mod+Shift+Ctrl+L".action.move-column-to-monitor-right = [ ]; - # workspace controls - "Mod+P".action.focus-workspace-up = [ ]; - "Mod+N".action.focus-workspace-down = [ ]; - "Mod+Ctrl+P".action.move-column-to-workspace-up = [ ]; - "Mod+Ctrl+N".action.move-column-to-workspace-down = [ ]; - "Mod+1".action.focus-workspace = 1; - "Mod+2".action.focus-workspace = 2; - "Mod+3".action.focus-workspace = 3; - "Mod+4".action.focus-workspace = 4; - "Mod+5".action.focus-workspace = 5; - "Mod+6".action.focus-workspace = 6; - "Mod+7".action.focus-workspace = 7; - "Mod+8".action.focus-workspace = 8; - "Mod+9".action.focus-workspace = 9; - "Mod+Ctrl+1".action.move-column-to-workspace = 1; - "Mod+Ctrl+2".action.move-column-to-workspace = 2; - "Mod+Ctrl+3".action.move-column-to-workspace = 3; - "Mod+Ctrl+4".action.move-column-to-workspace = 4; - "Mod+Ctrl+5".action.move-column-to-workspace = 5; - "Mod+Ctrl+6".action.move-column-to-workspace = 6; - "Mod+Ctrl+7".action.move-column-to-workspace = 7; - "Mod+Ctrl+8".action.move-column-to-workspace = 8; - "Mod+Ctrl+9".action.move-column-to-workspace = 9; - # column editing stuffs "Mod+BracketLeft".action.consume-or-expel-window-left = [ ]; "Mod+BracketRight".action.consume-or-expel-window-right = [ ]; @@ -120,7 +96,7 @@ "Mod+Equal".action.set-column-width = "+5%"; "Mod+Shift+Minus".action.set-window-height = "-10%"; "Mod+Shift+Equal".action.set-window-height = "+10%"; - "Mod+W".action.toggle-column-tabbed-display = [ ]; + "Mod+Shift+W".action.toggle-column-tabbed-display = [ ]; "Mod+Shift+F".action.expand-column-to-available-width = [ ]; "Mod+Ctrl+F".action.fullscreen-window = [ ]; diff --git a/modules/desktop/home/niri/default.nix b/modules/desktop/home/niri/default.nix index 779106f..98ec63f 100644 --- a/modules/desktop/home/niri/default.nix +++ b/modules/desktop/home/niri/default.nix @@ -1,13 +1,14 @@ { pkgs, ... }: { imports = [ - ./xwayland-sat.nix - ./screenshot.nix - ./input.nix ./binds.nix - ./style.nix + ./input.nix ./privacy.nix ./quirks.nix + ./screenshot.nix + ./style.nix + ./workspaces.nix + ./xwayland-sat.nix ]; programs.niri.settings = { outputs."eDP-1" = { diff --git a/modules/desktop/home/niri/workspaces.nix b/modules/desktop/home/niri/workspaces.nix new file mode 100644 index 0000000..c9e6519 --- /dev/null +++ b/modules/desktop/home/niri/workspaces.nix @@ -0,0 +1,83 @@ +# { ... }: +{ + programs.niri.settings = + let + social = "aaa social"; + browser = "bbb browser"; + notes = "ccc notes"; + in + { + workspaces = { + "aaa social" = { }; + "bbb browser" = { }; + "ccc notes" = { }; + }; + + spawn-at-startup = [ + { command = [ "Discord" ]; } + { command = [ "element-desktop" ]; } + { command = [ "signal-desktop" ]; } + { command = [ ".evolution-wrapped_" ]; } + + { command = [ "obsidian" ]; } + { command = [ "firefox" ]; } + ]; + + window-rules = [ + { + matches = [ + { app-id = "^signal|Element|org\.gnome\.Evolution$|discord"; } + ]; + open-on-workspace = social; + } + { + matches = [ + { app-id = "^firefox|Chromium-browser$"; } + ]; + open-on-workspace = browser; + } + { + matches = [ + { app-id = "obsidian"; } + ]; + open-on-workspace = notes; + } + ]; + + # all workspace binds here, + binds = { + "Mod+P".action.focus-workspace-up = [ ]; + "Mod+N".action.focus-workspace-down = [ ]; + "Mod+Ctrl+P".action.move-workspace-up = [ ]; + "Mod+Ctrl+N".action.move-workspace-down = [ ]; + "Mod+Shift+P".action.move-column-to-workspace-up = [ ]; + "Mod+Shift+N".action.move-column-to-workspace-down = [ ]; + + "Mod+Q".action.focus-workspace = social; + "Mod+W".action.focus-workspace = browser; + "Mod+E".action.focus-workspace = notes; + "Mod+Ctrl+Q".action.move-column-to-workspace = social; + "Mod+Ctrl+W".action.move-column-to-workspace = browser; + "Mod+Ctrl+E".action.move-column-to-workspace = notes; + + "Mod+1".action.focus-workspace = 4; + "Mod+2".action.focus-workspace = 5; + "Mod+3".action.focus-workspace = 6; + "Mod+4".action.focus-workspace = 7; + "Mod+5".action.focus-workspace = 8; + "Mod+6".action.focus-workspace = 9; + "Mod+7".action.focus-workspace = 10; + "Mod+8".action.focus-workspace = 11; + "Mod+9".action.focus-workspace = 12; + "Mod+Ctrl+1".action.move-column-to-workspace = 4; + "Mod+Ctrl+2".action.move-column-to-workspace = 5; + "Mod+Ctrl+3".action.move-column-to-workspace = 6; + "Mod+Ctrl+4".action.move-column-to-workspace = 7; + "Mod+Ctrl+5".action.move-column-to-workspace = 8; + "Mod+Ctrl+6".action.move-column-to-workspace = 9; + "Mod+Ctrl+7".action.move-column-to-workspace = 10; + "Mod+Ctrl+8".action.move-column-to-workspace = 11; + "Mod+Ctrl+9".action.move-column-to-workspace = 12; + }; + }; +} diff --git a/programs/bar-ws-monitor/src/main.rs b/programs/bar-ws-monitor/src/main.rs index 28165ab..090ca9b 100644 --- a/programs/bar-ws-monitor/src/main.rs +++ b/programs/bar-ws-monitor/src/main.rs @@ -89,6 +89,7 @@ fn main() -> Result<(), std::io::Error> { output, is_active, is_focused, + name, .. }| WsData { color: output_colors_lut[&output.clone().expect("unreachable")] @@ -96,6 +97,12 @@ fn main() -> Result<(), std::io::Error> { idx: *idx, focused: *is_focused, active: *is_active, + icon: name.as_ref().map(|name| match name.as_str() { + "aaa social" => "󰭹", + "bbb browser" => "󰈹", + "ccc notes" => "󰎚", + &_ => "!", + }), }, ) .collect::>(); @@ -113,4 +120,5 @@ struct WsData { idx: u8, focused: bool, active: bool, + icon: Option<&'static str>, }